fix: deconflict for duplicate canonical names#365
Merged
Conversation
Member
Author
underfin
reviewed
Nov 22, 2023
| }; | ||
| while self.used_canonical_names.contains(&canonical_name) { | ||
| *count += 1; | ||
| canonical_name = Cow::Owned(format!("{}${}", original_name, *count).into()); |
Contributor
There was a problem hiding this comment.
The fix can be work, but it isn't efficient at some cases. If the scope has a/a$1/a$2 symbols declared. The fix will caused a/a$1/a$2 every symbol need rename. Please read the esbuild implementiontion, it will only rename once a -> a$3.
Member
Author
There was a problem hiding this comment.
From my point of view, it's efficient enough. Feel free to open a team meeting for this.
Contributor
There was a problem hiding this comment.
I remember we need to follow esbuild implementation, it will reduce our different ideas.
Contributor
There was a problem hiding this comment.
Here has lots of issue need to merge, I just approved it. I open a new issue to track this #389.
hyfdev
force-pushed
the
11-22-fix_deconflict_for_duplicate_canonical_names
branch
from
November 23, 2023 04:57
146e192 to
454e905
Compare
This was referenced Nov 23, 2023
Merged
underfin
approved these changes
Nov 25, 2023
Boshen
deleted the
11-22-fix_deconflict_for_duplicate_canonical_names
branch
November 27, 2023 03:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Fixes #364
Test Plan