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

[Bug] when ThisExpression marked as Purish, deadcode plugin will remove arrowy function plugin build result #12306

Closed
SoloJiang opened this issue Nov 4, 2020 · 7 comments · Fixed by #12307
Labels
i: bug i: needs triage i: regression outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@SoloJiang
Copy link

SoloJiang commented Nov 4, 2020

Bug Report

@babel/types @7.12.5:
This pr marked ThisExpression as Purish, it will cause babel-plugin-minify-dead-code-elimination removes @babel/plugin-transform-arrow-functions compiled result.
For example:

<div onClick={() => {
  this.a = 1;
} }></div>

It will be transformed by @babel/plugin-transform-arrow-functions:

var _this = this
<div onClick={function() {
  _this.a = 1;
} }></div>

After this pr, it will be transformed as:

<div onClick={function() {
  this.a = 1;
} }></div>

So, the this will be undefined.

@babel-bot
Copy link
Collaborator

Hey @SoloJiang! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."

@divcris
Copy link

divcris commented Nov 4, 2020

so, @babel/types version I go back to 7.12.1 to temp solve this problem

@xqin
Copy link

xqin commented Nov 4, 2020

Please revoke this version!!!!

@salvoravida
Copy link

please fix it!!

you are breaking CI builds!!!!!

@xqin
Copy link

xqin commented Nov 4, 2020

can we publish new version v7.12.6 as soon as possible?

@nicolo-ribaudo
Copy link
Member

I'll release once CI on main finishes

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Nov 4, 2020

Published as @babel/types@7.12.6!

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Feb 4, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: bug i: needs triage i: regression outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants