-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Initial usage of ES6 features #15764
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
Conversation
99827f4 to
0346d1c
Compare
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.
Interesting!
The main question for me here is closure. Closure advanced opts are fairly slow, as we know (though very much worth it!) - how fast is closure transpilation? We would be forcing people to use closure if they support older browsers, so an idea of the cost would be good.
Hopefully it's fast enough. Faster than other transpilation tools (Babel) would be good enough I think.
emcc.py
Outdated
| settings.TRANSPILE = (settings.MIN_FIREFOX_VERSION < 44 or | ||
| settings.MIN_CHROME_VERSION < 49 or | ||
| settings.MIN_SAFARI_VERSION < 11000 or | ||
| settings.MIN_IE_VERSION != 0x7FFFFFFF) |
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.
What about Edge?
3213444 to
af6ba01
Compare
With this change we allow these features by default. If a user explicitly opts into older browser support we trigger the running of closure compiler with `--language_out ES5 --compilation_level WHITESPACE_ONLY`. For most users this will be a code size win, but otherwise a no-op. For users who need older browser support they will now have their output run though closure by default. If they want to take a care of the transpilaion process themselves rather than have emscripten to it auto-magically they can run with `--closure=0`. When we auto-magically run closure to do transpilation we generate a warning. This warning can be suppressed by add `--closure=1` to explicitly opt in, or `--closure=0` to explicitly opt out. This change in does not actually include any usage of these features and so don't include the code size benefits. Those will be part of followup PRs. Fixes: #11984
af6ba01 to
1a9d0b5
Compare
fe16954 to
bc31c66
Compare
This a followup to #15763 which actually starts to use
some ES6 features in our core library code.
This change is designed to demonstrate that code size
wins that we can get from ES6 usage.
See: #11984