Why does the ember documentation use ember-cli ES6 syntax?

Learning ember is pretty daunting on its own, there are tons of new concepts and emberisms combined with the fact that most tutorials and guides are out of date.

I feel that using the ES6 syntax which actually requires a preprocessor in the documentation makes things definitely worse. Its pretty hard as a beginner working on a static html ember todo app or when using ember-rails to figure out what the compiled modules actually translate to. Adding an extra layer of abstraction and requiring new users to learn a standard which is not even finished is really frustrating experience.

Reading:

App.ArcticlesController = Ember.Controller.extend({
  queryParams: ['category'],
  category: null
});

is a hell of a lot easier than trying to figure out that this will magically create a ArticlesController.

export default Ember.Controller.extend({
  queryParams: ['category'],
  category: null
});

Why was it decided to change the docs to use the ES6 ember-cli formatting?

Because it’s increasingly difficult to find an Ember developer who doesn’t use CLI, and that’s the path we want to encourage new developers on. The module syntax may appear daunting, but it’s literally only 2 or 3 things. Compared to the challenge of learning enough about Ember to know how to properly structure an app, it’s downright trivial. You may want to check out this thread.

2 Likes

Adding an extra layer of abstraction and requiring new users to learn a standard which is not even finished is really frustrating experience.

But the standard IS finished. While you’re right that it is a bit more to learn, that has to be weighed against learning to do things one way using one of the multiple workarounds to get module-like functionality in ES5, or worse, dealing with multiples of them, then turning around and re-learning to do things the new way. So neither way is perfect, and the Ember team chose to go with the modern way as soon as possible.

Thanks @kylecoberly and @sribe, it makes a lot of sense. I was not aware that ES6 was actually published last month. I have dropped ember-rails and have started out with the CLI now.

1 Like