Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitafb0736

Browse files
Move old roadmap into new file; update roadmap for 2025 (#248)
1 parent65ba83d commitafb0736

File tree

2 files changed

+71
-34
lines changed

2 files changed

+71
-34
lines changed

‎README.md

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The Node.js Loaders Team maintains and actively develops the ECMAScript Modules
66

77
##History
88

9-
This team is spun off from the[Modules team](https://github.com/nodejs/modules). We aim to implement the[use cases](https://github.com/nodejs/modules/blob/main/doc/use-cases.md) that went unfulfilled by the initial ES modules implementation that can be achieved vialoaders.
9+
This team is spun off from the[Modules team](https://github.com/nodejs/modules). We aim to implement the[use cases](https://github.com/nodejs/modules/blob/main/doc/use-cases.md) that went unfulfilled by the initial ES modules implementation that can be achieved viamodule customization hooks; to provide hooks that are sufficiently powerful to allow the sunset of CommonJS monkey-patching; and to improve the ES modules implementation to reach parity with CommonJS.
1010

1111
##Project
1212

@@ -22,43 +22,17 @@ This team is spun off from the [Modules team](https://github.com/nodejs/modules)
2222

2323
##Status
2424

25-
###Milestone 1: Parity with CommonJS
25+
###Goal: Sunset Monkey-Patching
2626

27-
Before extending into new frontiers, we need to improvetheloaders API enoughthatuserscando just about everything they could doinCommonJS with ESM + loaders. (Outside of loaders scope, but related tothegoal of parity between CommonJS and ESM, is finishing and stabilizing`--experimental-vm-modules`.)
27+
-[ ] Synchronous version ofthemodule customization hooks sothatthe hookscanbe usedinthe`require` path onthemain thread, per[design](./doc/design/proposal-synchronous-hooks.md).
2828

29-
-[x] Finishhttps://github.com/nodejs/node/pull/37468 /https://github.com/nodejs/node/pull/35524, simplifying the hooks to`resolve`,`load` and`globalPreloadCode`.
29+
###Goal: Parity with CommonJS
3030

31-
-[x] Refactor theinternal Node ESMLoader hooks into`resolve` and`load`. Node’s internalloader 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
31+
-[ ] Synchronize theESMloader, to hopefully close the startup performance gap with CommonJSandallow more predictable async activity on startup (for example, no`async_hooks` activity will precede user code).[Tracking issue](https://github.com/nodejs/node/issues/55782).
3232

33-
-[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
33+
-[ ] Implement`import.meta.main`, matching other runtimes.[Tracking issue](https://github.com/nodejs/node/issues/57226).
3434

35-
-[x] Implement chaining as described in the[design](doc/design/proposal-chaining-middleware.md), where the`default<hookName>` becomes`next` and references the next registered hook in the chain.https://github.com/nodejs/node/pull/42623
36-
37-
-[x] Have loaders apply to subsequent loaders.https://github.com/nodejs/loaders/blob/main/doc/design/proposal-ambient-loaders.md,https://github.com/nodejs/node/pull/43772
38-
39-
-[x] Move loaders off thread.https://github.com/nodejs/modules/issues/351#issuecomment-634347749.https://github.com/nodejs/node/issues/43658,https://github.com/nodejs/node/pull/44710
40-
41-
###Milestone 2: Stability
42-
43-
-[x] Provide a way to register loaders from application code, such as`import { register } from 'node:module'`.https://github.com/nodejs/node/pull/46826,https://github.com/nodejs/node/pull/48559.
44-
45-
-[x] Replace`globalPreload` hook with new`initialize` hook; update`register` to preserve the communications channel from that hook so that we continue to provide a way to communicate between loaders code and application code. Seehttps://github.com/nodejs/loaders/discussions/124#discussioncomment-5735397 andhttps://github.com/nodejs/loaders/issues/147.https://github.com/nodejs/node/pull/48842.
46-
47-
-[x] Remove`globalPreload` hook.https://github.com/nodejs/node/pull/49144.
48-
49-
-[x] Support loading source when the return value of`load` has`format: 'commonjs'`. Seehttps://github.com/nodejs/node/issues/34753#issuecomment-735921348 andhttps://github.com/nodejs/loaders-test/blob/835506a638c6002c1b2d42ab7137db3e7eda53fa/coffeescript-loader/loader.js#L45-L50.https://github.com/nodejs/node/pull/47999.
50-
51-
-[x] Unflag`import.meta.resolve`.https://github.com/nodejs/node/pull/49028.
52-
53-
###Milestone 3: Usability improvements
54-
55-
-[x] Provide a way to register loaders via configuration, for example via adding support for`.env` files to Node.js or having`node` read configuration from a new field in`package.json` or other configuration file. Seehttps://github.com/nodejs/node/pull/46826,[#98](https://github.com/nodejs/loaders/issues/98),https://github.com/nodejs/node/pull/43973#issuecomment-1249549346.https://github.com/nodejs/node/pull/48890.
56-
57-
-[ ] Integrated support for external formats.
58-
59-
-[ ] Phase 1: Support identifying external modules (eg`typescript`); seehttps://github.com/nodejs/node/pull/49704.
60-
-[ ] Phase 2: Support guided remediation via package manager search (eg`npm search … typescript`).
61-
-[ ] Phase 3: Automatically configure Node.
35+
###Other Improvements
6236

6337
-[ ] First-class support for[import maps](https://github.com/WICG/import-maps) that doesn’t require a custom loader.
6438

@@ -75,7 +49,7 @@ Before extending into new frontiers, we need to improve the loaders API enough t
7549
-[ ] Hooks for customizing the REPL, including transpilation and tab completion. Support users pasting TypeScript (or CoffeeScript or whatever) into the REPL and having just as good an experience as with plain JavaScript.
7650

7751
-[ ] Support top-level`await` in the REPL API, if possible.
78-
52+
7953
-[ ] Allow customizing string inputs:`--eval` CLI flag,`Worker` constructor, stdin, etc.
8054

8155
-[ ] Hooks for customizing the stack trace (in other words, a hook version of`Error.prepareStackTrace`). This would allow transpiled languages to improve the output.

‎doc/roadmap-2024.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
This is the legacy roadmap as it was in 2024:
2+
3+
###Milestone 1: Parity with CommonJS
4+
5+
Before extending into new frontiers, we need to improve the loaders API enough that users can do just about everything they could do in CommonJS with ESM + loaders. (Outside of loaders scope, but related to the goal of parity between CommonJS and ESM, is finishing and stabilizing`--experimental-vm-modules`.)
6+
7+
-[x] Finishhttps://github.com/nodejs/node/pull/37468 /https://github.com/nodejs/node/pull/35524, simplifying the hooks to`resolve`,`load` and`globalPreloadCode`.
8+
9+
-[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
10+
11+
-[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
12+
13+
-[x] Implement chaining as described in the[design](doc/design/proposal-chaining-middleware.md), where the`default<hookName>` becomes`next` and references the next registered hook in the chain.https://github.com/nodejs/node/pull/42623
14+
15+
-[x] Have loaders apply to subsequent loaders.https://github.com/nodejs/loaders/blob/main/doc/design/proposal-ambient-loaders.md,https://github.com/nodejs/node/pull/43772
16+
17+
-[x] Move loaders off thread.https://github.com/nodejs/modules/issues/351#issuecomment-634347749.https://github.com/nodejs/node/issues/43658,https://github.com/nodejs/node/pull/44710
18+
19+
###Milestone 2: Stability
20+
21+
-[x] Provide a way to register loaders from application code, such as`import { register } from 'node:module'`.https://github.com/nodejs/node/pull/46826,https://github.com/nodejs/node/pull/48559.
22+
23+
-[x] Replace`globalPreload` hook with new`initialize` hook; update`register` to preserve the communications channel from that hook so that we continue to provide a way to communicate between loaders code and application code. Seehttps://github.com/nodejs/loaders/discussions/124#discussioncomment-5735397 andhttps://github.com/nodejs/loaders/issues/147.https://github.com/nodejs/node/pull/48842.
24+
25+
-[x] Remove`globalPreload` hook.https://github.com/nodejs/node/pull/49144.
26+
27+
-[x] Support loading source when the return value of`load` has`format: 'commonjs'`. Seehttps://github.com/nodejs/node/issues/34753#issuecomment-735921348 andhttps://github.com/nodejs/loaders-test/blob/835506a638c6002c1b2d42ab7137db3e7eda53fa/coffeescript-loader/loader.js#L45-L50.https://github.com/nodejs/node/pull/47999.
28+
29+
-[x] Unflag`import.meta.resolve`.https://github.com/nodejs/node/pull/49028.
30+
31+
###Milestone 3: Usability improvements
32+
33+
-[x] Provide a way to register loaders via configuration, for example via adding support for`.env` files to Node.js or having`node` read configuration from a new field in`package.json` or other configuration file. Seehttps://github.com/nodejs/node/pull/46826,[#98](https://github.com/nodejs/loaders/issues/98),https://github.com/nodejs/node/pull/43973#issuecomment-1249549346.https://github.com/nodejs/node/pull/48890.
34+
35+
-[ ] Integrated support for external formats.
36+
37+
-[ ] Phase 1: Support identifying external modules (eg`typescript`); seehttps://github.com/nodejs/node/pull/49704.
38+
-[ ] Phase 2: Support guided remediation via package manager search (eg`npm search … typescript`).
39+
-[ ] Phase 3: Automatically configure Node.
40+
41+
-[ ] First-class support for[import maps](https://github.com/WICG/import-maps) that doesn’t require a custom loader.
42+
43+
-[ ] Add helper/utility functions to reduce boilerplate in user-defined hooks.
44+
45+
-[ ] Start with helpers for retrieving the closest parent`package.json` associated with a specifier string; and for retrieving the`package.json` for a particular package by name (which is not necessarily the same result).
46+
47+
-[ ] Potentially include all the functions that make up the ESM resolution algorithm as defined in the[spec](https://nodejs.org/api/esm.html#resolution-algorithm-specification). Create helper functions for each of the functions defined in that psuedocode:`esmResolve`,`packageImportsResolve`,`packageResolve`,`esmFileFormat`,`packageSelfResolve`,`readPackageJson`,`packageExportsResolve`,`lookupPackageScope`,`packageTargetResolve`,`packageImportsExportsResolve`,`patternKeyCompare`. (Not necessarily all with these exact names, but corresponding to these functions from the spec.)
48+
49+
-[ ] Follow up with similar helper functions that make up what happens within Node’s internal`load`. (Definitions to come.)
50+
51+
-[ ] Helper/utility functions to allow access to the CommonJS named exports discovery algorithm (`cjs-module-lexer`).
52+
53+
-[ ] Hooks for customizing the REPL, including transpilation and tab completion. Support users pasting TypeScript (or CoffeeScript or whatever) into the REPL and having just as good an experience as with plain JavaScript.
54+
55+
-[ ] Support top-level`await` in the REPL API, if possible.
56+
57+
-[ ] Allow customizing string inputs:`--eval` CLI flag,`Worker` constructor, stdin, etc.
58+
59+
-[ ] Hooks for customizing the stack trace (in other words, a hook version of`Error.prepareStackTrace`). This would allow transpiled languages to improve the output.
60+
61+
-[ ] Hooks for customizing filesystem calls, for allowing things like virtual filesystems or archives treated as volumes.
62+
63+
-[ ] Inherit configuration blob to worker threads and child processes.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp