Skip to content

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

Closed
guybedford wants to merge 4 commits into
nodejs:mainfrom
guybedford:unflag-esm-integration
Closed

esm: unflag --experimental-wasm-modules#57038
guybedford wants to merge 4 commits into
nodejs:mainfrom
guybedford:unflag-esm-integration

Conversation

@guybedford
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders

@guybedford
Copy link
Copy Markdown
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
Comment thread doc/api/esm.md Outdated
@marco-ippolito
Copy link
Copy Markdown
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
Copy Markdown
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
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 13, 2025

Codecov Report

❌ 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 108 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
Copy Markdown
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
@github-actions
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread doc/api/esm.md Outdated
Comment thread src/node_options.cc
Comment thread doc/api/esm.md Outdated
@guybedford
Copy link
Copy Markdown
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