Skip to content
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

Replace babel es2015 preset with env, add babel-runtime #548

Merged
merged 2 commits into from Sep 18, 2017

Conversation

mwiencek
Copy link
Member

The env preset is intended to replace es2015, and is better for us since we can simply specify which browsers we're targeting in .babelrc, and it'll perform the correct transformations automatically (based on the features supported in those browsers).

babel-runtime increases the size of our JS a bit (see the commit for details), but allows us to use async + await, which are essential to sanely work with promises.

This is meant as a replacement for es2015 etc. and offers numerous
advantages. See https://babeljs.io/docs/plugins/preset-env/#usage for
details.
Allows us to use async/await/generator functions, among other things.
See http://babeljs.io/docs/plugins/transform-runtime/.

File size changes (all minified):

with runtime
common - 812K
edit - 268K

without runtime
common - 772K
edit - 264K
@mwiencek
Copy link
Member Author

mwiencek commented Sep 10, 2017

The babel-preset-env part of this patch was a no-op as far as the output goes, as expected (hashes of the JS bundles in root/static/build/ were identical before and after).

@mwiencek mwiencek merged commit 31def17 into metabrainz:master Sep 18, 2017
@mwiencek mwiencek deleted the babel-env branch September 18, 2017 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants