8000 feat: migrate to Vite, add ESM bundle by karen-sarkisyan · Pull Request #616 · a16z/helios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: migrate to Vite, add ESM bundle #616

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

Merged

Conversation

karen-sarkisyan
Copy link
Contributor

What this PR does:

  • Makes the UMD build of helios work in Node.js (browser support is kept)
  • Adds an ESM build of helios compatible with Node & Browser
  • Both UMD and ESM bundles are standalone js or mjs files respectively with WASM inlined.

How it does it:

  • Switches bundler from Webpack to Vite (which uses Rollup) to inline WASM and bundle cross-platform glue JS code in one file
  • Uses wasm-pack directly without a plugin for better control of preparing the WASM package
  • switches from node's events lib to eventemitter3 for full browser/node compatibility

It maximizes compatibility and portability: each standalone file can be used by both Node and browsers with no dependencies. I expect that that down the road we will expand it with more targeted bundles.

- Use vite for better DX and compatibility
- Add ESM bundle
- Node.js support for both UMD and ESM
Copy link
Collaborator
@ncitron ncitron left a comment

Choose a reason for hiding this comment

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

LGTM!

@ncitron ncitron merged commit 69233bb into a16z:master Jun 3, 2025
6 checks passed
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.

2 participants
0