Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce unnecessary package size #291

Open
Owen3H opened this issue Jun 24, 2023 · 6 comments
Open

Reduce unnecessary package size #291

Owen3H opened this issue Jun 24, 2023 · 6 comments

Comments

@Owen3H
Copy link

Owen3H commented Jun 24, 2023

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)

@rom1504
Copy link
Member

rom1504 commented Jun 24, 2023

Curious what you mean by "bundle" specifically.

When compressed, all this data is about 2MB

@Owen3H Owen3H changed the title Reduce unnecessary bundle size Reduce unnecessary package size Jun 24, 2023
@rom1504
Copy link
Member

rom1504 commented Jun 24, 2023

Why is unpacked size important?

@extremeheat
Copy link
Member

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.

@Owen3H Owen3H closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2023
@extremeheat extremeheat reopened this Jul 10, 2023
@extremeheat
Copy link
Member

Link to discord discussion https://discord.com/channels/413438066984747026/743199746876768318/1127735522626904074 - some proposals about compression and using alternative packages discussed

@extremeheat
Copy link
Member

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)

@rom1504
Copy link
Member

rom1504 commented Jul 10, 2023

related #185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants