-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix #2230, default identifier renaming issue #2234
Conversation
If we could get a release with this change soon, it will save our team a lot of time :) |
@diervo you're welcome. Shameless plug - Salesforce OS support would look great at https://opencollective.com/rollup :) I don't have publish access, but @lukastaegert should be back today, so we should be able to get this out early this week. |
@guybedford @lukastaegert Yes! I'm working on it ;) I just got approval for babel last month (https://opencollective.com/salesforce), and I'm working for getting rollup as well, keep you updated. Thanks for the quick turn around. |
@diervo that would be amazing, thank you so much for looking into it! |
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.
Looks good!
console.log('effect'); | ||
a = someGlobal; | ||
return a(); | ||
} |
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.
I would remove the console.log
statement as the function call should not be removed even without it. a()
is basically equivalent to someGlobal()
which can have side-effects.
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.
Sure, done.
this.name = identifier.name; | ||
if (this.original !== null) { | ||
this.original.addReference(identifier); | ||
} |
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.
Seems like a good approach! The original logic was probably only in place to provide a better name than the file name to unnamed default exports. If we have an id, using that makes a lot of sense.
06b6204
to
9fbf06a
Compare
jajaja! Dinner is on me! |
This ensures that the name of the default variable is kept as its declaration name for function and class declarations, instead of using reference hints.