Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

feature: custom bundles #1144

Closed
pgte opened this issue Dec 12, 2017 · 7 comments
Closed

feature: custom bundles #1144

pgte opened this issue Dec 12, 2017 · 7 comments

Comments

@pgte
Copy link
Contributor

pgte commented Dec 12, 2017

On apps that use js-ipfs I never use the HTTP API, but I believe that the ipfs-api code always ends up in the bundle.

The same thing applies to some transports. For instance, I would like to have a bundle that does not include the Websocket or the WebRTC-Star transports.

In my case, the same applies to some IPFS features like DHT or the object API.

I would love to have the possibility of creating a custom js-ipfs bundle that does not contain code for features I don't intend to use.

@mkg20001
Copy link
Contributor

mkg20001 commented Dec 14, 2017

I think a good way would be to move the ipfs core into a separate module (likejs-ipfs-core) and to make js-ipfs be the main bundle that contains all the transports, etc. so other bundles could be built upon js-ipfs-core without including all the transports, etc. in the other bundle

@RangerMauve
Copy link
Contributor

What about allowing the core to be required out of ipfs/core?

@mkg20001
Copy link
Contributor

What about allowing the core to be required out of ipfs/core?

I think that that would still include all the dependencies from the main bundle.

@victorb
Copy link
Member

victorb commented Dec 14, 2017

Should we not aim to make the code easily optimized with existing tools like uglify and tree-shaking rather than spending efforts modularizing everything? Even if we modularize everything, dead-code elimination would remove more code from the bundle than we could do when creating multiple modules.

Remember, we used to do this with libp2p bundles, but in the end put them together as they were not very heavily used separately.

Although, I agree that the HTTP API/Gateway should not be bundled by default, but rather a separate module that would include js-ipfs.

@RangerMauve
Copy link
Contributor

Well, if core doesn't require any of the transports directly, then it won't be part of the bundle.

@daviddias daviddias added status/ready Ready to be worked status/deferred Conscious decision to pause or backlog and removed status/ready Ready to be worked labels Jan 25, 2018
@daviddias daviddias added status/ready Ready to be worked and removed status/deferred Conscious decision to pause or backlog labels Dec 9, 2018
@daviddias
Copy link
Member

On apps that use js-ipfs I never use the HTTP API, but I believe that the ipfs-api code always ends up in the bundle.

Can we move from "believe" to "verified"? ipfs-api shouldn't be bundled as it is not required by anything in src/core

@whizzzkid
Copy link

whizzzkid commented May 31, 2023

js-ipfs is being deprecated in favor of Helia. You can follow the migration plan here #4336 and read the migration guide.

This issue has been resolved in Helia! if this does not address your concern please let us know by reopening this issue before 2023-06-05!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

No branches or pull requests

6 participants