-
Notifications
You must be signed in to change notification settings - Fork 18
Conversation
f94cc2c
to
b36bf08
Compare
What does For example if you have the following node_module pkg structure:
Assuming both import {h} from 'pkg'
import {render} from 'pkg/server' Under That is can you still archive "pretty paths" like |
b36bf08
to
2168312
Compare
I've rebased this to the CI fixes branch, and also added an adjustment to ensure the legacy resolution applies to package subpath resolution paths as well. |
@MylesBorins just for the sake of avoiding confusion, can this be named --searching-resolution or something? "legacy" already refers to a bunch of behaviour in the cjs loader that the one you copied here doesn't have. |
Also “legacy” implies it’s legacy, which at the moment it is certainly not, and we have no consensus that it will be. Please rename. Re a boolean flag; that’s fine if it follows the convention that |
15daf0a
to
03fb3b1
Compare
2de50e3
to
d6a3b09
Compare
This comment has been minimized.
This comment has been minimized.
d6a3b09
to
6d32f24
Compare
a17b130
to
3e3bb27
Compare
Updated based on all notes and added extensive tests PTAL |
test/fixtures/es-module-specifiers/node_modules/explicit-main/package.json
Show resolved
Hide resolved
6864e68
to
7a3b64e
Compare
@@ -14,7 +14,7 @@ assert.strictEqual(commonjs, 'commonjs'); | |||
assert.strictEqual(module, 'module'); | |||
assert.strictEqual(success, 'success'); | |||
assert.strictEqual(explicit, 'esm'); | |||
assert.strictEqual(implicit, 'cjs'); | |||
assert.strictEqual(implicit, 'esm'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So with this change, from the prior loader, .mjs
would be resolved before .js
? would .cjs
resolve before .mjs
?
dcee790
to
a7b4b27
Compare
Looks good to me, as long as if dual-mode is possible we leave it undocumented.
This has been open for 4 days and there are no more objections. If CI is green I plan to land this. |
There are currently two supported values "none" and "node"
a7b4b27
to
1cb5cea
Compare
landed in bec588f |
BUGFIXES * [`27cccfbda`](npm/cli@27cccfb) [#223](npm/cli#223) vulns → vulnerabilities in npm audit output ([@sapegin](https://github.com/sapegin)) * [`d5e865eb7`](npm/cli@d5e865e) [#222](npm/cli#222) [#226](npm/cli#226) install, doctor: don't crash if registry unset ([@dmitrydvorkin](https://github.com/dmitrydvorkin), [@isaacs](https://github.com/isaacs)) * [`5b3890226`](npm/cli@5b38902) [#227](npm/cli#227) [npm.community#9167](https://npm.community/t/npm-err-cb-never-called-permission-denied/9167/5) Handle unhandledRejections, tell user what to do when encountering an `EACCES` error in the cache. ([@isaacs](https://github.com/isaacs)) DEPENDENCIES * [`77516df6e`](npm/cli@77516df) `[email protected]` ([@isaacs](https://github.com/isaacs)) * [`ceb993590`](npm/cli@ceb9935) `[email protected]` ([@isaacs](https://github.com/isaacs)) * [`4050b9189`](npm/cli@4050b91) `[email protected]` * [#46](npm/hosted-git-info#46) [#43](npm/hosted-git-info#43) [#47](npm/hosted-git-info#47) [#44](npm/hosted-git-info#44) Add support for GitLab subgroups ([@mterrel](https://github.com/mterrel), [@isaacs](https://github.com/isaacs), [@ybiquitous](https://github.com/ybiquitous)) * [`3b1d629`](npm/hosted-git-info@3b1d629) [#48](npm/hosted-git-info#48) fix http protocol using sshurl by default ([@fengmk2](https://github.com/fengmk2)) * [`5d4a8d7`](npm/hosted-git-info@5d4a8d7) ignore noCommittish on tarball url generation ([@isaacs](https://github.com/isaacs)) * [`1692435`](npm/hosted-git-info@1692435) use gist tarball url that works for anonymous gists ([@isaacs](https://github.com/isaacs)) * [`d5cf830`](npm/hosted-git-info@d5cf830) Do not allow invalid gist urls ([@isaacs](https://github.com/isaacs)) * [`e518222`](npm/hosted-git-info@e518222) Use LRU cache to prevent unbounded memory consumption ([@iarna](https://github.com/iarna)) PR-URL: nodejs/node#29023 Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Rich Trott <[email protected]>
This is a super naive copy / paste of the resolution algorithm from upstream, slightly tweaked to work with the internals of the new loader. There is some duplication here, but I've kept it to a minimum.
@ljharb the flag right now is a boolean flag... either the flag is included or isn't. Happy to work on something better, e.g. a no-op flag for other mode or different input type for this flag... but this was enough to get things stared
If anyone wants to make changes to this please feel free to push to the branch. Hopefully this gets us 90% of the way there