Open
Description
- Initial proposal: Proposal for a simple, universal module loader hooks API to replace require() monkey-patching #52219
- Loaders design proposal: doc: add synchronous hooks proposal loaders#198
- Initial implementation: implement module.registerHooks() to run synchronous module customization hooks in thread #55698
- Implement evaluation hook for at least CJS to help use cases like require-in-the-middle, which was supposed to be based on doc: add synchronous hooks proposal loaders#198 but we had some discussions over the collaboration summit/NodeConf EU about changing the hook to be "wrapping around evaluation", not "after evaluation": WIP
- For ESM, there's currently no way for Node.js to hook into the evaluation of child modules, will need to discuss with V8 about it (issue). Allowing mutation of the exports would require a spec change so out of scope for
module.registerHooks()
or Node.js in general
- For ESM, there's currently no way for Node.js to hook into the evaluation of child modules, will need to discuss with V8 about it (issue). Allowing mutation of the exports would require a spec change so out of scope for
- Implement link hook for ESM, as proposed in doc: add synchronous hooks proposal loaders#198 to make use cases like import-in-the-middle less hacky
-
Symbol.dispose
integration (requested in implement module.registerHooks() to run synchronous module customization hooks in thread #55698 (comment)) - Reordering of the documentation when
module.registerHooks()
is battle tested enough and should be preferred overmodule.register
to avoid various caveats (requested in implement module.registerHooks() to run synchronous module customization hooks in thread #55698 (comment) and implement module.registerHooks() to run synchronous module customization hooks in thread #55698 (review)) - Advocating it to popular npm packages doing CJS monkey-patching to reduce the overall dependency of CJS loader internals in the ecosystem
- Support of unknown extensions (learned about it when I was initially proposing Proposal for a simple, universal module loader hooks API to replace require() monkey-patching #52219)
- Support
node:builtin?param=val
- Figure out how to make search params work with CJS cache
- Create a polyfill of
module.register()
built on top ofmodule.registerHooks()
-
startGraph
hook proposed in Proposal: Moving hooks on thread loaders#205
Activity