All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Added for new features.
- Changed for changes in existing functionality.
- Deprecated for soon-to-be removed features.
- Removed for now removed features.
- Fixed for any bug fixes.
- Security in case of vulnerabilities.
- Add ability to create adaptors which provide access to external data sources #134
- Add access to the Electricity Maps API free tier #134
- Allow access to individual models and their internal functions #195
- Update the Github actions testing matrix to Node 18,20, and 22 #242
- Add the Sustainable Web Design Rating system #205
- Add the updated Sustainable Web Design Model version 4 #119
- Automated monthly update of annual average grid intensity data.
- Add access to more verbose data response from Greencheck API
- Removed Page X-ray specific functions:
perDomain
perPage
perContentType
dirtiestResources
perParty
- Automated monthly update of annual average grid intensity data.
- Removing Page X-ray specific functions:
perDomain
perPage
perContentType
dirtiestResources
perParty
- Automated monthly update of annual average grid intensity data.
- Adds user agent header for requests to Green Web Foundation APIs
- Removed
index.d.ts
in favour of importing type definitions from@types/tgwf__co2
. - Reduce package size by excluding files from publish NPM package.
- Automated monthly update of annual average grid intensity data.
- Automated monthly update of annual average grid intensity data.
- Fix to return expected results when variables with 0 value are passed into function
- Automated monthly update of annual average grid intensity data.
- Properly use value of 0 for system segments and variables in the perByteTrace and perVisitTrace functions.
- Automated monthly update of annual average grid intensity data.
- Automated monthly update of annual average grid intensity data.
- Automated monthly update of annual average grid intensity data.
- Create FUNDING.yml to allow sponsor contribution to this project.
- Store segment flag on CO2 instance, not models.
- Automated monthly update of annual average grid intensity data.
- Fixed an error when try to use global grid intensities in IIFE. (PR #147)
- Updated the global grid intensity constant to use the latest WORLD grid intensity value from Ember. (PR #142)
- Fix to ensure that region names that are keys in the average annual grid intensity export are capitalised.
- Fixed the import of average grid intensities in node. (PR #137)
In PR #135 there were significant changes made to how average annual grid intensities are fetched and generated.
- Updated average annual grid intensities to include 2022 values from Ember.
- Changed the functions to generate average grid intensities to:
- Fetch data directly from Ember's API.
- Get the latest annual average values for each country/region.
- Renamed the average grid intensities export file.
- Add a module declaration for use from typescript (PR #131)
- Updated 2021 average annual grid intensity values (PR #133)
- Removed incorrectly imported constants in tests.
- Introduced two new functions
perByteTrace
andperVisitTrace
which allow developers to pass an options object containing customised values for the constants used in the Sustainable Web Design model. (PR #126)
- Allowed developers now have the option to return a breakdown of carbon emissions estimates by system segment when using the Sustainable Web Design model. (PR #113)
- Updated the
greenCheckMulti
function to work properly in ESM. (PR #123)
- Corrected the Node export for the hosting raised in issue #110. (PR #118)
- v0.11.x updates increased library size to 17MB + when published to NPM. This has been raised in #108 and it was found data files were being included in the published package. (PR #117)
- We have used generic filenames for data files, to avoid any confusion around the data being provided in this library. (PR #112)
- Introduced average and marginal carbon intensity data into the library. This comes from Ember Climate (for average carbon intensity data), and The Green Web Foundation (marginal intensity data, originally sourced from the UNFCCC - the United Nations Framework Convention on Climate Change). For more, see our release guide for v0.11 about the differences between the kinds of data. See #64, and #97 for more.
- Added new paths to
import
andrequire
the annual, country-level average and marginal carbon intensity data mentioned above like, as javascript objects, or as JSON. See #104 for more. - Added links to CO2.js in forms already available on CDNs to avoid needing to npm install it to try it out. See #105 for more.
- Introduced scripts to automate the generation of grid intensity data based of Ember & UNFCCC source files.
- Introduced a
release:minor
command, to automate the publishing process, to complementrelease:patch
.
- Changed the default model for transfer based CO2 calculations from the 1byte model to the Sustainable Web Design model instead. See https://developers.thegreenwebfoundation.org/co2js/models/ for guidance on the differences and how to migrate between them. See #94 for more.
- Updated our release commands to generate and format the carbon intensity data as part of the release process.
- Introduced a
release:patch
command, to automate the publishing process. This is designed to make sure we always publish the most recent compiled code, by adding a rebuild step that can be easy to forget.
- Introduced a new
perVisit()
function for the Sustainable Web Design model, which applies caching and return visits assumptions.
- Added the ability to set the model used by CO2.js to the Sustainable Web Design model, using a simple 'swd' string, instead of needing to pass in a class.
This release used a version bump as previously we had released v0.10.0 under a pre-release tag.
- Added ES import syntax as the main way for handling imports and exports of code within the module.
- Changed eslint settings to use later version of ecmascript (2020)
- Change the build tools to use esbulid with jest instead of babel
- Added more consistent use of the debug logging library in files using the updated import syntax
- Fixed the incorrect order of FIRST_TIME_VIEWING_PERCENTAGE and RETURNING_VISITOR_PERCENTAGE constants in the SWD model. This will result in larger values for calculations using the sustainable web design, and the default caching assumptions.
- Added newly implemented Sustainable Web Design model [thanks @dryden!]
- Added new readme page for using both emissions models
- Added new source of data to the Sustainable Web Design model from Ember Climate.
- Changed the CO2 class to accept either the One Byte model or the Sustainable Web Design model
- Fixed various typos.
- Update further dependencies
- Fix embarassing order of magnitude typo in 1byte model (thanks @mstaschik!)
- Read JSON blob also as gzipped #44 (thanks @soulgalore)
- The 1byte model will give different numbers now. It's mentioned in
#fixed
but it's worth repeating.
- Update tests to avoid network requests #50
- Update dependencies across the board
- Switch to github actions instead of travis for CI.
- Added the function to load JSON, on the tgwg.hosting object, for use in the sustaiable web sitespeed plugin.
- Added the hosting-JSON for running local checks against an array instead of SQLite.
- Swapped out checking against a sqlite database
hosting-json
in favour of simple array in, - Updated conventions for style - using kebab-cases over CamelCase for naming files
- Extracted sqlite usage and dependencies into a separate module,
url2green
. This means you no longer need to compile SQLite on install.
- Updated README
- Updated the emissions figured for green energy after further research on methodology with @@JamieBeevor
- Incorporated class based CO2 models from @soulgalore
- Credit contributors
- Added a changelog at last!
- Changelog inconsistency section in Bad Practices
Added the (currently unused) green byte model.
Update the 1byte model to use an average of devices, rather than just wifi
Split hosting API into two separate files (one for sqlite, and one relying on the greencheck API)