module.registerHooks() tracking issue
Offen
Dieses Issue hat noch niemand übernommen.
loaders
module
- Vorherrschende Sprache
- JavaScript
- Sterne
- 122k
- Forks
- 37.3k
- Ø Merge
- 4 T. 2 Std.
- Gemergte PRs (30 T.)
- 283
Beschreibung
- Support
node:builtin?param=val& figure out how to make search params work with CJS cache- Some clues can be found in https://github.com/nodejs/node/pull/62920 (which smooths it for internal test mocking)
-
Symbol.disposeintegration (requested in https://github.com/nodejs/node/pull/55698#discussion_r1855211481) - Initial proposal: https://github.com/nodejs/node/issues/52219
- Loaders design proposal: https://github.com/nodejs/loaders/pull/198
- Initial implementation: https://github.com/nodejs/node/pull/55698
- Make the internal resolution and loading paths synchronous, to reduce the chance of races https://github.com/nodejs/node/pull/60380
so thatwe can't really polyfillmodule.register()can be an helper built on top ofmodule.registerHooks(), and internally we only have one set of hooking points to take care ofmodule.registerwith it if we want to keep the internals to ourselves, oh well - Handle with the nullish sources of CommonJS caused by
module.register()quirk during interop: https://github.com/nodejs/node/pull/59929- 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
- Reordering of the documentation when
module.registerHooks()is battle tested enough and should be preferred overmodule.registerto avoid various caveats https://github.com/nodejs/node/issues/56241 - Support of unknown extensions (learned about it when I was initially proposing https://github.com/nodejs/node/issues/52219): this is already fully possible with the resolve hook?
Moved to https://github.com/nodejs/node/issues/62720
- Implement link hook for ESM, as proposed in https://github.com/nodejs/loaders/pull/198 to make use cases like import-in-the-middle less hacky https://github.com/nodejs/node/issues/62720
startGraphhook proposed in https://github.com/nodejs/loaders/pull/205- Implement evaluation hook for at least CJS to help use cases like require-in-the-middle, which was supposed to be based on https://github.com/nodejs/loaders/pull/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
Nice to have:
- Advocating it to popular npm packages doing CJS monkey-patching to reduce the overall dependency of CJS loader internals in the ecosystem
- Create a polyfill of
module.register()built on top ofmodule.registerHooks(): WIP in https://github.com/joyeecheung/module-register-ponyfill
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit dem Nachfolge-Issue https://github.com/nodejs/node/issues/62720 und den verknüpften Node.js loaders proposals, insbesondere den link- und startGraph-Hooks. Dieses Tracking-Issue wurde an anderer Stelle fortgeführt und führt ungelöste Designarbeiten auf; daher sind die Kriterien für seinen Abschluss hier nicht definiert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, node.js
- Bereich
- backend
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 15/100