-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Package size is 300 Mb #2550
Comments
@rumkin can I check you're quoting the size of your FWIW a browser build of ipfs weighs in at around 600kb currently (which is still big) but is nowhere near 300mb! Looking at the |
I've updated steps to reproduce and added size measure step, which is I'm using IPFS as dependency to my electron app. It would be nice you provide instruction how to minify the size or (what's preferrable to me), provide a compiled bundle for node.js. |
Some notes from the twitter thread: https://twitter.com/rumkin/status/1185009479101964288 Suggestion from @hugomrdias https://twitter.com/hugomrdias/status/1185825396551499776 |
To test this, go into your project and
|
Of this 326MB, roughly:
|
If you’re concerned about the size of the app you may want to use https://github.com/electron-userland/electron-webpack If you compile the entire app down with webpack only the code you rely will be there and you can do an electron build without node_modules. |
As the first step I'd suggest to split the package into several:
In my project I don't need web interface or CLI. The only thing I need is IPFS networking and storage capabilities provided by the core package. |
I'm not 100% convinced this would solve the size problem. Just under half of the LOC in The problem is there's almost 200MB of browser bundles in |
I don't see how it conflicts with what I propose. CLI and Web pull a bunch of own dependencies like This should be moved into separate issue. But I think it should be done anyway. Currently the package is overloaded with responsibilities and tightly coupled. |
on osx |
This seems not valid since it will also skip the The point is, I want to install the From a technical perspective this does not seem a great design, a "consumer" of the Is there any alternative to avoid this? I suggest moving the tests to a separate package and make this package depend on Another alternative seems to only publish a bundle so users can consume the pre-built Maybe I am missing something, if anyone knows a way to avoid installing |
@ottodevs npm does not install dev deps from your deps what we can do is reduce the size of the dist folders. |
Thanks for the quick answer and clarification @hugomrdias I might be doing something wrong but when a I am wondering if that's a |
can you run |
Weird output... yarn why electron
yarn why v1.22.0
[1/4] 🤔 Why do we have the module "electron"...?
[2/4] 🚚 Initialising dependency graph...
(...lots of: [warning > 3box > ipfs > multicodec@0.5.7: stable api reached] omitted)
[3/4] 🔍 Finding dependency...
error We couldn't find a match!
✨ Done in 116.89s. ... but the folder definitely exists... ls node_modules/ipfs/node_modules/electron
LICENSE cli.js electron.d.ts install.js package.json
README.md dist index.js node_modules path.txt Maybe is because my project does normally use |
|
What version of ipfs do you end up with? There was a problem with the shrink wrap file for a while that mean the dev deps could sometimes get installed. |
Still does not finds a match; after removing the then I try again: But in this second case back to Maybe is time to encourage my team to shift to |
npm ls ipfs
my-project@0.0.1
└─┬ 3box@1.17.1
└─┬ ipfs@0.40.0
└── ipfs@0.38.1 extraneous
npm ERR! extraneous: ipfs@0.38.1 /Users/otto/box/git/my-project/node_modules/ipfs/node_modules/ipfs |
|
The situation here has changed quite a lot in the intervening months. We've pulled a bunch of uncommonly used deps out of If you are only running an in-process node as part of an application and don't need the CLI or HTTP API server components you can reduce the install size by a further 30MB by using the We'll keep trying to slim the install down but as it stands pressure on CI and other space/bandwidth constrained environments should now be significantly lightened. |
Type: Overweight
Severity: Medium
Description: Package weight is 336 Mb
Steps to reproduce the error:
Current IPFS package weight too much, it takes too long time to install. It hits performance on my pipeline and increases my bundle size dramatically.
The text was updated successfully, but these errors were encountered: