First of core face-to-face proposals:
Right now the behavior of model hook resolution when transitioning into a nested route is that a parent route’s model hooks must fully resolve before the child route even begins resolving (and having its model
hooks called). This is certainly the safest, most consistent way of resolving models, and it makes sense for this to remain the default, but it means that you can’t (easily) simultaneously resolve models hooks without adopting weird unwieldy patterns, which means even if you have all the information up front to fire all the requests right away (from the url), you are still somewhat forced to sequentially fire these requests.
So, proposal is simple enough: expose a boolean flag on Ember.Route
, perhaps called eagerResolve
, that essentially tells the router: “don’t wait for my parent route to resolve before attempting to resolve me”
App.EagerRoute = Ember.Route.extend({
eagerResolve: true,
model: function() {
// this gets called even before the parent
// of EagerRoute gets resolved
}
});
There are some questions about how error handling works in this case but it seems like the solutions to each of these aren’t going to be too surprising or too crazy challenging to implement.
Thoughts?