GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — module: remove async module customization hooks by GeoffreyBooth · Pull Request #67090 · nodejs/node

Conversation

@GeoffreyBooth

@GeoffreyBooth GeoffreyBooth commented Oct 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Removes module.register() (DEP0205), the --experimental-loader and --loader flags, and the machinery that supported them: the loader hooks worker thread, the hooks proxy, the async module customization hook chains for resolving and loading, the internal worker class used to run the loader thread, and the asynchronous module job linking. Module customization is now provided only by module.registerHooks(), which runs synchronously on the thread that loads the modules.

  • The ES module loader always loads and links modules synchronously; the promise handling and the re-invented require() for imported CommonJS are gone. import() still defers evaluation to a later microtask.
  • worker_threads.isInternalThread is kept and always false; removing it is left for a semver-major change.
  • DEP0205 stays in deprecations.md as End-of-Life. ERR_ASYNC_LOADER_REQUEST_NEVER_SETTLED and ERR_LOADER_CHAIN_INCOMPLETE move to Legacy in errors.md.
  • Tests that only exercised the async hooks are removed; new tests cover require() after a failed import() and that import() does not evaluate the module before returning.
  • REPLACEME placeholders for the version are left for landing.

Notable change

Suggested text for the release notes:

Removal of module.register() and --experimental-loader

module.register() (DEP0205) and the --experimental-loader and --loader flags have been removed, together with the separate thread that ran asynchronous module customization hooks. Module customization is now provided by module.registerHooks(), which runs synchronously on the thread that loads the modules. It has been available since v22.15.0 and v23.5.0.

What changes for existing code:

  • module.register is no longer exported. In CommonJS it is undefined, so feature detection such as if (module.register) keeps working, and in ES modules import { register } from 'node:module' fails with a SyntaxError because the export no longer exists.
  • --experimental-loader and --loader are no longer recognized options, so Node.js exits with a “bad option” error when they are passed.
  • Hooks that relied on a separate thread, for example to await asynchronous work, need to do that work another way.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot

nodejs-github-bot commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/config
  • @nodejs/loaders
  • @nodejs/test_runner
  • @nodejs/userland-migrations
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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 Oct 28, 2026
@nodejs-github-bot

nodejs-github-bot commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78704/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth
GeoffreyBooth force-pushed the remove-module-register branch from a98403b to 95c14fc Compare October 29, 2026 02:24
@nodejs-github-bot

nodejs-github-bot commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78706/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth
GeoffreyBooth force-pushed the remove-module-register branch 2 times, most recently from 6cea4a9 to 355da9b Compare October 30, 2026 02:44
@nodejs-github-bot

nodejs-github-bot commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78722/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth
GeoffreyBooth force-pushed the remove-module-register branch from 355da9b to aab37fe Compare October 30, 2026 03:23
@nodejs-github-bot

nodejs-github-bot commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78723/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth
GeoffreyBooth force-pushed the remove-module-register branch from aab37fe to ada3473 Compare October 30, 2026 04:57
@GeoffreyBooth
GeoffreyBooth marked this pull request as ready for review October 30, 2026 05:00
@GeoffreyBooth GeoffreyBooth added module Issues and PRs related to the module subsystem. esm Issues and PRs related to the ECMAScript Modules implementation. loaders Issues and PRs related to ES module loaders. labels Oct 30, 2026
@GeoffreyBooth
GeoffreyBooth requested review from joyeecheung and marco-ippolito October 30, 2026 05:00
@GeoffreyBooth
GeoffreyBooth force-pushed the remove-module-register branch from ada3473 to 937a866 Compare October 30, 2026 05:02
@nodejs-github-bot

nodejs-github-bot commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78724/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth
GeoffreyBooth force-pushed the remove-module-register branch from 937a866 to a825144 Compare October 30, 2026 05:15
@nodejs-github-bot

nodejs-github-bot commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78725/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Oct 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.52941% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.67%. Comparing base (f4e89e7) to head (96518bf).
⚠️ Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
src/node_watchdog.cc 0.00% 0 Missing and 1 partial ⚠️
src/node_worker.cc 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67090      +/-   ##
==========================================
- Coverage   90.70%   90.67%   -0.04%     
==========================================
  Files         801      798       -3     
  Lines      281881   279829    -2052     
  Branches    54315    54018     -297     
