-
Notifications
You must be signed in to change notification settings - Fork 19
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
Proof of concept for terminal forwarding #1
base: master
Are you sure you want to change the base?
Conversation
@@ -15,6 +15,16 @@ export function initialize(application) { | |||
} | |||
}); | |||
|
|||
Ember.Router.reopen({ | |||
willTransition(a,b,intent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spaces here.
Writing some documentation: The use-case for specifying a terminal route is _not_ to prevent us from having to create a route whose content is simply: beforeModel() {
this.replaceWith('non-terminal.sibling');
} The goal is instead to make sure that redirects of this nature which are not dynamic can easily be identified and accounted for in other tools such as ember-prefetch. |
Looking at
Which means that we can't prevent things like |
let terminal = intent.targetName.substr(13); | ||
this.replaceWith(terminal); | ||
} | ||
this._super.apply(this, arguments); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we might be able to get away with manually passing forward the new transition
from line 22 into _super
as long as we're 100% certain that this is the first reopen
.
/cc @nickiaconis
This PR adds an option that allows declaring a route to be an invalid terminal state, while also declaring what route should actually be visited if someone tries to visit as the terminal route.
TODO: