Skip to content

[unenv-preset] Graduate experimental Node.js module flags to date-gated (2026-03-17)#12763

Merged
petebacondarwin merged 2 commits intomainfrom
pbacondarwin/graduate-nodejs-experimental-flags
Mar 18, 2026
Merged

[unenv-preset] Graduate experimental Node.js module flags to date-gated (2026-03-17)#12763
petebacondarwin merged 2 commits intomainfrom
pbacondarwin/graduate-nodejs-experimental-flags

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin commented Mar 4, 2026

Follows cloudflare/workerd#6135.

Graduate the remaining experimental nodejs_compat-specific module flags in the unenv preset by replacing the "experimental" flag requirement with date-gated enablement at 2026-03-17.

Flags graduated

Flag Module
enable_nodejs_perf_hooks_module perf_hooks
enable_nodejs_v8_module v8
enable_nodejs_tty_module tty
enable_nodejs_child_process_module child_process
enable_nodejs_worker_threads_module worker_threads
enable_nodejs_readline_module readline
enable_nodejs_repl_module repl

These modules are now automatically enabled for workers using nodejs_compat with a compatibility date of 2026-03-17 or later. Each flag can still be explicitly enabled or disabled via the corresponding enable_/disable_ compatibility flags without needing the "experimental" flag.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: This is an internal preset change matching workerd flag graduation. No user-facing docs needed.

Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 4, 2026

🦋 Changeset detected

Latest commit: db1d114

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 4, 2026

✅ All changesets look good

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 4, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12763

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12763

miniflare

npm i https://pkg.pr.new/miniflare@12763

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12763

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12763

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12763

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12763

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12763

wrangler

npm i https://pkg.pr.new/wrangler@12763

commit: db1d114

@petebacondarwin petebacondarwin added the blocked Blocked on other work label Mar 4, 2026
@petebacondarwin
Copy link
Copy Markdown
Contributor Author

We need to wait for the compat date to become nearer.

@petebacondarwin petebacondarwin added test all node versions Run the tests on all Node versions for this PR and removed blocked Blocked on other work labels Mar 6, 2026
@petebacondarwin petebacondarwin force-pushed the pbacondarwin/graduate-nodejs-experimental-flags branch from 5b0b989 to 4741a86 Compare March 6, 2026 19:35
@petebacondarwin petebacondarwin added the blocked Blocked on other work label Mar 11, 2026
@petebacondarwin petebacondarwin force-pushed the pbacondarwin/graduate-nodejs-experimental-flags branch from 4741a86 to 54712ea Compare March 17, 2026 12:17
…ed (2026-03-17)

The following flags are no longer experimental and are now automatically
enabled for workers using nodejs_compat with a compatibility date of
2026-03-17 or later: perf_hooks, v8, tty, child_process, worker_threads,
readline, and repl.

Follows cloudflare/workerd#6135 which replaced $experimental with
$impliedByAfterDate(name = "nodeJsCompat", date = "2026-03-17") for
these flags.
… on newer compat dates

When native perf_hooks is disabled but workerd provides a web-standard
globalThis.performance (with addEventListener), unenv's polyfill defers
to the native object instead of creating its own Performance instance.
This leaves Node.js-specific properties like nodeTiming missing.

Detect this case by checking for the __unenv__ marker and augment the
native performance object with missing properties from the polyfill
Performance prototype.
@petebacondarwin petebacondarwin force-pushed the pbacondarwin/graduate-nodejs-experimental-flags branch from 54712ea to db1d114 Compare March 17, 2026 16:26
@petebacondarwin petebacondarwin added nodejs compat Relating to the node runtime compatibility flag unenv and removed blocked Blocked on other work labels Mar 18, 2026
@petebacondarwin petebacondarwin marked this pull request as ready for review March 18, 2026 11:09
@petebacondarwin petebacondarwin requested a review from a team as a code owner March 18, 2026 11:09
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Mar 18, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Mar 18, 2026
@petebacondarwin petebacondarwin merged commit d028ffb into main Mar 18, 2026
53 of 69 checks passed
@petebacondarwin petebacondarwin deleted the pbacondarwin/graduate-nodejs-experimental-flags branch March 18, 2026 15:22
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Mar 18, 2026
NuroDev pushed a commit that referenced this pull request Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nodejs compat Relating to the node runtime compatibility flag run-remote-tests test all node versions Run the tests on all Node versions for this PR unenv

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants