Skip to content
This repository was archived by the owner on Sep 2, 2023. It is now read-only.

Commit 9672f7c

Browse files
Updates per 2019-06-19 meeting (#343)
Updates per 2019-06-19 meeting
2 parents a50121b + 61a4664 commit 9672f7c

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

‎doc/plan-for-new-modules-implementation.md‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ Phase 3 improves user experience and extends the MVP. Phase 3 is malleable based
9999
- Should loaders be per package, per application or either?
100100
- **Status**: In development.
101101

102-
* Map the paths within modules, providing similar functionality as the browser’s [import maps proposal](https://github.com/WICG/import-maps#packages-via-trailing-slashes).
102+
* `"exports"` field: for consumers of a package, map the paths of deep imports to provide encapsulation (an explicit public API); pretty specifiers (no file exensions or paths that include things like `dist/`) and flexibility for future package versions renaming or moving files without affecting the package’s public API. Applies to both ESM and CommonJS.
103103
- Proposal: [Package Exports Proposal](https://github.com/jkrems/proposal-pkg-exports).
104-
- **Status**: Proposal under development.
104+
- **Status**: Ready for PR.
105105

106106
* Reference package root via the package’s name.
107107
- Proposal: [Package `"name"` Resolution Proposal](https://github.com/guybedford/package-name-resolution).
@@ -113,11 +113,6 @@ Phase 3 improves user experience and extends the MVP. Phase 3 is malleable based
113113
- Upstream PR: https://github.com/nodejs/node/pull/27808.
114114
- **Status**: Upstream PR submitted.
115115

116-
* Provide a way to make ESM the default instead of CommonJS.
117-
- Discussion: https://github.com/nodejs/modules/issues/318.
118-
- Proposal: https://github.com/nodejs/modules/issues/335.
119-
- **Status**: Seeking consensus.
120-
121116
* Dual CommonJS/ESM packages: Either support packages with both CommonJS and ESM sources that can be used in either environment; or decide to specifically not support dual CommonJS/ESM packages.
122117
- Status quo is current `--experimental-modules` behavior: `"main"` points to exactly one file, and all file extensions are mandatory (by default), so there is no possibility of an `import` specifier pointing to different files in ESM versus CommonJS. Recommended practice for dual packages is to have `"main"` point to the CommonJS entry point and have users use a deep import, e.g. `/module.mjs`, to access ESM entry point.
123118
- PR to document status quo: https://github.com/nodejs/node/pull/27957.
@@ -139,6 +134,9 @@ Phase 3 improves user experience and extends the MVP. Phase 3 is malleable based
139134
* Better mechanism for creating `require` function: `createRequire`.
140135
- Landed in https://github.com/nodejs/node/pull/27405 and shipped in 12.2.0.
141136

142-
### Abandoned
137+
### Tabled
143138

144-
Proposals that the group has decided not to pursue will be listed here, along with explanations.
139+
* Provide a way to make ESM the default instead of CommonJS.
140+
- Discussion: https://github.com/nodejs/modules/issues/318.
141+
- Proposal: https://github.com/nodejs/modules/issues/335.
142+
- **Status**: Currently one can add `--input-type=module` to `NODE_OPTIONS` to flip the default for `--input-type`; at the moment the group is deciding not to pursue providing an ability to flip the default for the `package.json` `type` field. We instead want to encourage all packages, both ESM and CommonJS, to include an explicit `type` field; leaving it out and relying on a default is something we want to discourage.

0 commit comments

Comments
 (0)