Repository navigation
module: remove async module customization hooks - #67090
Draft
GeoffreyBooth wants to merge 2 commits into
Draft
GeoffreyBooth wants to merge 2 commits into
GeoffreyBooth wants to merge 2 commits into
Conversation
Port the tests that registered async module customization hooks, via `--loader`, `--experimental-loader` or `module.register()`, only as a means of exercising other features to use `module.registerHooks()` instead. This keeps the coverage for those features independent of the async module customization hooks, which are being removed. Tests that exist only to exercise the async module customization hooks themselves are left as they are. Assisted-by: Claude Signed-off-by: Geoffrey Booth <webadmin@geoffreybooth.com>
Collaborator
|
Review requested:
|
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 29, 2026 02:24
a98403b to
95c14fc
Compare
Collaborator
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().REPLACEMEplaceholders (version, PR URL) are left for landing.