Step by step migration to ember-cli: use ES6 module syntax


#1

Hi,

I have an app managed by a Gruntfile. I am trying to converge to the structure used by ember-cli projects, and the next step in my list is to refactor all my application modules to ES6 module syntax.

I do not want to perform a full migration since my application is quite big and migrating everything at once will not work. Doing that many changes at once will generate so many errors in so many areas (templates, asset resolution, etc) that I won’t be able to solve them. Instead, I want to tackle the comparatively simpler problem of moving to ES6 module syntax for my application code.

In order to use ES6 module syntax I need:

(This information is taken from the the ember-cli website)

And then I have to refactor my modules and configure the new grunt task. This seems doable, but I have some worries:

The ES6 Module Transpiler is at version v.0.10.0, but it seems that grunt-es6-module-transpiler is only compatible with version older than v.0.5.0, which is quite old (nearly 1 year old). But this problem is also present for the broccoli-es6-concatenator (which is the one used by ember-cli?):

This plugin is deprecated. It uses an old version of es6-module-transpiler.

So here my questions:

  1. Will moving to ES6 module syntax (but staying with grunt) bring me closer to ember-cli? I guess so …
  2. Is ember-cli (via the broccoli-es6-concatenator) indeed using an old version of the ES6 module transpiler (older than v0.5.0)?
  3. Or is ember-cli using another concatenator in order to use a more recent version of the transpiler? Which concatenator? I can not find any information about this.
  4. Can I simply use an old version of the ES6 module transpiler (via the grunt-es6-module-transpiler)? It being old will probably not have any effect in my application code (as long as it supports the minimal features needed by the refactor to ES6 module syntax, which is probably the case)

Thanks,

Daniel Gonzalez


#2

Taking a look at the ember-cli sources, I can answer some of my questions:

  1. Broccoli does not use the es6-module-transpiler anymore.

  2. Broccoli uses broccoli-es6modules which itself uses esperanto

(It seems the link in the ember-cli homepage is outdated: it should point to esperanto and broccoli-es6modules)

I still would like to get some comments to questions 1) and 4)