==========================================
- Hits       255675   253725    -1950     
+ Misses      16353    16238     -115     
- Partials     9853     9866      +13     
Files with missing lines Coverage Δ
lib/internal/bench_runner/cli.js 94.23% <ø> (+0.07%) ⬆️
lib/internal/errors.js 98.11% <100.00%> (-0.01%) ⬇️
lib/internal/main/eval_string.js 79.48% <100.00%> (ø)
lib/internal/main/worker_thread.js 95.00% <100.00%> (-0.23%) ⬇️
lib/internal/modules/customization_hooks.js 100.00% <100.00%> (ø)
lib/internal/modules/esm/load.js 95.54% <100.00%> (-1.27%) ⬇️
lib/internal/modules/esm/loader.js 99.56% <100.00%> (-0.35%) ⬇️
lib/internal/modules/esm/module_job.js 100.00% <100.00%> (+0.41%) ⬆️
lib/internal/modules/esm/module_map.js 98.48% <100.00%> (+0.01%) ⬆️
lib/internal/modules/esm/translators.js 97.42% <100.00%> (-0.21%) ⬇️
... and 14 more

... and 29 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AugustinMauroy

AugustinMauroy commented Oct 31, 2026

Copy link
Copy Markdown
Member

since it's simplify loading phase, it's there are an positive impact in term of perf ?

JakobJingleheimer reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marco-ippolito

marco-ippolito commented Oct 31, 2026

Copy link
Copy Markdown
Member

I think this should be treated as semver major due to the large impact

JakobJingleheimer reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth

GeoffreyBooth commented Oct 31, 2026

Copy link
Copy Markdown
Member Author

@AugustinMauroy: since it's simplify loading phase, it's there are an positive impact in term of perf ?

I ran Node’s benchmark/compare.js with compare.R, 20 runs each, on builds from just before and after this PR. This is one machine, and the builds aren’t from the latest main. Positive means the PR is faster:

  • misc/startup-core (process and worker modes, 10 cases): +0.3% to +5.4%, none significant at the 1% level.
  • esm/startup-esm-graph (250–2000 modules): +1.1% to +2.7%, but the benchmark’s noise at this run count (±17%) is far larger than any effect.
  • esm/esm-loader-import: significant gains for data: specifiers (+2.4%) and nonexistent node: specifiers (+7.7%). The other three cases were flat and not significant.

So there’s no regression, and at most a small gain in the import path, because loading no longer has to check for async hooks. The larger win is for hook users. In a separate hyperfine run, a script using module.register() took about 141 ms versus about 107 ms with registerHooks() (that gain comes from the sync API already on main). Overall this PR is mostly simplification and maintenance, not a general speedup.

benchmark results (misc/startup-core, esm/startup-esm-graph, esm/esm-loader-import)
$ node benchmark/compare.js --old ./node-old --new ./node-new --runs 20 --filter startup-core misc | Rscript benchmark/compare.R
                                                                                         confidence improvement accuracy (*)   (**)  (***)
misc/startup-core.js n=30 mode='process' script='benchmark/fixtures/empty.mjs'                           3.58 %       ±4.25% ±5.77%  ±7.75%
misc/startup-core.js n=30 mode='process' script='benchmark/fixtures/import-builtins.mjs'                 2.18 %       ±3.55% ±4.77%  ±6.30%
misc/startup-core.js n=30 mode='process' script='benchmark/fixtures/require-builtins.js'                 3.81 %       ±3.93% ±5.28%  ±6.99%
misc/startup-core.js n=30 mode='process' script='test/fixtures/semicolon.js'                             0.34 %       ±2.94% ±3.94%  ±5.19%
misc/startup-core.js n=30 mode='process' script='test/fixtures/snapshot/typescript.js'                   0.78 %       ±2.73% ±3.66%  ±4.81%
misc/startup-core.js n=30 mode='worker' script='benchmark/fixtures/empty.mjs'                            5.15 %       ±6.54% ±8.78% ±11.58%
misc/startup-core.js n=30 mode='worker' script='benchmark/fixtures/import-builtins.mjs'           *      4.66 %       ±4.44% ±6.00%  ±7.98%
misc/startup-core.js n=30 mode='worker' script='benchmark/fixtures/require-builtins.js'                  2.32 %       ±3.93% ±5.28%  ±6.98%
misc/startup-core.js n=30 mode='worker' script='test/fixtures/semicolon.js'                              5.35 %       ±5.61% ±7.51%  ±9.88%
misc/startup-core.js n=30 mode='worker' script='test/fixtures/snapshot/typescript.js'                    0.99 %       ±2.72% ±3.64%  ±4.79%

Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 10 comparisons, you can thus
expect the following amount of false-positive results:
  0.50 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.10 false positives, when considering a   1% risk acceptance (**, ***),
  0.01 false positives, when considering a 0.1% risk acceptance (***)

$ node benchmark/compare.js --old ./node-old --new ./node-new --runs 20 --filter startup-esm-graph esm | Rscript benchmark/compare.R
                                           confidence improvement accuracy (*)    (**)   (***)
esm/startup-esm-graph.js n=10 modules=1000                 1.90 %      ±17.57% ±23.53% ±30.95%
esm/startup-esm-graph.js n=10 modules=2000                 1.13 %      ±17.39% ±23.30% ±30.64%
esm/startup-esm-graph.js n=10 modules=250                  1.24 %      ±17.81% ±23.85% ±31.37%
esm/startup-esm-graph.js n=10 modules=500                  2.67 %      ±17.46% ±23.38% ±30.75%

Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 4 comparisons, you can thus
expect the following amount of false-positive results:
  0.20 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.04 false positives, when considering a   1% risk acceptance (**, ***),
  0.00 false positives, when considering a 0.1% risk acceptance (***)

$ node benchmark/compare.js --old ./node-old --new ./node-new --runs 20 --filter esm-loader-import esm | Rscript benchmark/compare.R
                                                                      confidence improvement accuracy (*)   (**)  (***)
esm/esm-loader-import.js specifier='./relative-existing.js' n=1000                   -0.32 %       ±1.24% ±1.68% ±2.24%
esm/esm-loader-import.js specifier='./relative-nonexistent.js' n=1000                -0.10 %       ±1.11% ±1.49% ±1.97%
esm/esm-loader-import.js specifier='data:text/javascript,{i}' n=1000         ***      2.44 %       ±1.23% ±1.65% ±2.18%
esm/esm-loader-import.js specifier='node:os' n=1000                                   2.13 %       ±2.17% ±2.92% ±3.87%
esm/esm-loader-import.js specifier='node:prefixed-nonexistent' n=1000        ***      7.73 %       ±0.80% ±1.07% ±1.40%

Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 5 comparisons, you can thus
expect the following amount of false-positive results:
  0.25 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.05 false positives, when considering a   1% risk acceptance (**, ***),
  0.01 false positives, when considering a 0.1% risk acceptance (***)

I also checked with hyperfine on same-config builds, before and after this PR. For the common path (no hooks) there’s no measurable difference. All of these are within noise:

Scenario Before After
node -e 0 99.1 ± 5.0 ms 99.0 ± 5.7 ms
ESM entry (three modules) 107.1 ± 7.7 ms 105.6 ± 5.6 ms
CJS entry 104.8 ± 4.3 ms 103.1 ± 4.6 ms

The removal mainly benefits hook users. A script using module.register() async hooks took about 141 ms, versus about 107 ms with the equivalent registerHooks() (about 24% faster). That gain comes from the sync API, which is already on main.

AugustinMauroy and JakobJingleheimer reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth

GeoffreyBooth commented Oct 31, 2026

Copy link
Copy Markdown
Member Author

@marco-ippolito I’m happy for this to land only in the 27 line with do not backport labels, so in practice it ships as semver-major. There’s no benefit in backporting it, since registerHooks() is available in the older lines.

I’d still argue it isn’t semver-major in the policy sense, because module.register() and --experimental-loader were experimental:

  • Before it was deprecated, module.register() was documented as “Stability: 1.1 - Active development”, and the “Asynchronous customization hooks” section still carries that marking. documentation.md says Stability 1 features are “not subject to semantic versioning rules” and that “removal may occur in any future release.”
  • --experimental-loader has had “experimental” in its name since the rename in cli: rename --loader to --experimental-loader #29752, and its docs say it “is discouraged and may be removed in a future version of Node.js.”

We also went well beyond what an experimental API requires. After the discussion in #62395 (e.g. “experimental status is already a warning”, and the concerns about existing adoption), we shipped a docs-only deprecation in v25.9.0/v24.15.0 (#62395) and a runtime deprecation in v26.0.0 (#62401). Users have had a full major of runtime warnings, and the plan to remove in 27 has been on record since #62401.

marco-ippolito reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth GeoffreyBooth added the dont-land-on-v26.x PRs that should not land on the v26.x-staging branch and should not be released in v26.x. label Oct 31, 2026
@marco-ippolito

marco-ippolito commented Nov 1, 2026

Copy link
Copy Markdown
Member

Yes that works for me

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AugustinMauroy
AugustinMauroy approved these changes Nov 1, 2026
View reviewed changes

@AugustinMauroy AugustinMauroy left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGMT !

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot

nodejs-github-bot commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

Landed in cb05e4d

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 14, 2026
@GeoffreyBooth
GeoffreyBooth deleted the remove-module-register branch November 14, 2026 21:52
@GeoffreyBooth GeoffreyBooth added the notable-change PRs with changes that should be highlighted in changelogs. label Nov 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

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

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth

GeoffreyBooth commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

I should've added notable-change earlier, but anyway it's there now and I added some text for the release notes or blog post. There should be one more sentence linking to a migration guide once one lands, such as nodejs/learn#190 or a new PR.

JakobJingleheimer reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GeoffreyBooth GeoffreyBooth mentioned this pull request Nov 14, 2026
feat(module-register-to-register-hooks): add DEP0205 recipe nodejs/userland-migrations#572
Open
@Renegade334 Renegade334 added 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 Nov 14, 2026
@pullfrog pullfrog Bot mentioned this pull request Nov 15, 2026
CI is failing on main nubjs/nub#1126
Closed
colinhacks added a commit to nubjs/nub that referenced this pull request Nov 15, 2026
@colinhacks
scripts: acknowledge --experimental-loader removal on Node 28 nightly
ced7e5a
Node removed module.register() and --experimental-loader/--loader for 28
(nodejs/node#67090). Nub never injects either flag.

Refs #1126
@colinhacks colinhacks mentioned this pull request Nov 15, 2026
runtime: start unhooked when Node has no module.register() nubjs/nub#1127
Merged
colinhacks added a commit to nubjs/nub that referenced this pull request Nov 15, 2026
@colinhacks
runtime: start unhooked when Node has no module.register() (#1127)
1192a96
Node 28 removed module.register() (nodejs/node#67090). Under
--no-experimental-require-module the preload cannot load its transform core
synchronously, so it fell back to a module.register() loader worker, and on
Node 28 that crashed every process at startup with "module_.register is not a
function". The CLI preload and the standalone runner's --require entry now
print one line saying the hooks are off and let Node run the program, with its
own type stripping still covering erasable TypeScript.

Refs #1126
@trentm trentm mentioned this pull request Nov 16, 2026
switch to module.registerHooks elastic/elastic-otel-node#1665
Open
@pabloerhard pabloerhard mentioned this pull request Nov 17, 2026
fix(esm): register synchronous hooks without require(esm) DataDog/dd-trace-js#11296
Merged
aduh95 pushed a commit that referenced this pull request Nov 19, 2026
@GeoffreyBooth @aduh95
module: remove async module customization hooks
bfded15
Remove `module.register()` (DEP0205), the `--experimental-loader` and
`--loader` flags, and the machinery that supported them: the loader
hooks worker thread, the hooks proxy, the async module customization
hook chains for resolving and loading, the internal worker class used to
run the loader thread, and the asynchronous module job linking. Module
customization is now provided only by `module.registerHooks()`, which
runs synchronously on the thread that loads the modules.

As the loader thread no longer exists, the ES module loader always loads
and links modules synchronously, so the code that handled promises and
the re-invented `require()` for imported CommonJS customized by the
async module customization hooks is removed too. `import()` still defers
evaluation of the module to a later microtask, as before.

`worker_threads.isInternalThread` is kept for compatibility and is now
always `false`; removing it is left for a future semver-major change.

The `ERR_ASYNC_LOADER_REQUEST_NEVER_SETTLED` and
`ERR_LOADER_CHAIN_INCOMPLETE` error codes are no longer used and are
documented as removed.

Tests that exist only to exercise the async module customization hooks
are removed.

Assisted-by: Claude
Signed-off-by: Geoffrey Booth <[email protected]>
PR-URL: #67090
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ilyas Shabi <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
2026-11-25, Version 27.0.0-alpha.0.2.0 (Alpha) #67757
Merged
nodejs-github-bot added a commit that referenced this pull request Nov 24, 2026
@nodejs-github-bot
2026-11-25, Version 27.0.0-alpha.0.2.0 (Alpha)
0296c04
Notable changes:

doc:
  * swap `util.TextDecoder` and `util.TextEncoder` with globals (LiviaMedeiros) #67461
  * use global `TextDecoder` and `TextEncoder` instead of `util` (LiviaMedeiros) #67461
  * deprecate `util.TextDecoder` and `util.TextEncoder` (LiviaMedeiros) #67461
http2:
  * (SEMVER-MINOR) add missing setHeaders (jakecastelli) #67597
  * (SEMVER-MINOR) add callback to informational header methods (Yuya Inoue) #67470
lib:
  * (SEMVER-MINOR) graduate the --process-timeout option (James M Snell) #67506
module:
  * remove async module customization hooks (Geoffrey Booth) #67090
os:
  * (SEMVER-MINOR) expose `guessFileDescriptorType` (Vlad Frangu) #58060
sqlite:
  * mark as stable (Christian Aurich Zanettini Martins) #67654
src:
  * (SEMVER-MINOR) restore tty state on exit only if changed (Matteo Collina) #66753
test:
  * update Intl tests for CLDR 49 (Renegade334) #66992
  * remove unnecessary imports for `TextDecoder` and `TextEncoder` (LiviaMedeiros) #67461
tls:
  * (SEMVER-MINOR) docs-deprecate TLS renegotiation, add allowRenegotiation opt-in (Tim Perry) #67532

PR-URL: #67757
aduh95 pushed a commit that referenced this pull request Nov 24, 2026
@nodejs-github-bot @aduh95
2026-11-25, Version 27.0.0-alpha.0.2.0 (Alpha)
9d44b49
Notable changes:

doc:
  * deprecate `util.TextDecoder` and `util.TextEncoder` (LiviaMedeiros) #67461
http2:
  * (SEMVER-MINOR) add missing setHeaders (jakecastelli) #67597
  * (SEMVER-MINOR) add callback to informational header methods (Yuya Inoue) #67470
lib:
  * (SEMVER-MINOR) graduate the `--process-timeout` option (James M Snell) #67506
module:
  * remove async module customization hooks (Geoffrey Booth) #67090
os:
  * (SEMVER-MINOR) expose `guessFileDescriptorType` (Vlad Frangu) #58060
sqlite:
  * mark as stable (Christian Aurich Zanettini Martins) #67654
src:
  * (SEMVER-MINOR) restore tty state on exit only if changed (Matteo Collina) #66753
tls:
  * (SEMVER-MINOR) docs-deprecate TLS renegotiation, add allowRenegotiation opt-in (Tim Perry) #67532

PR-URL: #67757
@pabloerhard pabloerhard mentioned this pull request Nov 24, 2026
fix(esm): await dd-trace/register.mjs before loading handlers DataDog/datadog-lambda-js#872
Open
3 of 11 tasks
@aduh95

aduh95 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor
  • Before it was deprecated, module.register() was documented as “Stability: 1.1 - Active development”, and the “Asynchronous customization hooks” section still carries that marking. documentation.md says Stability 1 features are “not subject to semantic versioning rules” and that “removal may occur in any future release.”

It doesn't matter what its status was before it was deprecated; now that it's deprecated, removing it is semver-major

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95 aduh95 added semver-major PRs that contain breaking changes and should be released in the next major version. and removed 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. dont-land-on-v26.x PRs that should not land on the v26.x-staging branch and should not be released in v26.x. labels Nov 25, 2026
@GeoffreyBooth

GeoffreyBooth commented Nov 26, 2026

Copy link
Copy Markdown
Member Author

It doesn't matter what its status was before it was deprecated; now that it's deprecated, removing it is semver-major

In practical terms, I assume this makes no difference for this particular PR? It goes out in 27 either way, right?

Separately, I don't follow the logic that because something became deprecated its removal therefore becomes semver-major. That would seem to mean that deprecated status is equivalent to being stable, which makes no sense. Deprecated is a lower status than experimental, and the removal of a deprecated feature should be just as permissible. To argue otherwise would discourage people from deprecating experimental features; if deprecating something makes it harder to remove, then people will try to simply remove things from experimental directly and skip the deprecation step. Our users are better served by getting as much warning as possible, which is what the deprecation step provides. We shouldn't make deprecation a barrier to removal.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sebdanielsson added a commit to sebdanielsson/node that referenced this pull request Nov 26, 2026
@sebdanielsson
module: fix sync hook resolution with async hooks
30e1673
When module.register() hooks are registered, they run in the default
step of the module.registerHooks() resolve chain, but reaching that
step was only tracked when there were no asynchronous hooks. Imported
CommonJS resolved by a synchronous hook that calls nextResolve() was
then treated as short-circuited, and the format from the hooks made
the CommonJS loader bypass require.extensions.

Track reaching the default step in both cases.

This only applies to release lines that still have module.register(),
which has been removed from main.

Fixes: nodejs#66998
Refs: nodejs#62920
Refs: nodejs#67090
Signed-off-by: Sebastian Danielsson <[email protected]>
Assisted-by: Claude Code
sebdanielsson added a commit to sebdanielsson/node that referenced this pull request Nov 26, 2026
@sebdanielsson
module: fix sync hook resolution with async hooks
c01be87
When module.register() hooks are registered, they run in the default
step of the module.registerHooks() resolve chain, but reaching that
step was only tracked when there were no asynchronous hooks. Imported
CommonJS resolved by a synchronous hook that calls nextResolve() was
then treated as short-circuited, and the format from the hooks made
the CommonJS loader bypass require.extensions.

Track reaching the default step in both cases.

This only applies to release lines that still have module.register(),
which has been removed from main.

Fixes: nodejs#66998
Refs: nodejs#62920
Refs: nodejs#67090
Signed-off-by: Sebastian Danielsson <[email protected]>
Assisted-by: Claude Code
@MikeMcC399 MikeMcC399 mentioned this pull request Nov 26, 2026
[email protected] fails in Node.js nightly 28.0.0-nightly20261126fa49b1361b nodejs/citgm#1244
Open
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@GeoffreyBooth @gabylb
module: remove async module customization hooks
bafbc29
Remove `module.register()` (DEP0205), the `--experimental-loader` and
`--loader` flags, and the machinery that supported them: the loader
hooks worker thread, the hooks proxy, the async module customization
hook chains for resolving and loading, the internal worker class used to
run the loader thread, and the asynchronous module job linking. Module
customization is now provided only by `module.registerHooks()`, which
runs synchronously on the thread that loads the modules.

As the loader thread no longer exists, the ES module loader always loads
and links modules synchronously, so the code that handled promises and
the re-invented `require()` for imported CommonJS customized by the
async module customization hooks is removed too. `import()` still defers
evaluation of the module to a later microtask, as before.

`worker_threads.isInternalThread` is kept for compatibility and is now
always `false`; removing it is left for a future semver-major change.

The `ERR_ASYNC_LOADER_REQUEST_NEVER_SETTLED` and
`ERR_LOADER_CHAIN_INCOMPLETE` error codes are no longer used and are
documented as removed.

Tests that exist only to exercise the async module customization hooks
are removed.

Assisted-by: Claude
Signed-off-by: Geoffrey Booth <[email protected]>
PR-URL: nodejs#67090
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ilyas Shabi <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mcollina mcollina mcollina approved these changes
@jasnell jasnell jasnell approved these changes
@JakobJingleheimer JakobJingleheimer JakobJingleheimer approved these changes
@joyeecheung joyeecheung joyeecheung approved these changes
@IlyasShabi IlyasShabi IlyasShabi approved these changes
@marco-ippolito marco-ippolito Awaiting requested review from marco-ippolito
+1 more reviewer
@AugustinMauroy AugustinMauroy AugustinMauroy approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. esm Issues and PRs related to the ECMAScript Modules implementation. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. loaders Issues and PRs related to ES module loaders. module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

11 participants

@GeoffreyBooth @nodejs-github-bot @AugustinMauroy @marco-ippolito @joyeecheung @JakobJingleheimer @aduh95 @mcollina @jasnell @IlyasShabi @Renegade334
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.