Uh oh!
There was an error while loading. Please reload this page.
feat(node-resolve): support pkg imports and export array - #693
Conversation
bda8995 to
ea90365Compare
shellscape
left a comment
There was a problem hiding this comment.
Took me a while to digest all of it, but it looks good to me.
tjenkinson
left a comment
There was a problem hiding this comment.
This wasn’t a thorough review. Just a few things I noticed skimming through.
Looks good though
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ba0262b to
408b700CompareUh oh!
There was an error while loading. Please reload this page.
408b700 to
444cc62Compare
guybedford
left a comment
There was a problem hiding this comment.
Incredible work, thanks again @LarsDenBakker.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ctavan
commented
Dec 9, 2020
@LarsDenBakker just out of curiosity: Did you check the efforts in browserify/resolve#224 ? Could that be re-used? |
@ctavan yes potentially. that PR has been open for a long time though. |
Shouldn’t this logic live in the resolve package? Will you delete this code after resolve implements the exports logic? |
Like I said above... maybe. I think the Note that this PR is an upgrade of functionality that is already in the node-resolve plugin, a PR that I started back in august: #540. At the time I wasn't aware of the work being done in the |
CommonJS‑style |
LarsDenBakker
commented
Dec 12, 2020
@ExE-Boss that's correct, but esm imports have different resolve logic such as no magic |
cf92a06 to
816786dCompareLarsDenBakker
commented
Dec 12, 2020
@shellscape I see that circle CI is failing on a security warning, I suspect that warning is there on master as well. |
ljharb
commented
Dec 13, 2020
@LarsDenBakker |
shellscape
commented
Dec 14, 2020
@LarsDenBakker please pull from upstream/master to fix the audit error in the analysis step. (note that you can create branches directly on this repo now) |
6e7c827 to
fcf26b9CompareLarsDenBakker
commented
Dec 14, 2020
@shellscape done, thanks! My local repo is still configured to use my remote, will update that. |
shellscape
commented
Dec 14, 2020
For those participating; we've had some discussion internally about whether to wait for browserify/resolve to get that PR through, or deliver some value to the userbase immediately and have sided with value for the userbase immediately. We'll revisit these changes when |
ljharb
commented
Dec 15, 2020
@shellscape please do follow that PR; when it lands and is released hopefully you'll be able to refactor to use resolve's implementation. |
lukastaegert
commented
Dec 16, 2020
I think we should do definitely that. While I very welcome delivering this now for Rollup, your/browserify's package has always been an important centerpiece of this plugin and allowed us to have superior performance due to very intelligent directory-lookup caching possibilities. If we can deliver the same functionality we implemented now using |
LarsDenBakker
commented
Jan 8, 2021
@shellscape@lukastaegert is it possible to cut a release of this? |
v11.1.0 is out with fix thanks @guybedford <3 |
Rollup Plugin Name:
node-resolveThis PR contains:
Are tests included?
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers: #670
Description
To fix#670 I started reviewing the algorithm at https://nodejs.org/dist/latest-v15.x/docs/api/esm.html#esm_resolver_algorithm_specification and figured it would be better to implement that more closely.
This PR re-implements the whole package exports feature, basing it on the spec. This fixes the reported bug, and also adds support for the package imports feature defined at https://nodejs.org/api/packages.html#packages_subpath_imports