11.6 kBMarkdownView Raw
1# Changelog
2
3All notable changes to this project will be documented in this file.
4
5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
8> - **Added** for new features.
9> - **Changed** for changes in existing functionality.
10> - **Deprecated** for soon-to-be removed features.
11> - **Removed** for now removed features.
12> - **Fixed** for any bug fixes.
13> - **Security** in case of vulnerabilities.
14
15## Unreleased
16
17- Add ability to create adaptors which provide access to external data sources #134
18- Add access to the Electricity Maps API free tier #134
19- Allow access to individual models and their internal functions #195
20<!-- - _(Add a summary of your feature, and if relevant the issue, in your PR for merging into `main`)_ -->
21
22## Released
23
24### [0.16.3] - 2024-11-30
25
26#### Fixed
27
28- Include all gridIntensity values when running the perVisitTrace or perByteTrace functions. #237
29
30### [0.16.2] - 2024-11-12
31
32#### _Added_
33
34- Add JSDoc comments to data generation scripts and outputs #230
35- Added basic error handling to data fetch in emissions script #221
36
37#### Fixed
38
39- Bump url2green version #238
40
41#### Changed
42
43- Automated monthly update of annual average grid intensity data.
44
45### [0.16.1] - 2024-09-10
46
47#### Changed
48
49- _[Experimental]_ Add minimum capability to publish CO2.js to JSR.
50- Automated monthly update of annual average grid intensity data.
51
52### [0.16.0] - 2024-07-01
53
54#### _Added_
55
56- Add the Sustainable Web Design Rating system #205
57- Add the updated Sustainable Web Design Model version 4 #119
58
59#### Changed
60
61- Automated monthly update of annual average grid intensity data.
62
63### [0.15.0] - 2024-05-03
64
65#### Changed
66
67- Add access to more verbose data response from Greencheck API
68
69#### Removed
70
71- Removed Page X-ray specific functions:
72 - `perDomain`
73 - `perPage`
74 - `perContentType`
75 - `dirtiestResources`
76 - `perParty`
77
78### [0.14.4] - 2024-03-08
79
80#### Changed
81
82- Automated monthly update of annual average grid intensity data.
83
84#### Deprecated
85
86- Removing Page X-ray specific functions:
87 - `perDomain`
88 - `perPage`
89 - `perContentType`
90 - `dirtiestResources`
91 - `perParty`
92
93### [0.14.3] - 2024-02-21
94
95#### Changed
96
97- Automated monthly update of annual average grid intensity data.
98
99### [0.14.2] - 2024-01-29
100
101- Adds user agent header for requests to Green Web Foundation APIs
102
103### [0.14.1] - 2024-01-09
104
105#### Changed
106
107- Removed `index.d.ts` in favour of importing type definitions from `@types/tgwf__co2`.
108- Reduce package size by excluding files from publish NPM package.
109- Automated monthly update of annual average grid intensity data.
110
111### [0.13.10] - 2023-12-16
112
113#### Changed
114
115- Automated monthly update of annual average grid intensity data.
116
117### [0.13.9] - 2023-11-07
118
119#### Fixed
120
121- Fix to return expected results when variables with 0 value are passed into function
122
123#### Changed
124
125- Automated monthly update of annual average grid intensity data.
126
127### [0.13.8] - 2023-10-09
128
129#### Fixed
130
131- Properly use value of 0 for system segments and variables in the perByteTrace and perVisitTrace functions.
132
133#### Changed
134
135- Automated monthly update of annual average grid intensity data.
136
137### [0.13.7] - 2023-09-13
138
139#### Changed
140
141- Automated monthly update of annual average grid intensity data.
142
143### [0.13.6] - 2023-08-08
144
145#### Changed
146
147- Automated monthly update of annual average grid intensity data.
148- Create FUNDING.yml to allow sponsor contribution to this project.
149- Store segment flag on CO2 instance, not models.
150
151### [0.13.5] - 2023-07-5
152
153#### Changed
154
155- Automated monthly update of annual average grid intensity data.
156
157### [0.13.4] - 2023-05-24
158
159#### Fixed
160
161- Fixed an error when try to use global grid intensities in IIFE. (PR #147)
162
163### [0.13.3] - 2023-05-18
164
165#### Changed
166
167- Updated the global grid intensity constant to use the latest WORLD grid intensity value from Ember. (PR #142)
168
169### [0.13.2] - 2023-04-21
170
171- Fix to ensure that region names that are keys in the average annual grid intensity export are capitalised.
172
173### [0.13.1] - 2023-04-20
174
175#### Fixed
176
177- Fixed the import of average grid intensities in node. (PR #137)
178
179### [0.13.0] - 2023-04-13
180
181#### Changed
182
183In PR #135 there were significant changes made to how average annual grid intensities are fetched and generated.
184
185- Updated average annual grid intensities to include 2022 values from Ember.
186- Changed the functions to generate average grid intensities to:
187 - Fetch data directly from Ember's API.
188 - Get the _latest_ annual average values for each country/region.
189- Renamed the average grid intensities export file.
190
191### [0.12.2] - 2023-03-01
192
193#### Added
194
195- Add a module declaration for use from typescript (PR #131)
196
197#### Changed
198
199- Updated 2021 average annual grid intensity values (PR #133)
200
201### [0.12.1] - 2023-02-02
202
203#### Fixed
204
205- Removed incorrectly imported constants in tests.
206
207### [0.12.0] - 2023-02-02
208
209#### Added
210
211- Introduced two new functions `perByteTrace` and `perVisitTrace` which allow developers to pass an options object containing customised values for the constants used in the Sustainable Web Design model. (PR #126)
212
213#### Changed
214
215- 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)
216
217### [0.11.4] - 2022-12-02
218
219#### Fixed
220
221- Updated the `greenCheckMulti` function to work properly in ESM. (PR #123)
222
223### [0.11.3] - 2022-10-13
224
225#### Fixed
226
227- Corrected the Node export for the hosting raised in issue #110. (PR #118)
228
229### [0.11.2] - 2022-10-11
230
231#### Fixed
232
233- v0.11.x updates increased library size to 17MB + when published to NPM. This has been raised in [#108](https://github.com/thegreenwebfoundation/co2.js/issues/108) and it was found data files were being included in the published package. (PR #117)
234
235### [0.11.1] - 2022-10-07
236
237#### Changed
238
239- We have used generic filenames for data files, to avoid any confusion around the data being provided in this library. (PR #112)
240
241### [0.11.0] - 2022-10-03
242
243#### Added
244
245- Introduced average and marginal carbon intensity data into the library. This comes from [Ember Climate](https://ember-climate.org/data/data-explorer/) (for average carbon intensity data), and [The Green Web Foundation](https://developers.thegreenwebfoundation.org/co2js/data) (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](https://www.thegreenwebfoundation.org/news/release-guide-co2-js-v0-11/) about the differences between the kinds of data. See [#64](https://github.com/thegreenwebfoundation/co2.js/issues/64), and [#97](https://github.com/thegreenwebfoundation/co2.js/issues/97) for more.
246- Added new paths to `import` and `require` the annual, country-level average and marginal carbon intensity data mentioned above like, as javascript objects, or as JSON. See [#104 for more](https://github.com/thegreenwebfoundation/co2.js/issues/104).
247- 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](https://github.com/thegreenwebfoundation/co2.js/issues/105).
248- Introduced scripts to automate the generation of grid intensity data based of Ember & UNFCCC source files.
249- Introduced a `release:minor` command, to automate the publishing process, to complement `release:patch`.
250
251#### Changed
252
253- 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](https://github.com/thegreenwebfoundation/co2.js/issues/94).
254- Updated our release commands to generate and format the carbon intensity data as part of the release process.
255
256### [0.10.4] - 2022-08-12
257
258#### Added
259
260- 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.
261
262### [0.10.3] - 2022-08-12
263
264#### Added
265
266- Introduced a new `perVisit()` function for the Sustainable Web Design model, which applies [caching and return visits assumptions](https://sustainablewebdesign.org/calculating-digital-emissions/).
267
268### [0.10.2] - 2022-08-12
269
270- 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.
271
272### [0.10.1] - 2022-08-01
273
274This release used a version bump as previously we had released v0.10.0 under a pre-release tag.
275
276### [0.10.0] - 2022-06-27
277
278- Added ES import syntax as the main way for handling imports and exports of code within the module.
279- Changed eslint settings to use later version of ecmascript (2020)
280- Change the build tools to use esbulid with jest instead of babel
281- Added more consistent use of the debug logging library in files using the updated import syntax
282- 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.
283
284### [0.9.0] - 2022-03-28
285
286#### Added
287
288- Added newly implemented Sustainable Web Design model [thanks @dryden!]
289- Added new readme page for using both emissions models
290- Added new source of data to the Sustainable Web Design model from Ember Climate.
291
292#### Changed
293
294- Changed the CO2 class to accept either the One Byte model or the Sustainable Web Design model
295
296#### Fixed
297
298- Fixed various typos.
299
300### [0.8.0] - 2021-11-28
301
302####  Fixed
303
304- Update further dependencies
305- Fix embarassing order of magnitude typo in 1byte model (thanks @mstaschik!)
306
307#### Added
308
309- Read JSON blob also as gzipped #44 (thanks @soulgalore)
310
311#### Changed
312
313- The 1byte model will give different numbers now. It's mentioned in `#fixed` but it's worth repeating.
314
315### [0.7.0] - 2021-11-28
316
317#### Fixed
318
319- Update tests to avoid network requests #50
320- Update dependencies across the board
321
322####  Changed
323
324- Switch to github actions instead of travis for CI.
325
326### [0.6.1] - 2020-03-15
327
328#### Fixed
329
330- Added the function to load JSON, on the tgwg.hosting object, for use in the sustaiable web sitespeed plugin.
331
332### [0.6.0] - 2020-03-15
333
334#### Added
335
336- Added the hosting-JSON for running local checks against an array instead of SQLite.
337
338#### Changed
339
340- Swapped out checking against a sqlite database `hosting-json`in favour of simple array in,
341- Updated conventions for style - using kebab-cases over CamelCase for naming files
342
343#### Removed
344
345- Extracted sqlite usage and dependencies into a separate module, `url2green`. This means you no longer need to compile SQLite on install.
346
347### [0.5.0] - 2020-03-03
348
349#### Changed
350
351- Updated README
352- Updated the emissions figured for green energy after further research on methodology with @@JamieBeevor
353- Incorporated class based CO2 models from @soulgalore
354- Credit contributors
355
356### [0.4.7] - 2020-03-02
357
358#### Added
359
360- Added a changelog at last!
361
362### [0.4.6] - 2020-03-01
363
364#### Added
365
366- Changelog inconsistency section in Bad Practices
367
368### [0.4.4] - 2020-03-01
369
370#### Added
371
372Added the (currently unused) green byte model.
373
374#### Changed
375
376Update the 1byte model to use an average of devices, rather than just wifi
377
378### [0.4.3] - 2020-03-01
379
380#### Added
381
382#### Changed
383
384Split hosting API into two separate files (one for sqlite, and one relying on the greencheck API)