-
-
Notifications
You must be signed in to change notification settings - Fork 772
feat(minifier): compress single consequence if statement. #6266
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(minifier): compress single consequence if statement. #6266
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “0-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. |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
|
||
| // Try it out with properties and methods | ||
| fold("function f(){if(x){a.b=1}}", "function f(){if(x)a.b=1}"); | ||
| fold("function f(){if(x){a.b=1}}", "function f(){x&&(a.b=1)}"); |
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.
REPL here.
| // fold("function f(){if(x){if(y)foo();else bar()}}", "function f(){x&&(y?foo():bar())}"); | ||
| // fold("function f(){if(x){if(y)foo()}else bar()}", "function f(){x?y&&foo():bar()}"); | ||
| // fold( | ||
| // "function f(){if(x){if(y)foo();else bar()}else{baz()}}", | ||
| // "function f(){x?y?foo():bar():baz()}", | ||
| // ); |
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.
Currently I didn't support handling the BlockStatement.
CodSpeed Performance ReportMerging #6266 will degrade performances by 42.89%Comparing Summary
Benchmarks breakdown
|
6a0825b to
f1f0819
Compare
e4fcd01 to
37cbabb
Compare
f1f0819 to
d507f18
Compare
|
Stale. Maybe we can find a better way to handle this. |

Seems that the
gzipis so metaphysical... I don't know why it enlarges the gzipped size.