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
Use Babel 6 #6828
Use Babel 6 #6828
Conversation
package.json
Outdated
"bower-config": "^1.3.0", | ||
"bower-endpoint-parser": "0.2.2", | ||
"broccoli-babel-transpiler": "^5.6.2", | ||
"broccoli-babel-transpiler": "6.0.0-alpha.3", |
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.
This is the primary "merge blocker". Need to release as something > .alpha to land (IMO).
module.exports = { | ||
browsers: [ | ||
'ie 9', | ||
'last 1 Chrome versions', |
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.
This is totally outside the scope but here we go:
This matrix is the actual matrix of browsers in which ember itself is tested. I believe that probably safari 9 should be added to ember's test matrix. Arguably today iOS9 is far more relevant than ie9 & 10 combined.
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.
No argument there. In this PR I'm just taking advantage of the new targets, so I refactored to a separate util to avoid duplication.
@@ -0,0 +1,17 @@ | |||
'use strict'; | |||
const presetEnv = require('babel-preset-env').default; |
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.
Should the babel-preset-env live here or can it be part ember-cli-babel?
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.
The idea is that ember-cli-babel is "just" transpiling with the provided config options. I am not really opposed to flip flopping if folks feel strongly...
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.
This was good advice, moved this logic to ember-cli-babel (in emberjs/ember-cli-babel@78b0342).
cbd5447
to
477b2da
Compare
☔ The latest upstream changes (presumably 6eccb8f) made this pull request unmergeable. Please resolve the merge conflicts. |
f891dfb
to
51fda8b
Compare
☔ The latest upstream changes (presumably #6835) made this pull request unmergeable. Please resolve the merge conflicts. |
51fda8b
to
eb435c9
Compare
plugins: [ | ||
// this sucks, but :goodnews: once a new version of babel@6 is released | ||
// we can remove this in favor of `babel-plugin-transform-es2015-modules-amd` | ||
[require('rwjblue-custom-babel-6-amd-modules-no-interop'), { loose: true, noIterop: true }], |
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.
clearly not ideal, but seems ok so that we aren't blocked hard on a release...
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.
cc @hzoo
Things that are done:
This is ready to start reviewing (code wise), I'm still working through a couple test failures ATM though... |
* Updates ember-cli itself to use babel@6. * Removes usages of `options.babel` for internal babel version. * Removes `_pruneBabelOptions` method.
* Use private internal babel options for methods using ember-cli shipped babel transpiler. * Provide babel options based upon ember-cli-babel version (for babel@5 give babel@5 style options, for babel@6 give babel@6 style options). Provide `this.options.babel` based on
* Remove usage of `babel-preset-env`. * Change all "fallback" processing to handle **only** modules.
When using ember-cli-babel@5 use babel@5 options, when using ember-cli-babel@6 no defaults are needed.
Fixes an issue with using babel@6 options when transpiling with babel@5.
791787b
to
fa3af6a
Compare
plugins: [ | ||
// this sucks, but :goodnews: once a new version of babel@6 is released | ||
// we can remove this in favor of `babel-plugin-transform-es2015-modules-amd` | ||
[require('rwjblue-custom-babel-6-amd-modules-no-interop'), { loose: true, noIterop: true }], |
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.
cc @hzoo
The RFC has landed, and ember-cli-babel has been updated to take advantage of it. Having real use cases was the blocker to enabling the feature flag and removing it.
a102fb3
to
2b4ab62
Compare
babel@6.24 includes the required interop changes.
Fixes some bugs.
@homu r+ |
📌 Commit e2a6db2 has been approved by |
⚡ Test exempted - status |
Use Babel 6 This is the starting point for using babel@6 in ember-cli itself and apps. This mostly includes various fallback paths that we have provided that ensure "things are transpiled", without much guarantee about actual transpilation content. It also paves the way for allowing the usage of ember-cli-babel@6 by providing `this.options.babel` as needed based on ember-cli-babel version in use. Utilizes the new `project.targets` to provide custom transpilation configuration based on project targets. --- - [ ] Release final stable version of ember-cli-babel@6 (emberjs/ember-cli-babel#115) - [ ] Release final stable version of ember-cli-htmlbars-inline-precompile for babel@6 support Fixes #5015.
This is the starting point for using babel@6 in ember-cli itself and apps. This mostly includes various fallback paths that we have provided that ensure "things are transpiled", without much guarantee about actual transpilation content.
It also paves the way for allowing the usage of ember-cli-babel@6 by providing
this.options.babel
as needed based on ember-cli-babel version in use.Utilizes the new
project.targets
to provide custom transpilation configuration based on project targets.Fixes #5015.