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

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
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 for now.

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).

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
Co-authored-by: Yagiz Nizipli <[email protected]>
@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 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.10%. Comparing base (79f96b6) to head (b72069f).
Report is 310 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   89.10%   89.10%   -0.01%     
==========================================
  Files         665      665              
  Lines      193203   193196       -7     
  Branches    37220    37215       -5     
==========================================
- Hits       172158   172146      -12     
+ Misses      13771    13767       -4     
- Partials     7274     7283       +9     
Files with missing lines Coverage Δ
lib/internal/modules/esm/translators.js 91.42% <ø> (-0.04%) ⬇️
src/node_options.cc 87.97% <100.00%> (ø)
lib/internal/modules/esm/formats.js 98.55% <50.00%> (-0.10%) ⬇️

... and 32 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.

"experimental ES Module support for webassembly modules",
&EnvironmentOptions::experimental_wasm_modules,
kAllowedInEnvvar);
AddOption("--experimental-wasm-modules", "", NoOp{}, kAllowedInEnvvar);
Copy link
Member

@legendecas legendecas Feb 14, 2025

Choose a reason for hiding this comment

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

I think "unflag an experimental feature" should start with switching the default value to be true, and allowing turning the feature off with --no-experiemental-wasm-modules, instead of making it a no-op directly.

BTW, if we are going to make this a no-op, EnvironmentOptions::experimental_wasm_modules should be removed as it is not used.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, if having WASM module enabled breaks something, it's useful to be able to disable it. We can make the falg a no-op in another major

Co-authored-by: Antoine du Hamel <[email protected]>
pr-url: https://github.com/nodejs/node/pull/57038
description: Wasm modules no longer require the `--experimental-wasm-modules` flag.
-->

> Stability: 1 - Experimental
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> Stability: 1 - Experimental
> Stability: 1.2 - Release candidate

@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 removed the semver-major PRs that contain breaking changes and should be released in the next major version. label Apr 1, 2025
@marco-ippolito marco-ippolito added the semver-minor PRs that contain new features and should be released in the next minor version. label 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked PRs that are blocked by other issues or PRs. 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