module.registerHooks() tracking issue
Aperta
Nessuno ha ancora preso questa issue.
loaders
module
- Lingua principale
- JavaScript
- Stelle
- 122k
- Fork
- 37.3k
- Merge medio
- 4g 2h
- PR unite (30g)
- 283
Descrizione
- 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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con l’issue successiva https://github.com/nodejs/node/issues/62720 e le proposte collegate di Node.js loaders, in particolare gli hook link e startGraph. Questa tracking issue è stata spostata altrove ed elenca il lavoro di progettazione ancora irrisolto, quindi i suoi criteri di completamento non sono definiti qui.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, node.js
- Ambito
- backend
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 15/100