node icon indicating copy to clipboard operation
node copied to clipboard

esm: remove CLI flag limitation to programmatic registration

Open JakobJingleheimer opened this issue 2 years ago • 1 comments

This is a follow-up to https://github.com/nodejs/node/pull/46826

We see 2 potential approaches here when we detect a user is trying to register a loader and the worker etc have not be set up:

  1. Replace the existing DefaultModuleLoader with a CustomizedModuleLoader
  2. Merge the two ModuleLoaders back together and trigger setups when certain methods are called (eg ModuleLoader::register())

The first seems the simplest. However, it's currently facing an issue where ModuleJob maintains a reference to the loader that instantiated it; in option 1, that reference becomes stale. Further work to be done is to sever their direct connection.

JakobJingleheimer avatar Jun 12 '23 22:06 JakobJingleheimer

Review requested:

  • [ ] @nodejs/loaders
  • [ ] @nodejs/modules

nodejs-github-bot avatar Jun 12 '23 22:06 nodejs-github-bot