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

fix: add missing events dep to fix browser bundlers #2134

Merged
merged 3 commits into from
Oct 6, 2023

Conversation

achingbrain
Copy link
Member

Bundlers do not include node core modules any more so we need to
depend on polyfills in order for downstream consumers to build their
apps successfully.

Fixes #2110

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

Bundlers do not include node core modules any more so we need to
depend on polyfills in order for downstream consumers to build their
apps successfully.

Fixes #2110
@achingbrain achingbrain requested a review from a team as a code owner October 6, 2023 08:44
@achingbrain achingbrain merged commit f670307 into master Oct 6, 2023
17 checks passed
@achingbrain achingbrain deleted the fix/add-missing-events-dep branch October 6, 2023 15:23
@wemeetagain
Copy link
Member

I would like to see js-libp2p not require a bundler at all in order to consume in the browser. Related to our portability initiative.

I think that js-libp2p core should be as portable as possible, and that means using isomorphic, or at least portable code throughout.

Also this case, specifically, feels a bit silly. We're requiring browser consumers to bundle an events polyfill for a nodejs-specific feature (using setMaxListeners to avoid a warning) with no benefit to the browser consumer.

@maschad
Copy link
Member

maschad commented Oct 6, 2023

I would like to see js-libp2p not require a bundler at all in order to consume in the browser. Related to our portability initiative.

I think that js-libp2p core should be as portable as possible, and that means using isomorphic, or at least portable code throughout.

Also this case, specifically, feels a bit silly. We're requiring browser consumers to bundle an events polyfill for a nodejs-specific feature (using setMaxListeners to avoid a warning) with no benefit to the browser consumer.

I moved this over to a discussion

This was referenced Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: undeclared events dependency breaks vite builds
3 participants