From 541d4ca8cfa596f632f9617a10465bebec13853e Mon Sep 17 00:00:00 2001 From: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> Date: Mon, 9 May 2022 14:43:35 -0400 Subject: [PATCH 1/2] add new items to ToDo list & add links to PRs --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 571d2a7..8f7a3e6 100644 --- a/README.md +++ b/README.md @@ -22,20 +22,20 @@ This team is spun off from the [Modules team](https://github.com/nodejs/modules) ## Status -### Complete +- [x] Finish https://github.com/nodejs/node/pull/37468 / https://github.com/nodejs/node/pull/35524, simplifying the hooks to `resolve`, `load` and `globalPreloadCode`. -1. Finish https://github.com/nodejs/node/pull/37468 / https://github.com/nodejs/node/pull/35524, simplifying the hooks to `resolve`, `load` and `globalPreloadCode`. +- [x] 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). https://github.com/nodejs/node/pull/37468 -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). +- [x] 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). https://github.com/nodejs/node/pull/37468 -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). +- [x] Implement chaining as described in the [design](doc/design/proposal-chaining-middleware.md), where the `default` becomes `next` and references the next registered hook in the chain. https://github.com/nodejs/node/pull/42623 -1. Implement chaining as described in the [design](doc/design/proposal-chaining-middleware.md), where the `default` becomes `next` and references the next registered hook in the chain. +- [ ] Convert `resolve` from async to sync -### In Progress + - [ ] Add an async `resolve` to [`module`](https://nodejs.org/api/module.html) module -### Upcoming +- [ ] Move loaders off thread -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. +- [ ] 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. From af7f16a9d1c5e98ac3a157e1d31cc2b9f9a779ac Mon Sep 17 00:00:00 2001 From: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> Date: Tue, 10 May 2022 08:04:53 -0400 Subject: [PATCH 2/2] Add item for helper functions --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8f7a3e6..2a312b9 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ This team is spun off from the [Modules team](https://github.com/nodejs/modules) - [ ] Add an async `resolve` to [`module`](https://nodejs.org/api/module.html) module +- [ ] Add helper/utility functions (eg `getPackageType()`) to [`module`](https://nodejs.org/api/module.html) module + - [ ] Move loaders off thread - [ ] 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.