ReactStateMuseum
ReactStateMuseum copied to clipboard
NPM lib size list?
Perhaps this awesome table on the main readme should list the NPM costs?
I'm not sure that's a fair thing to list? Just thinking it will help kill all that dead space, heh.
I think that would be cool👌
Doing this by hand is tedious. Automation is key.
Here's a plan that could work:
Create a file in each repo called NPMDep.json
Here, we list all the NPM dependencies that are required by npmjs name. Like so:
{
"npmdeps": ["mobx", "mobx-react", "mobx-state-tree"]
}
We then write a script that will go into each folder, grab those deps, look up their versions in the lock files, and then use package-size to properly identify their sizes in a JSON file.
A second script can go around and look at those JSON files in each folder and then add links to https://bundlephobia.com/ in the readme while also listing the known sizes. The process is automated, so any updates to libraries would get reflected when the script is re-run (that is critical).
The result would be a table in the readme with all the size costs, and a link to verify such!!!
Bundlephobia has min and minzip badges, you could save some time and just use those.
Raw markdown: [![minzipped bundle size](https://img.shields.io/bundlephobia/minzip/react.svg)](https://bundlephobia.com/result?p=react)
This displays the bundle size of the latest stable version on npm, you can add a locked version number ([email protected]
) to the url too.
very cool! I might work on this script this weekend. Thanks so much @solkimicreb
I haven't started on this script, but labeling it for pickup by Hacktoberfest.