-
-
Notifications
You must be signed in to change notification settings - Fork 592
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
feat(node-resolve): support pkg imports and export array #693
feat(node-resolve): support pkg imports and export array #693
Conversation
bda8995
to
ea90365
Compare
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.
Took me a while to digest all of it, but it looks good to me.
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.
This wasn’t a thorough review. Just a few things I noticed skimming through.
Looks good though
ba0262b
to
408b700
Compare
408b700
to
444cc62
Compare
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.
Incredible work, thanks again @LarsDenBakker.
@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 |
@ExE-Boss that's correct, but esm imports have different resolve logic such as no magic |
cf92a06
to
816786d
Compare
@shellscape I see that circle CI is failing on a security warning, I suspect that warning is there on master as well. |
@LarsDenBakker |
@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
fcf26b9
Compare
@shellscape done, thanks! My local repo is still configured to use my remote, will update that. |
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 |
@shellscape please do follow that PR; when it lands and is released hopefully you'll be able to refactor to use resolve's implementation. |
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 |
@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-resolve
This 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