From b46eb6098d56c8a8bd54683c6f3c3b487ec91e9d Mon Sep 17 00:00:00 2001 From: Jacob <3012099+JakobJingleheimer@users.noreply.github.com> Date: Sun, 16 May 2021 14:31:10 -0400 Subject: [PATCH 1/2] Update status Updated items are addressed by nodejs/node#37468 --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2239072..801aecb 100644 --- a/README.md +++ b/README.md @@ -22,18 +22,20 @@ This team is spun off from the [Modules team](https://github.com/nodejs/modules) ## Status -### In Progress +### Complete 1. Finish https://github.com/nodejs/node/pull/37468 / https://github.com/nodejs/node/pull/35524, simplifying the hooks to `resolve`, `load` and `globalPreloadCode`. -### Upcoming - 1. Refactor the internal Node ESM loader’s hooks into `resolve` and `load`. Node’s internal loader already has no-ops for `transformSource` and `getGlobalPreloadCode`, so all this really entails is merging the internal `getFormat` and `getSource` into one function `load`. 1. Refactor Node’s internal ESM loader to move its exception on unknown file types from within `resolve` (on detection of unknown extensions) to within `load` (if the resolved extension has no defined translator). +### In Progress + +### Upcoming + 1. Implement chaining as described in the [design](doc/design.md), where the `default` becomes `next` and references the next registered hook in the chain. 1. Get a `load` return value of `format: 'commonjs'` to work, or at least error informatively. See https://github.com/nodejs/node/issues/34753#issuecomment-735921348. -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](doc/use-cases.md#improvements) on our to-do list, such as the loaders-application communication channel and moving loaders into a thread. \ No newline at end of file +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](doc/use-cases.md#improvements) on our to-do list, such as the loaders-application communication channel and moving loaders into a thread. From e4e834954e4d1a7974fc7d3bb9ba25681f5eb949 Mon Sep 17 00:00:00 2001 From: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:58:06 -0400 Subject: [PATCH 2/2] update completed item to reflect actual outcome: wrapped getFormat + getSource --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 801aecb..ca819b0 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ This team is spun off from the [Modules team](https://github.com/nodejs/modules) 1. Finish https://github.com/nodejs/node/pull/37468 / https://github.com/nodejs/node/pull/35524, simplifying the hooks to `resolve`, `load` and `globalPreloadCode`. -1. Refactor the internal Node ESM loader’s hooks into `resolve` and `load`. Node’s internal loader already has no-ops for `transformSource` and `getGlobalPreloadCode`, so all this really entails is merging the internal `getFormat` and `getSource` into one function `load`. +1. Refactor the internal Node ESMLoader hooks into `resolve` and `load`. Node’s internal loader already has no-ops for `transformSource` and `getGlobalPreloadCode`, so all this really entails is wrapping the internal `getFormat` and `getSource` with one function `load` (`getFormat` is used internally outside ESMLoader, so they cannot merely be merged). 1. Refactor Node’s internal ESM loader to move its exception on unknown file types from within `resolve` (on detection of unknown extensions) to within `load` (if the resolved extension has no defined translator).