-
-
Notifications
You must be signed in to change notification settings - Fork 735
feat(minifier): fold iife arrow functions in call expressions #16477
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
base: main
Are you sure you want to change the base?
feat(minifier): fold iife arrow functions in call expressions #16477
Conversation
CodSpeed Performance ReportMerging #16477 will not alter performanceComparing Summary
Footnotes
|
| test( | ||
| "function wrapper() { let foo = {}; const bar = (() => { console.log() })(); foo.bar = bar; return foo }", | ||
| "function wrapper() { let foo = {}; return foo.bar = (() => { console.log() })(), foo }", | ||
| "function wrapper() { let foo = {}, bar = (console.log(), void 0); return foo.bar = void 0, foo; }", |
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.
this result is surprisingly longer, but i think this is correct, bar should be removed here
|
i noticed a bug in this implementation |
afa595c to
6d39973
Compare
|
@sapphi-red thank you for running tests issues reported by it should be fixed is there any guide what tests we have to run localy? |
|
Running the tests ran by the CI should be fine. |
|
Conformance tests should not be ok, its interesting that
i'm not sure tho if this is this is the best way to check if we can collapse pife/iife by evaluating ancesotrs and checking if they are i did some cleanup and sorry for keeping it open while it was still WIP |
Improve folding of iife
fixes #13651
details
CallExpressionif they can be collapsedeg. passed as arguments or in assignment
void 0(() => {})()or(function () { })()tovoid 0(c, void 0)(() => { fn() })()to(fn(), void 0)FunctionExpressionis not supported(function () { ... })()notes
FunctionExpressionbut there is no way to trackthisusage, and thus we are unable to minify thischange example
code
currently is collapsed to
and with this change
from what i can see @sapphi-red worked on this file