Skip to content

Conversation

@guybedford
Copy link
Contributor

@guybedfordguybedford commented Aug 12, 2020

This extracts just the resolver refactoring component from #34718.

I hope that the negative diff speaks for itself at least!

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-botnodejs-github-bot added errors Issues and PRs related to JavaScript errors originated in Node.js core. esm Issues and PRs related to the ECMAScript Modules implementation. labels Aug 12, 2020
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Aug 12, 2020

Review requested:

  • @nodejs/modules

@guybedfordguybedford changed the title module: exports patterns and resolver refactoringmodule: CJS / ESM resolver sharing and refactoringAug 12, 2020
@guybedfordguybedford mentioned this pull request Aug 12, 2020
4 tasks
@ljharb
Copy link
Member

Wait, so now you can map your exports to things in node_modules?? Can you help me understand why that's a good idea?

@guybedford
Copy link
ContributorAuthor

Sure, I can add it back, it's just that the spec was actually incorrect since it was only checking the package.json target path, when we in fact need to check both the target path and the user subpath. We give separate errors for these two cases because the one is package author issue while the other is a package consumer issue. This error separation doesn't apply as easily for patterns though so those errors may need to be rethought. I refactored it out because it seems overly strict and unnecessary but I can add it back.

@ljharb
Copy link
Member

I think it's very critical that "exports" only be possible to use to remap an entry specifier to "a file within the package that has exports".

@guybedford
Copy link
ContributorAuthor

@ljharb I've added back the node_modules restriction identically to previously with a refactoring to make it part of the new segment check approach.

@guybedford
Copy link
ContributorAuthor

I would like to land this PR soon. Any further feedback welcome.

@guybedford
Copy link
ContributorAuthor

@nodejs/modules-active-members for any further review

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

guybedford added a commit that referenced this pull request Aug 13, 2020
PR-URL: #34744 Reviewed-By: Jan Krems <[email protected]> Reviewed-By: James M Snell <[email protected]>
@guybedford
Copy link
ContributorAuthor

Landed in f8976a7.

addaleax added a commit to addaleax/node that referenced this pull request Aug 13, 2020
MylesBorins pushed a commit that referenced this pull request Aug 17, 2020
PR-URL: #34744 Reviewed-By: Jan Krems <[email protected]> Reviewed-By: James M Snell <[email protected]>
@danielleadamsdanielleadams mentioned this pull request Aug 20, 2020
BethGriggs pushed a commit that referenced this pull request Aug 20, 2020
PR-URL: #34744 Reviewed-By: Jan Krems <[email protected]> Reviewed-By: James M Snell <[email protected]>
guybedford added a commit to guybedford/node that referenced this pull request Sep 28, 2020
codebytere pushed a commit that referenced this pull request Oct 1, 2020
PR-URL: #34744 Backport-PR-URL: #35385 Reviewed-By: Jan Krems <[email protected]> Reviewed-By: James M Snell <[email protected]>
@codebyterecodebytere mentioned this pull request Oct 4, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

errorsIssues and PRs related to JavaScript errors originated in Node.js core.esmIssues and PRs related to the ECMAScript Modules implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@guybedford@nodejs-github-bot@ljharb@jasnell@hybrist@addaleax