Comments:"Ember.js - Ember 1.0 RC4"
URL:http://emberjs.com/blog/2013/05/28/ember-1-0-rc4.html
Posted By: Tom Dale – May 28, 2013
Announcement
We have noticed a performance regression, a debug flag was left on by mistake. So if you really want the goodness of RC4 without this regression use this build, we'll have an official release out soon.
Today, we are pleased to announce Ember.js 1.0 RC4:
This RC4 release of Ember puts us very close to the final 1.0 release.
Ember.js 1.0 RC4
As we approach 1.0 final, our focus continues to be on bugfixes, performance, and reliability.
BREAKING CHANGE: Controller/Model Setup
One of the roles of Route
objects in an Ember application is to tell
controllers which model they should represent.
By default, the object that you return from a route's model
hook is
set as the model
property on the corresponding controller. So, for
example, if you have this route:
The array returned from model
would be set as the model
property of
the App.PhotosController
. This tells the controller that it should
present that model to its template.
What if you need to set up additional controllers, beyond the primary
controller associated with that route? In that case, you can implement
the setupController
hook:
This is all well and good, but what if you wanted to prevent a model
from being set on the PhotosController
at all?
In RC3, preventing this default behavior was impossible. In RC4,implementing the setupController
hook prevents the default behavior
from happening. This is a potentially breaking change.
If your route implements the setupController
hook and you want to
preserve default behavior, make sure you call _super()
from within
the hook:
Thanks to Kris Selden and Luke Melia for pulling together PRs from Paul Chavard, Rob Harper and input from others into a cohesive change. We don't take breaking changes lightly at this stage of the release process, but this one is worthwhile.
RSVP 2.0
Ember now embeds version 2.0 ofRSVP.js, a microlibrary forPromises/A+ compatible promises.
All of the Ember.js APIs that return promises use this library to ensure compatible behavior.
A big, big thanks to Stefan Penner for all of his work on improving the promises story across both Ember and Ember Data.
Run Loop Extracted to Backburner.js
Erik Bryn has extracted the run loop into theBackburner.js microlibrary, which Ember now uses.
This will allow other frameworks and libraries that use Backburner to benefit from using a deferred event queue, and hopefully we can share our work to make the web platform faster for everyone.
Handlebars RC4 Compatibility
Ember.js RC4 requires the latest release of Handlebars, which is also at RC4.
Improved Route Redirection
Routes provide a redirect
hook that allow them to conditionally redirect to
a different route. For example, you may redirect the user to a login
route if you detect that they do not have an authentication token saved.
Many improvements to the redirect
hook have been made to make it more
reliable. Additionally, you can now implement this hook in theApplicationRoute
, which previously would not work.
Props to Tom Dale for this work.
linkTo now generates routeTo events
Previously, the {{linkTo}}
helper caused the router to transition without
any hooks to affect that behavior. Thanks to the work of Alex Matchneer,
the {{linkTo}}
helper now generates a routeTo event that can be handled
just like any other event in a controller or a route's events
object. The
default behavior of transitioning to the specified route remains unchanged.
ember-testing Improvements
The ember-testing
package, included in Ember.js, is the
officially-supported library for writing unit and integration tests for
Ember apps. Introduced in RC3, this has continued to be improved, with
many bug fixes and performance improvements landing in RC4.
A huge thanks to Teddy Zeeny for driving many of these improvements.
disabledWhen
{{linkTo}} Option
The {{#linkTo}}
Handlebars helper now has a disabledWhen
option that
can be bound to conditionally disable a link:
Thanks to Trek Glowacki for this improvement.
Please enable JavaScript to view the comments powered by Disqus.comments powered by Disqus