question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`minecraft-protocol` increases `node_modules` size by more than 200%

See original GitHub issue

[x] The FAQ doesn’t contain a resolution to my issue

Versions

  • minecraft-protocol: 1.30.0
  • server: vanilla/spigot/paper n.a.
  • node: 16

Detailed description of a problem

The library includes a lot of dependencies, it increased the size of /node_modules by more than 200% and my docker image by about 50%. I believe this might be a bug (e.g. dev-dependencies included as prod-dependencies).

See also jojomatik/blockcluster#390. I’ve taken a look at the compressed sizes on dockerhub and have narrowed the range of commits down to the addition of this library to my project (even though the difference on dockerhub is pretty small in the compressed sizes).

Would you be able to take a look at all dependencies? Which ones are strictly necessary? Which dependencies would suffice as dev-dependencies? Would it be possible to make some dependencies optional, based on the protocol used?

Current code

n.a.

Expected behavior

/node_modules and docker image don’t increase dramatically.

Additional context

Before: image

image

After: image

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rom1504commented, Apr 9, 2022

yeah, you’re not the first one to point this out though we could consider keeping the files as compressed in the npm package and only uncompressing at run time https://github.com/PrismarineJS/node-minecraft-data/issues/185 here’s an issue to track that idea

0reactions
jojomatikcommented, Apr 9, 2022

Yeah, that seems to be true for download times.

They seem to get uncompressed as soon as they are downloaded, but that shouldn’t be too much of an issue then the more I think about i. If I remove all unused/ old images and never have to run a lot of different versions of my software at the same time, those 70MB should not cause any issues.

Thanks for the fast response and clarification 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node module size: See how I reduced it by 90% | TSH.io
You've ended up with 1GB node module size? We know the struggle is real but there's a way to reduce that size to...
Read more >
Thoughts on the node_modules folder size debate - Reddit
Total size of production just over 200 MB,. Your BUILD was over 200 MB? If yes, how do you relate that to node_modules...
Read more >
Protocol - wiki.vg
The Minecraft server accepts connections from TCP clients and communicates with them using packets. A packet is a sequence of bytes sent over...
Read more >
minecraft-protocol - npm
Parse and serialize minecraft packets, plus authentication and encryption.. Latest version: 1.36.2, last published: a month ago.
Read more >
PrismarineJS/node-minecraft-protocol - GitHub
Parse and serialize minecraft packets, plus authentication and encryption. Features. Supports Minecraft PC version 1.7.10, 1.8.8, 1.9 (15w40b, 1.9, 1.9.1 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found