-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
esm: top-level Wasm without package type #57610
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
f54b84d
to
8631bf7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasm should definitely work regardless of the presence or value of the type
setting 🚀
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #57610 +/- ##
==========================================
+ Coverage 90.22% 90.24% +0.01%
==========================================
Files 630 630
Lines 185055 185056 +1
Branches 36216 36222 +6
==========================================
+ Hits 166975 166995 +20
+ Misses 11042 11034 -8
+ Partials 7038 7027 -11
🚀 New features to boost your workflow:
|
Is there any documentation that needs updating? |
The
notable-change
Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
According to the existing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Maybe https://nodejs.org/docs/latest/api/cli.html#program-entry-point? |
Good point, I've updated that section to match the current implementation. |
We currently support
node x.wasm
through the ESM integration where.wasm
files are located inside packages with"type": "module"
, but not without the module type on the package. This fixes the top-level execution case to always use the ESM loader.This fix also adds a comprehensive test case for top-level Wasm execution that in turn can be extended to various end-to-end Wasm execution scenarios, in this example creating a JS object, setting some properties on it, and logging it back.