ipfs / ipld-explorer-components

React components for https://explore.ipld.io and ipfs-webui
Other
24 stars 23 forks source link

feat: dynamically import codecs and hashers and remove from bundle #452

Open SgtPooki opened 1 month ago

SgtPooki commented 1 month ago

Is your feature request related to a problem? Please describe.

When bundling this package, we want to make it possible for consumers to customize codecs and hashers. https://github.com/ipfs/ipld-explorer-components/issues/415 made it possible to customize the links; now, we should allow consumers bundling this package to decide whether they want to import all the hashers & codecs or only some.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

This package is only included in ipfs-webui and explore.ipld.io, but we may wish to add new hashers, or remove others, and it would be nice if we could do that easily.

What is enabled by adding this feature

We will be able to allow further customization without as many edits to this package

This issue isn't tracking the work to customize hashers & codecs, but that should be the next step. Ideally we could pass functions into HeliaProvider or ExploreProvider to load hashers & codecs.