Re:ECMAScript 2018: final feature set
by akvadrako on Saturday February 03, 2018 @09:20AM
(#16297708)
If you are using babel there is no need for the new browsers to support the new syntax at all.
Re:ECMAScript 2018: final feature set
by always_good on Saturday February 03, 2018 @10:03AM
(#16297861)
Sure there are. For example, your bundle size shrinks when targeting newer browsers because more features exist, fewer need to be polyfilled.
Re:ECMAScript 2018: final feature set
by akvadrako on Saturday February 03, 2018 @11:15AM
(#16298153)
Then you must prepare two bundles, one for new browsers and one for old. I suppose that's possible, but doesn't seem worth it.
You can use <script type=module> to target newer browsers. It’s definitely worth having two bundles because the ES6 and newer is much smaller. And one day, you stop shipping the old ES5 bundle.
Babel can already translate ES2018 async iterators and rest/spread into ES5 code that works pretty much everywhere.