apm.js icon indicating copy to clipboard operation
apm.js copied to clipboard

Make dependency on js-ipfs-api optional

Open sohkai opened this issue 6 years ago • 6 comments

js-ipfs-api is huge

image

If we try to use this dependency, and it's not available, we should throw an error.

sohkai avatar Jul 09 '18 17:07 sohkai

I was surprised js-ipfs-api turns out to be so big. I compiled it from scratch and can confirm a similar file size with latest master.

However, looking at the build artifact, we notice quickly, that it seems to bundle all 3rd-party dependencies as well (promisify, Buffer polyfills etc.)

So I'm pretty sure there are some low hanging fruits on their side to optimize build size but I'm not aware what their plans are in this regard. Maybe worth starting a discussion over at their repo?

0x-r4bbit avatar Aug 14 '18 13:08 0x-r4bbit

@PascalPrecht it's definitely worth it to start a conversation, but they use a number of crypto dependencies that are quite large by themselves so the low hanging fruit might not end up making it much smaller.

sohkai avatar Aug 14 '18 14:08 sohkai

If the only thing you are doing is cat or add files - then this is a much smaller alternative : https://www.npmjs.com/package/ipfs-mini

sponnet avatar Sep 26 '18 11:09 sponnet

Another small thing we could do is to use just a particular submodule (in this case, files-regular).

sohkai avatar Dec 11 '18 11:12 sohkai

taking this on

c0rv0s avatar Feb 09 '21 21:02 c0rv0s

PR opened here: https://github.com/aragon/apm.js/pull/53

c0rv0s avatar Feb 26 '21 21:02 c0rv0s