-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[12.x] modules backports #35385
[12.x] modules backports #35385
Commits on Sep 28, 2020
-
module: package "imports" field
PR-URL: nodejs#34117 Reviewed-By: Jan Krems <[email protected]> Reviewed-By: Bradley Farias <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 75a2cf3 - Browse repository at this point
Copy the full SHA 75a2cf3View commit details -
module: self referential modules in repl or
-r
Load self referential modules from the repl and using the preload flag `-r`. In both cases the base path used for resolution is the current `process.cwd()`. Also fixes an internal cycle bug in the REPL exports resolution. PR-URL: nodejs#32261 Fixes: nodejs#31595 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Jan Krems <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f3a328c - Browse repository at this point
Copy the full SHA f3a328cView commit details -
module: use cjsCache over esm injection
PR-URL: nodejs#34605 Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 39a42b3 - Browse repository at this point
Copy the full SHA 39a42b3View commit details -
module: custom --conditions flag option
PR-URL: nodejs#34637 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Geoffrey Booth <[email protected]> Reviewed-By: Jan Krems <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9485ad6 - Browse repository at this point
Copy the full SHA 9485ad6View commit details -
module: share CJS/ESM resolver fns, refactoring
PR-URL: nodejs#34744 Reviewed-By: Jan Krems <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7e20df2 - Browse repository at this point
Copy the full SHA 7e20df2View commit details -
module: fix check for package.json at volume root
This patch converts the "read package scope" algorithm's while loop into a do-while loop enabling items at the filesystem root dir to be considered within the scope of a sibling package.json also at the filesystem root dir. Fixes: nodejs#33438 Co-authored-by: Guy Bedford <[email protected]> PR-URL: nodejs#34595 Reviewed-By: Jan Krems <[email protected]> Reviewed-By: Mary Marchini <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d6af3ba - Browse repository at this point
Copy the full SHA d6af3baView commit details -
module: drop
-u
alias for--conditions
Old versions of mocha break after nodejs#34637. This was a bug in mocha, but since this is a widely used module we can expect ecosystem breakage until modules are updated to the latest version of mocha. Drop the conflicting `-u` alias -- we can potentially bring it back once modules have been updated. PR-URL: nodejs#34935 Refs: mochajs/mocha#4417 Refs: nodejs#34637 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jan Krems <[email protected]> Reviewed-By: Beth Griggs <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Shelley Vohr <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 56393c1 - Browse repository at this point
Copy the full SHA 56393c1View commit details -
esm: improve error message of ERR_UNSUPPORTED_ESM_URL_SCHEME
Refs: nodejs#34765 PR-URL: nodejs#34795 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Jan Krems <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8030eb5 - Browse repository at this point
Copy the full SHA 8030eb5View commit details -
esm: shorten ERR_UNSUPPORTED_ESM_URL_SCHEME message
I know it just got modified to include new information, but this shortens the message a bit without (I hope) losing clarity or meaning. PR-URL: nodejs#34836 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Denys Otrishko <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 96325b1 - Browse repository at this point
Copy the full SHA 96325b1View commit details -
esm: better package.json parser errors
PR-URL: nodejs#35117 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b29b966 - Browse repository at this point
Copy the full SHA b29b966View commit details -
module: use isURLInstance instead of instanceof
PR-URL: nodejs#34951 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Derek Lewis <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for be78b83 - Browse repository at this point
Copy the full SHA be78b83View commit details -
module: fix crash on multiline named cjs imports
The node process crashes when trying to parse a multiline import statement for named exports of a CommonJS module: TypeError: Cannot read property '0' of null at ModuleJob._instantiate (internal/modules/esm/module_job.js:112:77) at async ModuleJob.run (internal/modules/esm/module_job.js:137:5) at async Loader.import (internal/modules/esm/loader.js:165:24) at async rejects.name (file:///***/node/test/es-module/test-esm-cjs-named-error.mjs:56:3) at async waitForActual (assert.js:721:5) at async rejects (assert.js:830:25), The reason is that the regexp that is currently used to decorate the original error fails for multi line import statements. Unfortunately the undecorated error stack only contains the single line which causes the import to fail: file:///***/node/test/fixtures/es-modules/package-cjs-named-error/multi-line.mjs:2 comeOn, ^^^^^^ SyntaxError: The requested module './fail.cjs' does not provide an export named 'comeOn' at ModuleJob._instantiate (internal/modules/esm/module_job.js:98:21) at async ModuleJob.run (internal/modules/esm/module_job.js:141:5) at async Loader.import (internal/modules/esm/loader.js:165:24) at async rejects.name (file:///***/node/test/es-module/test-esm-cjs-named-error.mjs:56:3) at async waitForActual (assert.js:721:5) at async rejects (assert.js:830:25) Hence, for multiline import statements we cannot create an equivalent piece of code that uses default import followed by an object destructuring assignment. In any case the node process should definitely not crash. So until we have a more sophisticated way of extracting the entire problematic multiline import statement, show the code example only for single-line imports where the current regexp approach works well. Refs: nodejs#35259 PR-URL: nodejs#35275 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0772b5b - Browse repository at this point
Copy the full SHA 0772b5bView commit details -
module: exports pattern support
PR-URL: nodejs#34718 Reviewed-By: Jan Krems <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ab60e95 - Browse repository at this point
Copy the full SHA ab60e95View commit details