Ember 1.0 RC7 Released
Posted By: Peter Wagenet –
We’re pleased to announce the release of Ember 1.0 RC7 today! If all goes smoothly, this will be our penultimate RC before Ember 1.0. This release includes a number of bug fixes and a few small improvements. We’ve got a few other bug fixes in the queue that weren’t quite ready but this release was overdue and we didn’t want to wait. To that end, we expect to release RC8 next week. Read on for more details on what we changed.
Route#controllerFor no longer auto generates controllers
In some cases, people have been relying on
controllerFor to access controllers for routes that have not yet been entered, relying on its auto-generation ability. Unfortunately, this can actually lead to subtle bugs. When entering a route, Ember looks for a controller with a matching name. If that controller isn’t found, Ember generates one according to the type of the route’s model. If the model is an array, we generate an
ArrayController; if it’s an object, an
ObjectController; if neither, a standard
Controller. In most cases, people using
controllerFor outside of the route are not providing a model and Ember will create the basic
Controller. If the route is later entered, the controller will not be re-created and the type of the controller may not match the provided model.
Due to this, we removed the auto-generation abilities of
controllerFor. In most applications, this will not be an issue, but if you were relying on this behaviors, you will need to update your application. If you do have a controller that’s not associated with a route, you should explicitly define the controller's class instead of relying on
Ember’s old router was deprecated prior to the first RC and while it’s never been included in standard RC builds, some users have still been relying on it. Despite this, it’s become time to cut the ties. Increasingly, new features we are adding, especially containers, are incompatible with the old router. Because of this, we’ve removed the old router code from Ember’s repo and you are no longer able to make custom Ember builds with it. We strongly encourage everyone still using the old router to upgrade. However, if anyone is interested in maintaining an old router library independent of the main Ember repo, please let us know.
Update Handlebars version to 1.0.0 — Handlebars 1.0.0 was released almost simultaneously with RC6. Unfortunately, we hadn’t upgraded Ember to support it.
mergedProperties— Similar to
concatenatedPropertiesbut for objects. It merges the properties of the two basic objects into a single object.
templatein favor of
partial— There was a lot of overlap between these two methods. We’ve solidified around
partialand no longer require an underscore-prefixed name.
Update Backburner.js (Ember’s RunLoop) - fixes
Ember.run.debounceactually performed throttling.
debouncenow actually performs a debounce and the thottling behavior has been moved to
Routes can now specify their controller class name with
Ember.Route#disconnectOutlet, to allow for clearing a previously rendered outlet.
Added functionality to Router.map to allow it to be called multiple times without the map being overwritten. Allows routes to be added at runtime.
UPDATE: The post previously recommended the use of
Route#generateController for cases where the controller was not associated with a route. We are now directing users to just explicitly declare the controller's class instead of relying on generation.
comments powered by Disqus