[BUGFIX beta] Make substates great again!#14545
Conversation
rwjblue
left a comment
There was a problem hiding this comment.
Can you update the various rejects to all reject with a value (preferably with an Error), and add expect counts to the new tests?
I'll try do another pass of review tomorrow or Monday, but this is looking very good. Thank you!
| this.register('template:application_error', compile('Error!')); | ||
| this.register('route:post', Route.extend({ | ||
| model() { | ||
| return RSVP.reject(); |
There was a problem hiding this comment.
Can you reject with an Error and display that errors message in the template??
| this.register('template:error', compile('Error!')); | ||
| this.register('route:post', Route.extend({ | ||
| model() { | ||
| return RSVP.reject(); |
There was a problem hiding this comment.
Same as above (reject with an error + show error message in template)
| this.register('template:post_error', compile('Error!')); | ||
| this.register('route:post', Route.extend({ | ||
| model() { | ||
| return RSVP.reject(); |
There was a problem hiding this comment.
Same as above (reject with an error + show error message in template)
| this.register('template:post.error', compile('Error!')); | ||
| this.register('route:post.comments', Route.extend({ | ||
| model() { | ||
| return RSVP.reject(); |
There was a problem hiding this comment.
Same as above (reject with an error + show error message in template)
0e74704 to
abf1c9d
Compare
|
@rwjblue addressed your comments and moved the tests to a more logical spot in that file. |
|
Also added some tests in ember-engines that pass after introducing the changes in this PR: ember-engines/ember-engines#247 |
|
Awesome, thank you! |
|
@rwjblue any chance this could get cherry picked into beta? |
|
Yep, done! (was on mobile when I merged originally) |
|
Thanks! |
… the app Some of the changes in emberjs/ember.js#14545 are needed to support using the getHandler function in the bread-crumbs.js file.
This PR is a pretty substantial overhaul of the internals for how we handle loading/error substates and routes. This makes it much easier (IMO) to follow what is going on internally.
It also fixes issues with Engines, such as ember-engines/ember-engines#193. To verify, it introduces a slew of new tests and removes some old ones that weren't testing the behavior we actually wanted.