You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 2, 2023. It is now read-only.
*`"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.
@@ -116,12 +113,11 @@ Phase 3 improves user experience and extends the MVP. Phase 3 is malleable based
116
113
117
114
* 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.
118
115
- 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.
119
-
- PR to document status quo: https://github.com/nodejs/node/pull/27957.
120
116
- Proposal for new `package.json` field for ESM entry point: https://github.com/nodejs/modules/issues/273.
121
-
- PR for new `package.json` field: https://github.com/nodejs/ecmascript-modules/pull/41.
122
-
- Status summary: https://github.com/nodejs/modules/issues/273#issuecomment-492408041.
117
+
- PR for above proposal: https://github.com/nodejs/ecmascript-modules/pull/41.
118
+
- PR is currently blocked because of this issue: https://github.com/nodejs/modules/issues/371.
123
119
- Proposal for `require` of ESM: https://github.com/nodejs/modules/issues/299.
124
-
-**Status**: Status quo has consensus and will ship absent any other proposals achieving consensus. “New field” proposal lacks consensus. “`require` of ESM” proposal awaiting implementation and consensus.
120
+
-**Status**: Status quo has consensus and will ship absent any other proposals achieving consensus. “New field” proposal is [blocked](https://github.com/nodejs/modules/issues/371). “`require` of ESM” proposal awaiting implementation and consensus.
125
121
126
122
* Finalize behavior of `import` of CommonJS files and packages.
@@ -135,6 +131,10 @@ Phase 3 improves user experience and extends the MVP. Phase 3 is malleable based
135
131
* Better mechanism for creating `require` function: `createRequire`.
136
132
- Landed in https://github.com/nodejs/node/pull/27405 and shipped in 12.2.0.
137
133
134
+
*`"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.
- Landed in https://github.com/nodejs/node/pull/28568 and shipped in 12.7.0 behind `--experimental-exports`. Further improvements are being made as additional PRs against core.
137
+
138
138
### Tabled
139
139
140
140
* Provide a way to make ESM the default instead of CommonJS.
0 commit comments