-
-
Notifications
You must be signed in to change notification settings - Fork 454
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(transformer): add TraverseCtx::generate_uid
#3394
feat(transformer): add TraverseCtx::generate_uid
#3394
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @overlookmotel and the rest of your teammates on Graphite |
CodSpeed Performance ReportMerging #3394 will degrade performances by 4.53%Comparing Summary
Benchmarks breakdown
|
The semantic benchmarks results are completely spurious. This PR does touch semantic, but only to remove some dead code. |
Yes, the Babel implementation has a lot of room for improvement. I think once most of the plugins are done, we can move in the direction we think is efficient |
panic!("Cannot generate UID"); | ||
} | ||
|
||
fn name_is_unique(&self, name: &str) -> bool { |
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.
Add comment: this goes through the whole symbol table
Add
TraverseCtx::generate_uid
method.This is modelled on Babel's
scope.generateUid()
method. As discussed in #3251 (comment), this is required to fix most of the remaining failing tests in transformer Milestone 1.I have implemented this to work as closely as possible to Babel, so that it will generate same output as Babel for our tests. However, as mentioned in the code comments, this means it's a pretty expensive function to call. Those code comments suggest 2 ways in which we could make it much more efficient, but we'd need to decide how we're going to handle divergence from Babel before we can decide which route to go.
I've left it as a
TODO(improve-on-babel)
for now.