Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE ember-routing-loading-error-substates] Named substate entry #3655

Merged
merged 2 commits into from
Nov 1, 2013

Conversation

machty
Copy link
Contributor

@machty machty commented Oct 27, 2013

EDIT:

I ended up splitting this PR into two commits; a beta BUGFIX and a new feature. The Feature will be for 1.3, the bugfix should be merged into beta ASAP. Please read the individual commit messages for what's been changed.

@machty
Copy link
Contributor Author

machty commented Oct 28, 2013

Demonstration of top level error/loading states (3):

http://jsbin.com/ucanam/1711/edit

@wagenet
Copy link
Member

wagenet commented Oct 29, 2013

At a glance this seems ok.

@wagenet wagenet closed this Oct 29, 2013
@wagenet wagenet reopened this Oct 29, 2013
@wagenet
Copy link
Member

wagenet commented Oct 29, 2013

D'oh, wrong button.

This is for the `ember-routing-loading-error-substates`
feature. The `loading` action will now always bubble
to `ApplicationRoute`; the logic for preventing substate
entry into a substate above the pivot route has been
moved default action handlers that live "above"
`ApplicationRoute`. /cc krisselden
- When looking for an appropriate substate to enter, the router will
first try and find a loading substate sibling with the name of
router that the error/loading action emanated from, e.g. if foo
route returns a slow promise and both foo_loading and loading
routers have been defined (via route class or template), the
foo_loading substate will be preferred and entered over plain ol'
loading, whereas a slow promise from 'bar' route would enter
the more generalized 'loading' route (assuming 'bar_loading' route
wasn't defined)

- Top-level error/loading substates can now be entered. They are
top-level, which means they get rendered as siblings to
ApplicationView vs within ApplicationView's outlet. This
handles slow/rejecting promises returned from ApplicationRoute.
If a route class/template corresponding to 'application_error'
or 'application_loading' is found, it will be entered. This
may seem like a special-casing of the substate naming conventions,
but is actually consistent with the useful rule established in
(2) above: Ember will say "ok, slow/rejecting promise came from
the 'application' route, let's check if a specifically named
'error' or 'loading' substate exists for it and enter it if so".
The only special-casing is that it won't go to the second step
of generalizing and looking for routes named specifically
'loading'/'error' to enter, since that corresponds to child
substates of the internal this.resource('application')
@machty
Copy link
Contributor Author

machty commented Nov 1, 2013

As discussed, I've split this into two commits, one beta bugfix and one new feature.

machty added a commit that referenced this pull request Nov 1, 2013
[FEATURE ember-routing-loading-error-substates] Named substate entry
@machty machty merged commit cf43a8c into emberjs:master Nov 1, 2013
@stefanpenner stefanpenner mentioned this pull request Jan 3, 2014
8 tasks
@tomdale
Copy link
Member

tomdale commented Jan 31, 2014

We are all very excited about this feature, but don't feel comfortable with the naming conflict in globals mode. At the core team meeting, we decided that we need to defer merging this in until we have some way of internally detecting whether the Ember app is in "globals" mode or "modules" mode, and only opt-in to this behavior in the modules case.

Action Item: Me and @stefanpenner are going to discuss how to handle module mode + new semantics next week.

@rwjblue rwjblue mentioned this pull request Feb 12, 2014
@@ -403,9 +403,10 @@ if (Ember.FEATURES.isEnabled("ember-routing-loading-error-substates")) {
App.MomSallyRoute = Ember.Route.extend({
model: function() {
step(1, "MomSallyRoute#model");
throw {

return Ember.RSVP.reject({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yuno reject with error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't need to strictly be Error to invoke the behavior being tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants