Skip to content

esm: unflag --experimental-wasm-modules #57038

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

Closed
wants to merge 4 commits into from

Conversation

guybedford
Copy link
Contributor

@guybedford guybedford commented Feb 13, 2025

This unflags --experimental-wasm-modules for Node.js 24, while keeping the implementation experimental under 2.1 active development.

Source phase imports and string builtins as stable proposals are both promoted to 2.2 release candidate experimental status. The warning for importing Wasm modules is moved to only apply when importing module instances, rather than module sources as well.

With #56919 landed, Node.js supports both source phase imports and instance phase imports to WebAssembly modules and for Wasm imports to JS, in line with the current Phase 3 WebAssembly ESM Integration proposal (https://github.com/webassembly/esm-integration).

Recent additions to the source phase integration here also include:

By unflagging, this will enable build tools to target source phase imports for Node.js as an output format, providing immediate benefit to Wasm consumers in enabling more seamless interoperability between JS and Wasm modules.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders

@guybedford
Copy link
Contributor Author

//cc @nodejs/loaders

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. labels Feb 13, 2025
@marco-ippolito
Copy link
Member

So I assume its semver major?

@marco-ippolito marco-ippolito added the semver-major PRs that contain breaking changes and should be released in the next major version. label Feb 13, 2025
@guybedford
Copy link
Contributor Author

Strictly speaking, this isn't semver major since it has no breaking semantics. But, we only have fully V8 support on 24 unless there is a backport of the V8 update.

@guybedford guybedford changed the title esm: unflag --experimental-wasm-modules for 24 esm: unflag --experimental-wasm-modules Feb 13, 2025
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.05%. Comparing base (c8d5b39) to head (483c78c).
Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/modules/esm/formats.js 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57038      +/-   ##
==========================================
+ Coverage   90.03%   90.05%   +0.02%     
==========================================
  Files         648      648              
  Lines      190967   190978      +11     
  Branches    37425    37433       +8     
==========================================
+ Hits       171931   171987      +56     
+ Misses      11665    11607      -58     
- Partials     7371     7384      +13     
Files with missing lines Coverage Δ
lib/internal/modules/esm/translators.js 92.45% <100.00%> (-0.02%) ⬇️
src/node.cc 74.72% <100.00%> (-0.07%) ⬇️
src/node_options.cc 84.49% <100.00%> (-0.12%) ⬇️
src/node_options.h 97.87% <ø> (-0.02%) ⬇️
lib/internal/modules/esm/formats.js 98.57% <50.00%> (-0.10%) ⬇️

... and 43 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina added the notable-change PRs with changes that should be highlighted in changelogs. label Feb 13, 2025
Copy link
Contributor

The notable-change PRs with changes that should be highlighted in changelogs. label has been added by @mcollina.

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.

@guybedford
Copy link
Contributor Author

I've also added a commit here to remove the experimental warning, given we are on a stabilization path for this feature, but for those who have already approved feel free to comment further - @mcollina @anonrig.

@guybedford
Copy link
Contributor Author

Thanks for all the approvals it is great to see the interest in this.

After further discussion, since this is still a Phase 3 Wasm specification, that implies it is still in experimental implementation status until it reaches Phase 4.

While strictly speaking we can land experimental features unflagged in Node.js, the ESM Integraiton has already taken long enough that there is no need to rush something out the door here - so I will hold off on landing this for Node.js 24 and instead seek to land it for (hopefully) 25 instead where ideally we would be able to land under Phase 4 later in the year, or to then at least reconsider unflagging under Phase 3 if we feel it is in the interests of the project at that point for our users.

@legendecas legendecas added the blocked PRs that are blocked by other issues or PRs. label Mar 17, 2025
@marco-ippolito marco-ippolito added semver-minor PRs that contain new features and should be released in the next minor version. and removed semver-major PRs that contain breaking changes and should be released in the next major version. labels Apr 1, 2025
@marco-ippolito
Copy link
Member

We discussed at the collab summit and we realized its not semver major so it can land

@aduh95 aduh95 added the experimental Issues and PRs related to experimental features. label Apr 1, 2025
@guybedford
Copy link
Contributor Author

