The Node.js Loaders Team maintains and actively develops the ECMAScript Modules Loaders implementation in Node.js core.
This team is spun off from the Modules team. We aim to implement the use cases that went unfulfilled by the initial ES modules implementation that can be achieved via loaders.
-
Finish nodejs/node#37468 / nodejs/node#35524, simplifying the hooks to
resolve
,load
andglobalPreloadCode
. -
Refactor the internal Node ESMLoader hooks into
resolve
andload
. Node’s internal loader already has no-ops fortransformSource
andgetGlobalPreloadCode
, so all this really entails is wrapping the internalgetFormat
andgetSource
with one functionload
(getFormat
is used internally outside ESMLoader, so they cannot merely be merged). -
Refactor Node’s internal ESM loader to move its exception on unknown file types from within
resolve
(on detection of unknown extensions) to withinload
(if the resolved extension has no defined translator).
-
Implement chaining as described in the design, where the
default<hookName>
becomesnext
and references the next registered hook in the chain. -
Get a
load
return value offormat: 'commonjs'
to work, or at least error informatively. See nodejs/node#34753 (comment).
After this, we should get user feedback regarding the developer experience; for example, is too much boilerplate required? Should we have a separate transform
hook? And so on. We should also investigate and potentially implement the technical improvements on our to-do list, such as the loaders-application communication channel and moving loaders into a thread.