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

Simplify TransitionState resolution system. #306

Merged
merged 6 commits into from
Nov 9, 2020

Conversation

rwjblue
Copy link
Collaborator

@rwjblue rwjblue commented Sep 10, 2020

  • Reduce extraneous promise creation
  • Remove Continuation system (use transition.isAborted directly)

lib/router/route-info.ts Outdated Show resolved Hide resolved
@rwjblue rwjblue force-pushed the refactor-transition-state-resolution branch from e83d0f9 to 2644d95 Compare September 10, 2020 22:24
@rwjblue
Copy link
Collaborator Author

rwjblue commented Sep 10, 2020

Note: I confirmed that Ember's test suite passes with these changes (when linked locally).

@stefanpenner stefanpenner force-pushed the refactor-transition-state-resolution branch from 2644d95 to bc0ef9f Compare November 6, 2020 18:29
@stefanpenner
Copy link
Collaborator

rebased on top of master + tested

// We distinguish between errors that occurred
// during resolution (e.g. before"Model/model/afterModel),
// and aborts due to a rejecting promise from shouldContinue().
wasAborted = true;
return Promise.reject(reason);
}, currentState.promiseLabel('Handle abort'));
throw new Error('Transition aborted');
Copy link
Collaborator

Choose a reason for hiding this comment

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

given e83c782#r518934850 is this else unreachable?

Copy link
Collaborator

Choose a reason for hiding this comment

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

guess this is ultimately removed, so it doesn't matter.

tests/route_info_test.ts Outdated Show resolved Hide resolved
lib/router/route-info.ts Outdated Show resolved Hide resolved
@btecu
Copy link

btecu commented Nov 6, 2020

@stefanpenner I was following the work here and noticed some changes that might be related to this pull request:
emberjs/ember.js#16716

Do you think the issue is in Ember.js or could it be in router.js?

@rwjblue rwjblue merged commit 867f632 into master Nov 9, 2020
@rwjblue rwjblue deleted the refactor-transition-state-resolution branch November 9, 2020 14:57
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.

3 participants