Thanks for clarifying the case here, I'll aim to land this then when the current design discussions on the ESM Integration proposal repo have been resolved (theres a few final PRs in progress and under discussion right now - https://github.com/WebAssembly/esm-integration/pulls). Hopefully these should resolve fairly soon, but it may be more than a few weeks yet too.

@guybedford
Copy link
Contributor Author

There is some relevant unflagging discussion in #57525 (comment).

I think the important thing for now is that given this is non-breaking that means we are able to backport the unflagging.

But we should not rush unflagging and try to reconcile with Chromium's shipping process here first as much as possible.

@guybedford guybedford removed the blocked PRs that are blocked by other issues or PRs. label Jul 19, 2025
@guybedford guybedford force-pushed the unflag-esm-integration branch from b0a833f to dcbe4e6 Compare July 19, 2025 17:49
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@guybedford guybedford force-pushed the unflag-esm-integration branch from dcbe4e6 to b4b432c Compare July 21, 2025 22:36
@guybedford guybedford force-pushed the unflag-esm-integration branch from b4b432c to 8056814 Compare July 21, 2025 23:18
@guybedford
Copy link
Contributor Author

I've made some final adjustments to this unflagging:

  1. While the main Wasm integration remains 2.1 active development, source phase imports and string builtins as sub-features have are both marked in the docs as 2.2 release candidate (as Stage 3 at TC39 and Phase 4 Wasm stable specifications respectively).
  2. The experimental warning for WebAssembly has been retained to only apply when importing WebAssembly in the instance phase, while source phase imports with string builtins do not get the warning in line with what Chrome is currently planning to ship.

This seems to me to strike the correct balance between communicating the correct experimental status and adoption.

Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

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

LGTM with one minor comment.

Copy link
Member

@anonrig anonrig left a comment

Choose a reason for hiding this comment

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

Nice!

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

guybedford added a commit that referenced this pull request Jul 22, 2025
PR-URL: #57038
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
@guybedford
Copy link
Contributor Author

Landed in 0df1518.

@guybedford guybedford closed this Jul 22, 2025
@guybedford guybedford deleted the unflag-esm-integration branch July 22, 2025 20:25
guybedford added a commit to guybedford/node that referenced this pull request Jul 22, 2025
PR-URL: nodejs#57038
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
guybedford added a commit to guybedford/node that referenced this pull request Jul 23, 2025
PR-URL: nodejs#57038
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
guybedford added a commit to guybedford/node that referenced this pull request Jul 23, 2025
PR-URL: nodejs#57038
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
guybedford added a commit to guybedford/node that referenced this pull request Jul 25, 2025
PR-URL: nodejs#57038
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
aduh95 pushed a commit that referenced this pull request Jul 25, 2025
PR-URL: #57038
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
nodejs-github-bot added a commit that referenced this pull request Jul 28, 2025
Notable changes:

cli:
  * (SEMVER-MINOR) support `${pid}` placeholder in --cpu-prof-name (Haram Jeong) #59072
crypto:
  * (SEMVER-MINOR) add tls.setDefaultCACertificates() (Joyee Cheung) #58822
dns:
  * (SEMVER-MINOR) support max timeout (theanarkh) #58440
doc:
  * update the instruction on how to verify releases (Antoine du Hamel) #59113
esm:
  * (SEMVER-MINOR) unflag --experimental-wasm-modules (Guy Bedford) #57038
http,https:
  * (SEMVER-MINOR) add built-in proxy support in http/https.request and Agent (Joyee Cheung) #58980
net:
  * (SEMVER-MINOR) update net.blocklist to allow file save and file management (alphaleadership) #58087
test:
  * (SEMVER-MINOR) move http proxy tests to test/client-proxy (Joyee Cheung) #58980
worker:
  * (SEMVER-MINOR) add web locks api (ishabi) #58666

PR-URL: #59257
guybedford added a commit to guybedford/node that referenced this pull request Jul 28, 2025
PR-URL: nodejs#57038
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. esm Issues and PRs related to the ECMAScript Modules implementation. experimental Issues and PRs related to experimental features. needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants