node-minecraft-data
node-minecraft-data copied to clipboard
Reduce unnecessary package size
Currently, consuming the library pollutes node_modules
with over 100MB of data that most of the time is never actually used.
A simple way to largely reduce this would be splitting the platforms like so:
minecraft-data@pc
(Independent)
minecraft-data@bedrock
(Independent)
minecraft-data
(Depends on both)
Curious what you mean by "bundle" specifically.
When compressed, all this data is about 2MB
Why is unpacked size important?
This also isn't going to work, having 3 packages can have the opposite effect doubling the package size. For example, what happens when a package depends on minecraft-data
and then another package on minecraft-data@pc
? You get 1.5x right there in the dep tree. Not to mention having to change all the require statements.
Link to discord discussion https://discord.com/channels/413438066984747026/743199746876768318/1127735522626904074 - some proposals about compression and using alternative packages discussed
Rom suggested using a separate async package, I commented
I commented on an issue but to do that you’d also need to make sure all the subdeps are using the same package also otherwise it will use more disk space in the end. Including rewriting the requires() statement
Also for async that would probably be a breaking API change as most mcdata assumes static access (would require awaiting before you access any data)
related #185