Like everything progressive, particularly in the development world, Ember.js is always evolving. The Ember team and it’s minions are constantly building and tweaking, whittling away at the old to build the new and refine the existing. Each release is an improvement upon the last version, which can mean things like bug fixes, functionality tweaks, syntax changes, deprecation, and removal of features altogether. Some releases are bigger than others, more featured filled, more impactful than the smaller releases. As far as Ember.js goes, Ember 2.0 is the next big thing.

Ember 2.0

On November 3rd, Tom Dale wrote a post in the Ember RFCs called The Road To Ember 2.0. In it, he explains where Ember is heading with the 2.0 release and the map of how they plan on getting there. In it, he outlined some of the key changes that we can expect. The following are, I think, some of the more interesting points.

Stability Without Stagnation

Ember 2.0 comes packed with new features, all built with a focus on “stability without stagnation”, keeping a focus on migration of your apps to the new version without breaking current functionality. The idea behind this is to solve a problem present in a lot of the development world which is having to rewrite code when upgrading the language to a newer version, sometimes rewriting a lot of the logic itself instead of just the syntax, thus potentially introducing bugs. This takes time away from building and refining innovative features and leaves you chasing issues on what was a previously solid codebase. To help with this, they’ll be adding a tab to the Ember Inspector (a developer tool add-on available for Chrome and Firefox) that will list all of the deprecated methods in your application. This will give developers are quick and easy overview of what needs to be changed and save lots of time having to manually scour their code.

Ember CLI & ES6 Modules

Modules are a big thing in coding. They allow developers to make a feature that can be packaged up and reused in other applications. As popular and widely used as JavaScript is, it does not have a built-in module system. In Ember 2.0, they have adopted the ES6 standard for modules and made it a major part of Ember. They have also previously introduced Ember CLI, a command line tool for managing your Ember applications. This will also become a key player in Ember 2.0. Here at Second Street, our head front-end developer Kerrick Long has already begun the process of updating our code to support both of these major features well ahead of the 2.0 release.

Updated View Layer

In 2.0, we’ll see support for HTMLBars, the new templating library that is built on top of Handlebars, which we currently use. HTMLBars will give us easier to understand syntax and more robust features. This is an example of how we currently use Handlebars to insert a dynamic CSS class name:

<div {{bind-attr class=dynamicClassName}}>{{user.name}}</div>

With HTMLBars, we’ll be able to place values where we want them without additional syntax, like this:

<div class="{{dynamicClassName}}">{{user.name}}</div>

This feels natural! Finally, templating that makes sense. They’re also adopting React’s idea of a “virtual DOM”. Instead of looking at the DOM itself, Ember will build a virtual representation of all the necessary elements in the DOM, manipulate those elements with more flexibility and speed, then update the actual DOM accordingly.

Attrs

In the past, parameters for components are treated as properties of the component. This would get confusing, especially for people first looking at a particular project. In Ember 2.0, all of the parameters passed into a component will be available in a new hash called attrs. It's that simple. Pass in whatever params you'd like:

<ss-upload-component autoUpload=true></ss-upload-component>

And then access them in the component like so:

this.attrs.autoUpload

Much more straightforward than having to declare the parameters as properties. Less clutter, simplified use.

Summary

There are many more changes and additions than this, but these were some of the more key elements to me. Looking forward to the release of Ember 2.0 and continuing to make flexible, modular, fast code!