Multiple passes?
See original GitHub issueAre there situations that we might need multiple passes for better minification ?
For example, one plugin might transform
if (a) foo (x) : foo (y);
//to
a ? foo (x) : foo (y)
and another plugin might transform
//to
foo (a ? x : y);
// or even,
x ? foo(a) : foo(b)
//to
foo (x ? a : b)
and another one could remove this as pure expression statement. or modify it differently. I’m not able to think about it.
So the order of plugins in the preset will matter, and we say (with plugins- a and b) the order is a, b
, and another particular transformation might require the order to be b, a
. So, should we explore multiple passes. I’m not sure if this is a problem. Just asking if there are situations that you faced like this.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Multiple Pass Technique - CodePath Cliffnotes
Multiple Pass Technique. Most computations on a list will require O(N) time complexity, so a simple but very useful technique is to pass...
Read more >Multiple passes - BorisTheBrave.Com
Multiple passes are even more powerful once you realize that anything created by the first pass will be used by the second pass....
Read more >multi-pass - Wiktionary
AdjectiveEdit. multi-pass (not comparable). Involving several passes over something. The multi-pass compiler skims the source code looking ...
Read more >Multi-pass compiler - Wikipedia
A multi-pass compiler is a type of compiler that processes the source code or abstract syntax tree of a program several times.
Read more >Are Multiple Passes Necessary for Permanent Data Erasure?
Do we really need multiple passes for wiping hard drives? The answer lies in understanding latest drive technology, global erasure standard, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A brute force solution would be to add a preset option that simply does 2 passes. When I tested this a while ago I also saw that sometimes 3 passes can increase size even more. Not sure how to deal with this. How to strike balance between transformation time and size, where a tiny improvement can cause 2x or 3x longer times.
lets take advantage of the plugin ordering option https://github.com/babel/babel/pull/5735