Closed mrchrisadams closed 2 years ago
@mrchrisadams should we output the IIFE version to the /dist
folder as well (currently gets built to /public
). In this way we can document how people can build the library from source & point them to a single output location with all three versions.
I've created a GitPod configuration file for the project. This builds the different versions & opens the demo in the /public
folder when the repo is launched in GitPod.
Sup @fershad
should we output the IIFE version to the /dist folder as well (currently gets built to /public). In this way we can document how people can build the library from source & point them to a single output location with all three versions.
I think this is a good idea. I had initially thought that it made sense to copy of the iife version it from /dist
to /public
, so that people could serve just files in the public
folder by itself.
But if it's not necessary to do that I'm happy to refer to the iife in dist
.
There are two other items in this PR to be completed:
Because we already have another inbound PR for updated documentation, and because the shift to the SWD model likely changes some resulting carbon calculations, I'm happy to split these both out. so we can get 0.10.0 published to npm and merged back into main.
I'm happy to support your decision here - if you do, would please either create or link to the corresponding issues so we can queue them up for a future release?
Oh @fershad - if you do, can you please move the issue about switching the default calculation model to the next milestone, so I know to get the dev work lined up for them?
OK, I think once this release is merged in, we'll have some nicer docs for trying out co2.js That would close off the updated docs for first use
item in our checklist, leaving just the SWD item before we can merge this into main and release 0.10.0
https://github.com/thegreenwebfoundation/developer-docs/pull/1
Oh @fershad - if you do, can you please move the issue about switching the default calculation model to the next milestone, so I know to get the dev work lined up for them?
I've moved that to the 0.11.0 milestone.
Hey @fershad - I think with the developer docs up, and the switch to SWD as default model bumped to the next release, that we're good to merge this in.
I'm just going to add some notes here to think out loud about the changes.
The shift to 0.9 to 0.10 should result in minimal changes to calcs, as we shift from gigabytes being 1024 * 1024 * 1024
to being 1000 * 1000 * 1000
.
Any code consuming the co2.js should still work as it did before, as we haven't made any breaking changes to the API.
I'll send an email to a few folks I know using CO2.sh, and ask them about running npm install @tgwf/co2@beta
as a sanity check before we publish this under the @latest
tag.
Being able to point to the updated developer docs, before publishing the updated version to npm ought to help.
Thanks @mrchrisadams I'll add a small update to the README in this PR to point to the docs site.
Actually @fershad - there's one check we need to make on this before we merge in. I want to sanity check the calcs against a spreadsheet, and document how to do the same, so others can do so as well.
OK, I've resolved the discrepancies here between the code and the spreadsheet. It was a by product of CO2.js using rounded numbers, and the spreadsheet not using the rounded figures. Merging in.
This PR brings back the work carried out with @fershad to improve the developer experience and documentation for using CO2.js.
This includes:
src
directory