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

Babel 6.0 #5015

Closed
stefanpenner opened this Issue Oct 30, 2015 · 18 comments

Comments

Projects
None yet
9 participants
@stefanpenner
Contributor

stefanpenner commented Oct 30, 2015

Would like to cut over as soon as possible

npm WARN deprecated babel-core@5.8.33: Babel 5 is no longer being maintained. Upgrade to Babel 6.

  • Migrate ember-cli-babel specific settings out of babel config and into its own ember-cli-babel configuration (with support for older style with a deprecation). This removes one of the "double duties" that the babel config currently takes and should help us traverse the path forward to babel@5 and babel@6 interop. (babel/ember-cli-babel#102)
  • Update ember-cli to require ember-cli-babel for things to function:
    • lib/broccoli/ember-app.js#L1237 - This comment infers something that simply doesn't work anymore. We should likely remove that guard and just throw if we don't detect ember-cli-babel.
  • Update ember-cli-babel to deprecate using the default of "blacklist modules"
    • Change lib/models/addon.js to compile modules. This is used in ember-cli to ensure that we do a two-pass compilation of babel for addons. The first is done by the addon itself, and the second is done by lib/broccoli/ember-app.js#L929.
    • Remove second pass module transpilation in ember-cli's lib/broccoli/ember-app.js.
  • Update ember-cli to use its own specific configuration for modules only babel transpilation instead of utilizing babel config option.
  • Update ember-cli to read and pass through .babelrc in the project and addon root as the default babel options.

@bartocc bartocc referenced this issue Nov 2, 2015

Closed

release plan #5028

8 of 11 tasks complete
@Turbo87

This comment has been minimized.

Show comment
Hide comment
@Turbo87

Turbo87 Jun 9, 2016

Member

@stefanpenner I updated the task list above

Member

Turbo87 commented Jun 9, 2016

@stefanpenner I updated the task list above

@Turbo87 Turbo87 referenced this issue Jun 9, 2016

Closed

Babel 6 #5

@Turbo87 Turbo87 referenced this issue Jun 24, 2016

Closed

Babel 6.0 #62

@knownasilya

This comment has been minimized.

Show comment
Hide comment
@knownasilya

knownasilya Jun 24, 2016

Contributor

Looks like broccoli-babel-transpiler is holding up ember-cli-babel (and emberjs-build), which is holding up ember-cli-htmlbars-inline-precompile.

Any specific reason that broccoli-babel-transpiler is still an alpha version?

Contributor

knownasilya commented Jun 24, 2016

Looks like broccoli-babel-transpiler is holding up ember-cli-babel (and emberjs-build), which is holding up ember-cli-htmlbars-inline-precompile.

Any specific reason that broccoli-babel-transpiler is still an alpha version?

@Turbo87

This comment has been minimized.

Show comment
Hide comment
@Turbo87

This comment has been minimized.

Show comment
Hide comment
@Turbo87

Turbo87 Jun 24, 2016

Member

tl;dr I wasn't that familiar with the code when I started and wanted to make sure the Babel 6 port actually worked before releasing this as an official v6.0.0. Since then I've worked with it a little and haven't found any major issues, so we could release it officially soon.

Member

Turbo87 commented Jun 24, 2016

tl;dr I wasn't that familiar with the code when I started and wanted to make sure the Babel 6 port actually worked before releasing this as an official v6.0.0. Since then I've worked with it a little and haven't found any major issues, so we could release it officially soon.

@stefanpenner

This comment has been minimized.

Show comment
Hide comment
@stefanpenner

stefanpenner Jun 24, 2016

Contributor

@knownasilya its mostly me dragging my heels on reviewing @Turbo87 wonderful PR's

Contributor

stefanpenner commented Jun 24, 2016

@knownasilya its mostly me dragging my heels on reviewing @Turbo87 wonderful PR's

@tchak tchak referenced this issue Aug 19, 2016

Merged

upgrade to use lodash 4.17.2 #22

4 of 9 tasks complete
@mike-north

This comment has been minimized.

Show comment
Hide comment
@mike-north

mike-north Aug 19, 2016

Member

AFAIK this is blocking general use, or some use of WeakMap in apps that target browsers which would need a polyfill.

Member

mike-north commented Aug 19, 2016

AFAIK this is blocking general use, or some use of WeakMap in apps that target browsers which would need a polyfill.

@stefanpenner

This comment has been minimized.

Show comment
Hide comment
@stefanpenner

stefanpenner Aug 19, 2016

Contributor

@mike-north weak-map comes from core-js, it can be included independently of a babel 6 upgrade. Also, this issue is for enabling babel 6 by default, if your add-on continues to emit ES5 safe code, in the form of de-anonymized AMD. The rest of the eco-system wont notice.

Contributor

stefanpenner commented Aug 19, 2016

@mike-north weak-map comes from core-js, it can be included independently of a babel 6 upgrade. Also, this issue is for enabling babel 6 by default, if your add-on continues to emit ES5 safe code, in the form of de-anonymized AMD. The rest of the eco-system wont notice.

@Turbo87

This comment has been minimized.

Show comment
Hide comment
@Turbo87

Turbo87 Dec 5, 2016

Member

Updated the task list above with a set of more concrete steps

/cc @rwjblue

Member

Turbo87 commented Dec 5, 2016

Updated the task list above with a set of more concrete steps

/cc @rwjblue

@runspired

This comment has been minimized.

Show comment
Hide comment
@runspired

runspired Dec 5, 2016

We will need to port our Globals build infrastructure in ember-data to use babel6 as well. If this is moving forward sooner than the next 2 weeks I will not have any time to work on doing this, but likely can after that.

cc @pangratz @igorT @fivetanley @bmac

runspired commented Dec 5, 2016

We will need to port our Globals build infrastructure in ember-data to use babel6 as well. If this is moving forward sooner than the next 2 weeks I will not have any time to work on doing this, but likely can after that.

cc @pangratz @igorT @fivetanley @bmac

@rwjblue

This comment has been minimized.

Show comment
Hide comment
@rwjblue

rwjblue Dec 5, 2016

Contributor

@runspired - The idea is that each addon specifies its own version. It is extremely unlikely that we can move the entire ecosystem over to babel6 at one specific time. So we plan to allow addons to control their babel version via their existing ember-cli-babel dep's version.

Contributor

rwjblue commented Dec 5, 2016

@runspired - The idea is that each addon specifies its own version. It is extremely unlikely that we can move the entire ecosystem over to babel6 at one specific time. So we plan to allow addons to control their babel version via their existing ember-cli-babel dep's version.

@rwjblue rwjblue referenced this issue Dec 5, 2016

Merged

Prevent running babel twice. #6530

5 of 6 tasks complete
@stefanpenner

This comment has been minimized.

Show comment
Hide comment
@stefanpenner

stefanpenner Dec 6, 2016

Contributor

@runspired - The idea is that each addon specifies its own version. It is extremely unlikely that we can move the entire ecosystem over to babel6 at one specific time. So we plan to allow addons to control their babel version via their existing ember-cli-babel dep's version.

yup, this.

Contributor

stefanpenner commented Dec 6, 2016

@runspired - The idea is that each addon specifies its own version. It is extremely unlikely that we can move the entire ecosystem over to babel6 at one specific time. So we plan to allow addons to control their babel version via their existing ember-cli-babel dep's version.

yup, this.

homu added a commit that referenced this issue Dec 7, 2016

Auto merge of #6530 - ember-cli:avoid-two-pass-babel, r=rwjblue
Prevent running babel twice.

We currently transpile the output of all addon's `addon/` trees twice.  Once inside the addon's `treeForAddon` step (this one excludes module transpilation by adding `es6.modules` to babel's blacklist) and the second time in [lib/broccoli/ember-app.js](https://github.com/ember-cli/ember-cli/blob/2df251ce018fd12570bdce72c167ff14a427fa74/lib/broccoli/ember-app.js#L929).

This was originally done because we didn't require that addon's include their own preprocessors for JS (mostly due to performance reasons IIRC).  In the time since that decision was made, we have swapped from a few different systems `es6-module-transpiler` -> `esperanto` -> `babel`.  Now that our module transpilation step is using the same thing as we recommend addon's use (`ember-cli-babel`) what we are doing seems pretty whacky.

This PR removes the double processing of addon's `addon/` files through babel, and includes a deprecation message for the scenario that originally prompted the second pass (where an addon didn't include a module transpiling preprocessor).

TODO:

- [x] Confirm that we have tests that already confirm this is working properly (I believe that our existing nested addon tests cover these changes, but I'd like to confirm).
- [ ] Consider / discuss backporting the deprecation message for addons that do not have a transpiler and are relying on the global processing step.
- [X] Add helpful error if an addon overrides `this.options.babel.compileModules`
- [X] Implement logic to avoid deprecation being added in babel/ember-cli-babel#105.
- [X] Split out `findAddonByName` into a utility method to be shared
- [ ] r?

Addresses parts of #5015
@mdebbar

This comment has been minimized.

Show comment
Hide comment
@mdebbar

mdebbar Feb 14, 2017

@stefanpenner @rwjblue do you have an idea when it would be possible to use babel 6? I'm excited to get several perf. improvements for free with babel 6!
(e.g. https://twitter.com/soprano/status/831588549870784514).

mdebbar commented Feb 14, 2017

@stefanpenner @rwjblue do you have an idea when it would be possible to use babel 6? I'm excited to get several perf. improvements for free with babel 6!
(e.g. https://twitter.com/soprano/status/831588549870784514).

@tschoartschi

This comment has been minimized.

Show comment
Hide comment
@tschoartschi

tschoartschi Feb 28, 2017

@stefanpenner @rwjblue @mdebbar I'm also interested in the status of this issue. Are there any low hanging fruits so we can contribute or is everything already on track and only the hard stuff is left?

tschoartschi commented Feb 28, 2017

@stefanpenner @rwjblue @mdebbar I'm also interested in the status of this issue. Are there any low hanging fruits so we can contribute or is everything already on track and only the hard stuff is left?

@mdebbar

This comment has been minimized.

Show comment
Hide comment
@mdebbar

mdebbar Mar 1, 2017

@stefanpenner @rwjblue I'm also willing to help if there are clear action items to unblock the upgrade.

mdebbar commented Mar 1, 2017

@stefanpenner @rwjblue I'm also willing to help if there are clear action items to unblock the upgrade.

@rwjblue rwjblue referenced this issue Mar 12, 2017

Merged

Use Babel 6 #6828

0 of 2 tasks complete
@rwjblue

This comment has been minimized.

Show comment
Hide comment
@rwjblue

rwjblue Mar 12, 2017

Contributor

ember-cli is being updated to use babel@6 in #6828 (shooting for ember-cli@2.13.0-beta.1 as the first tagged release with this).

ember-cli-babel@6.0.0-beta.2 has been released, and should allow using babel@6 at the app or addon layer even with older ember-cli versions (tested apps and addons using 2.11.1 for example). Please note, that you will likely also have to update ember-cli-htmlbars-inline-precompile to 0.4.0-beta.1 as well.

If folks would like to test either the PR in #6828 or existing apps / addons with ember-cli-babel@6.0.0-beta.2 and ember-cli-htmlbars-inline-precompile@0.4.0-beta.1 and report back that would be great...

Contributor

rwjblue commented Mar 12, 2017

ember-cli is being updated to use babel@6 in #6828 (shooting for ember-cli@2.13.0-beta.1 as the first tagged release with this).

ember-cli-babel@6.0.0-beta.2 has been released, and should allow using babel@6 at the app or addon layer even with older ember-cli versions (tested apps and addons using 2.11.1 for example). Please note, that you will likely also have to update ember-cli-htmlbars-inline-precompile to 0.4.0-beta.1 as well.

If folks would like to test either the PR in #6828 or existing apps / addons with ember-cli-babel@6.0.0-beta.2 and ember-cli-htmlbars-inline-precompile@0.4.0-beta.1 and report back that would be great...

@rwjblue

This comment has been minimized.

Show comment
Hide comment
@rwjblue

rwjblue Mar 13, 2017

Contributor

Obviously, things are still somewhat in flux (and larger breaking changes could happen), but things are looking good for a quickish migration to babel@7 when it is released. I've done some rudimentary tests with babel@7 as well and it should be a much easier migration for us.

Contributor

rwjblue commented Mar 13, 2017

Obviously, things are still somewhat in flux (and larger breaking changes could happen), but things are looking good for a quickish migration to babel@7 when it is released. I've done some rudimentary tests with babel@7 as well and it should be a much easier migration for us.

@homu homu closed this in #6828 Mar 13, 2017

homu added a commit that referenced this issue Mar 13, 2017

Auto merge of #6828 - ember-cli:babel-6-internally, r=rwjblue
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 (babel/ember-cli-babel#115)
- [ ] Release final stable version of ember-cli-htmlbars-inline-precompile for babel@6 support

Fixes #5015.
@backspace

This comment has been minimized.

Show comment
Hide comment
@backspace

backspace Mar 13, 2017

Contributor

I tried to apply the new versions @rwjblue mentioned to travis-web but we use ember-computed-decorators and I couldn’t figure out how to get Babel to accept it, even using babel-plugin-transform-decorators-legacy. But I’m looking forward to this!

Contributor

backspace commented Mar 13, 2017

I tried to apply the new versions @rwjblue mentioned to travis-web but we use ember-computed-decorators and I couldn’t figure out how to get Babel to accept it, even using babel-plugin-transform-decorators-legacy. But I’m looking forward to this!

@rwjblue

This comment has been minimized.

Show comment
Hide comment
@rwjblue

rwjblue Mar 13, 2017

Contributor

I submitted travis-ci/travis-web#983 to show how to do the decorators part. Still looking into what is going on with phantom + babel polyfill...

Contributor

rwjblue commented Mar 13, 2017

I submitted travis-ci/travis-web#983 to show how to do the decorators part. Still looking into what is going on with phantom + babel polyfill...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment