Skip to content
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

Use node's algorithm for calculating the longest matching export/import pattern #49361

Merged

Conversation

weswigham
Copy link
Member

Fixes #49308

Thanks to @PaperStrike for the research and initial tests - in addition to the sort just being backwards, node's sorting for pattern keys (PATTERN_KEY_COMPARE in the resolution docs) is way more complex now that pattern trailers are a thing, and this sort was never updated to account for that, so now we just use node's algorithm pretty much verbatim.

@DanielRosenwasser
Copy link
Member

4.7.3?

@weswigham weswigham merged commit 19b2284 into microsoft:main Jun 2, 2022
@weswigham
Copy link
Member Author

@typescript-bot cherry-pick this to release-4.7

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 2, 2022

Heya @weswigham, I've started to run the task to cherry-pick this into release-4.7 on this PR at fce9115. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

Hey @weswigham, I've opened #49364 for you.

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Jun 2, 2022
Component commits:
fce9115 Use node's algorithm for calculating the longest matching export/import pattern
DanielRosenwasser pushed a commit that referenced this pull request Jun 2, 2022
Component commits:
fce9115 Use node's algorithm for calculating the longest matching export/import pattern

Co-authored-by: Wesley Wigham <wewigham@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reverse imports / exports expanding keys priorities
4 participants