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

[BUGFIX beta] Make substates great again! #14545

Merged
merged 3 commits into from
Oct 30, 2016

Conversation

trentmwillis
Copy link
Member

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.

Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

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

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();
Copy link
Member

Choose a reason for hiding this comment

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

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();
Copy link
Member

Choose a reason for hiding this comment

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

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();
Copy link
Member

Choose a reason for hiding this comment

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

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();
Copy link
Member

Choose a reason for hiding this comment

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

Same as above (reject with an error + show error message in template)

@trentmwillis
Copy link
Member Author

@rwjblue addressed your comments and moved the tests to a more logical spot in that file.

@trentmwillis
Copy link
Member Author

Also added some tests in ember-engines that pass after introducing the changes in this PR: ember-engines/ember-engines#247

@rwjblue rwjblue merged commit 10857fd into emberjs:master Oct 30, 2016
@rwjblue
Copy link
Member

rwjblue commented Oct 30, 2016

Awesome, thank you!

@trentmwillis
Copy link
Member Author

@rwjblue any chance this could get cherry picked into beta?

@rwjblue
Copy link
Member

rwjblue commented Oct 30, 2016

Yep, done! (was on mobile when I merged originally)

@trentmwillis
Copy link
Member Author

Thanks!

ascudder added a commit to ascudder/ember-crumbly that referenced this pull request Jun 27, 2017
… 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants