Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: re-export types from @helia/interface #232

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

achingbrain
Copy link
Member

@helia/interface lets us depend on the shape of a Helia without having to depend on helia directly which is useful when you are writing something lightweight and don't want to pull in libp2p etc during an npm i, but in some cases we will have a dep on helia so re-export the types from @helia/interface to not force people to have a dependency on both.

`@helia/interface` lets us depend on the shape of a `Helia` without
having to depend on `helia` directly which is useful when you are
writing something lightweight and don't want to pull in libp2p etc
during an `npm i`, but in some cases we will have a dep on `helia`
so re-export the types from `@helia/interface` to not force people
to have a dependency on both.
@achingbrain achingbrain requested a review from a team as a code owner August 14, 2023 16:39
Copy link
Contributor

@whizzzkid whizzzkid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this was intentionally left out to segregate the responsibilities. This makes sense!

@achingbrain
Copy link
Member Author

I thought this was intentionally left out to segregate the responsibilities

It was, but from a practical perspective it's a pain to use.

By shipping @helia/interface as well as helia, the user has the option to, for example, depend on @helia/interface in their production code and then supply an implementation from helia in their test code, but if their production code depends on helia anyway we might as well save them the extra dep.

@achingbrain achingbrain merged commit 09c1e47 into main Aug 16, 2023
15 checks passed
@achingbrain achingbrain deleted the feat/re-export-interface-types branch August 16, 2023 14:13
This was referenced Aug 16, 2023
This was referenced Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

3 participants