Repository navigation
module: remove async module customization hooks - #67090
Open
GeoffreyBooth wants to merge 2 commits into
Open
GeoffreyBooth wants to merge 2 commits into
GeoffreyBooth wants to merge 2 commits into
Conversation
Collaborator
|
Review requested:
|
Collaborator
GeoffreyBooth
force-pushed
the
remove-module-register
branch
from
October 29, 2026 02:24
a98403b to
95c14fc
Compare
Collaborator
GeoffreyBooth
force-pushed
the
remove-module-register
branch
2 times, most recently
from
October 30, 2026 02:44
6cea4a9 to
355da9b
Compare
Collaborator
GeoffreyBooth
force-pushed
the
remove-module-register
branch
from
October 30, 2026 03:23
355da9b to
aab37fe
Compare
Collaborator
GeoffreyBooth
force-pushed
the
remove-module-register
branch
from
October 30, 2026 04:57
aab37fe to
ada3473
Compare
GeoffreyBooth
marked this pull request as ready for review
October 30, 2026 05:00
GeoffreyBooth
force-pushed
the
remove-module-register
branch
from
October 30, 2026 05:02
ada3473 to
937a866
Compare
Collaborator
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 <webadmin@geoffreybooth.com>
GeoffreyBooth
force-pushed
the
remove-module-register
branch
from
October 30, 2026 05:15
937a866 to
a825144
Compare
Collaborator
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67090 +/- ##
==========================================
- Coverage 90.67% 90.65% -0.02%
==========================================
Files 797 794 -3
Lines 278777 276716 -2061
Branches 53610 53307 -303
==========================================
- Hits 252782 250866 -1916
+ Misses 16343 16199 -144
+ Partials 9652 9651 -1
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Removes
module.register()(DEP0205), the--experimental-loaderand--loaderflags, 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 bymodule.registerHooks(), which runs synchronously on the thread that loads the modules.require()for imported CommonJS are gone.import()still defers evaluation to a later microtask.worker_threads.isInternalThreadis kept and alwaysfalse; removing it is left for a semver-major change.deprecations.mdas End-of-Life.ERR_ASYNC_LOADER_REQUEST_NEVER_SETTLEDandERR_LOADER_CHAIN_INCOMPLETEmove to Legacy inerrors.md.require()after a failedimport()and thatimport()does not evaluate the module before returning.REPLACEMEplaceholders for the version are left for landing.