fix for issue #56 - #57
Conversation
|
This is far too simplistic of a fix. We should ignore only the potentially problematic locations, and only if a flag is enabled. |
|
It is simple because an ideal language won't allow any single-statement blocks without braces. It's just confusing. Removing the braces can't make the code much shorter. |
|
We're not talking about an ideal language here. What is the size difference for AngularJS with/without the braces? |
|
Here are some numbers on the current angular.js total size: 949544 Minus the single-statement blocks which already omitted braces, the total saving of removing braces around single statements will be less than 0.23% (counting space), or 0.87% (not counting space). Either way it's negligible. Plus in ES6 braces matter to the semantics, so it's unsound to remove braces. I have also noticed that with the spaceless code generated by codegen, the minifier can only reduce its size by 0.73%. If I turn off RemoveSingleStatementBlocks the reduction is 0.36%. So indeed braces are a large portion to the minifier reduction, but the difference doesn't matter much because the reduction is negligible after removing all the spaces. But any way, I found that I can just skip RemoveSingleStatementBlocks using one of the configurable interfaces, so no need for this pull request. |
No description provided.