Skip to content

src: remove experimental ShadowRealm support - #65650

Open
anonrig wants to merge 1 commit into
nodejs:mainfrom
anonrig:cursor/remove-shadow-realm-09a0
Open

anonrig wants to merge 1 commit into
nodejs:mainfrom
anonrig:cursor/remove-shadow-realm-09a0

Conversation

@anonrig

@anonrig anonrig commented Aug 29, 2026

Copy link
Copy Markdown
Member

This removes experimental ShadowRealm support from Node.js.

The TC39 ShadowRealm proposal remains unimplemented by browsers. WPT dropped ShadowRealm test coverage in web-platform-tests/wpt#59794 because the tests added significant noise without implementer support.

This PR:

  • Removes the --experimental-shadow-realm flag and the --harmony-shadow-realm V8 option alias
  • Removes the Node.js host integration (node_shadow_realm.*, isolate callback, bootstrap)
  • Removes Node.js ShadowRealm tests and dedicated WPT fixtures that WPT already deleted
  • Leaves V8's own ShadowRealm implementation untouched

--experimental-shadow-realm was never enabled by default and never left experimental status.

Refs: web-platform-tests/wpt#59794
Refs: #42528

This change was prepared with assistance from an AI coding agent.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/config
  • @nodejs/gyp
  • @nodejs/loaders
  • @nodejs/realm
  • @nodejs/startup
  • @nodejs/web-standards

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Aug 29, 2026
@cursor
cursor Bot force-pushed the cursor/remove-shadow-realm-09a0 branch from c7993ad to 50ef480 Compare August 29, 2026 20:58
@aduh95 aduh95 added experimental Issues and PRs related to experimental features. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v24.x PRs that should not land on the v24.x-staging branch and should not be released in v24.x. labels Aug 29, 2026
@cursor
cursor Bot force-pushed the cursor/remove-shadow-realm-09a0 branch from 50ef480 to 52ba7ce Compare August 29, 2026 22:05

@jasnell jasnell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While the status is still unclear, and it's not certain at all that'll it will make progress, it is still considered an active TC-39 proposal. Removing entirely may be premature. Won't block but I also don't agree with removing it just yet.

@legendecas

legendecas commented Aug 29, 2026

Copy link
Copy Markdown
Member

Technically the proposal was moved to stage 2.7, and not moved yet stage 3 back again for implementation. We could add it back when it gets promoted to stage 3 again.

@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.33%. Comparing base (c0ed28f) to head (eff3e1a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65650      +/-   ##
==========================================
+ Coverage   90.29%   90.33%   +0.04%     
==========================================
  Files         790      787       -3     
  Lines      272883   272731     -152     
  Branches    52118    52079      -39     
==========================================
- Hits       246387   246377      -10     
+ Misses      16943    16841     -102     
+ Partials     9553     9513      -40     
Files with missing lines Coverage Δ
lib/internal/bootstrap/realm.js 96.95% <100.00%> (-0.05%) ⬇️
lib/internal/errors.js 98.96% <100.00%> (+0.14%) ⬆️
lib/internal/process/pre_execution.js 96.47% <ø> (+0.71%) ⬆️
src/api/environment.cc 79.16% <ø> (-0.01%) ⬇️
src/async_wrap.cc 83.28% <ø> (ø)
src/env.cc 81.86% <ø> (-0.23%) ⬇️
src/env.h 97.26% <ø> (ø)
src/node_context_data.h 85.71% <ø> (ø)
src/node_options.cc 80.76% <ø> (-0.10%) ⬇️
src/node_options.h 95.61% <ø> (-0.02%) ⬇️
... and 1 more

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

@anonrig anonrig added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 30, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 30, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We might want to wait until the next TC39 (I think it's later this month), and if nothing is moving still, we should remove it unless we get some alternative guidance from them.

The TC39 ShadowRealm proposal remains unimplemented by browsers,
and WPT removed ShadowRealm test coverage. Remove the Node.js
host integration, the --experimental-shadow-realm CLI flag, and
related tests.

Refs: web-platform-tests/wpt#59794
Refs: nodejs#42528
Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
Co-authored-by: Yagiz Nizipli <anonrig@users.noreply.github.com>
@anonrig
anonrig force-pushed the cursor/remove-shadow-realm-09a0 branch from 52ba7ce to eff3e1a Compare September 22, 2026 18:56
@anonrig

anonrig commented Sep 22, 2026

Copy link
Copy Markdown
Member Author

Rebased onto current main (eff3e1ad456). The only conflict was src/env.cc: kept the new node_profiling.h include, and left node_shadow_realm.h out. V8's own ShadowRealm code is untouched. What's gone is the Node host hook, --experimental-shadow-realm, and the --harmony-shadow-realm alias.

@legendecas agreed, we can put it back if this reaches stage 3 again. It's 2.7 right now.

@mcollina the next meeting is 29 Sep–1 Oct in Tokyo. This push is just to get the branch current. Not trying to land it ahead of that.

@jasnell I get why this feels early while the proposal is still active. Leaving it open so we can decide after the meeting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v24.x PRs that should not land on the v24.x-staging branch and should not be released in v24.x. experimental Issues and PRs related to experimental features. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants