Open iranreyes opened 6 years ago
In one of the IO videos they mentioned that not having transpiled code would not only save on the bundle size (by a lot) but also in some cases more performant with the new language features than their transpiled version.
So it would be really good to implement it. Plus in some of our device matrixes we might not even need the nomodule
tag 😉
in the near future we should still have legacy code, even the device matrix says otherwise.
true true, but it would still be a great performance leap for the modern browsers
modern browsers would not pick up nomodule
.
hm.. okay maybe we misunderstood, I am saying we should split it as described, but I was thinking you say we can go ES6 only, without legacy version for old browsers. My point is to have both. Exactly as in the description.
Google IO Link: https://youtu.be/mIWCLOftfRw?t=7m2s
@wongbsn Could you add here the branch where you were working and what you did?
It's not a surprise we are penalizing the modern browsers with all the polyfills and transpiling.
Currently, we transpile with babel and includes polyfills for the lowest supported browser. If the modern browsers load only a ES2015+ bundle the loading time will be faster because:
Solution:
<script type="module">
.Note: The browsers that support
type="module"
are really modern/green browserstype="module"
Reference: https://philipwalton.com/articles/deploying-es2015-code-in-production-today/