-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
Deprecate transition methods of Controller and Route #674
Deprecate transition methods of Controller and Route #674
Conversation
text/0000-deprecate-transition-methods-of-controller-and-route.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Tobias Bieniek <[email protected]>
will make the required refactoring of router easier as soon as the methods | ||
have been removed. | ||
|
||
The router is known to be bad documented and underspecified. Especially timing |
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.
The router is known to be bad documented and underspecified
😭 this is painful to read but... it is not wrong 😩
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.
Overall, I'm 👍 here. I think we should also update the prose to account for ember-engines, which has a custom method for this stuff (transitionToExternal
).
Hello @rwjblue. Thanks a lot for your review.
To be honest I don't have much experience with Ember Engines. So not sure what would be the best transition path for Deprecating these methods as well seems to fit best with the attend of this RFC. But it seems as if something similar to router service is still missing for Ember Engines: ember-engines/ember-engines#587 There is an pull request to implement a Do you think this RFC must cover Ember Engines? Or would it be enough to add something like this to drawbacks section:
|
Ya, I do think we should mention it as well, but I agree that the details are not this specific RFCs problem. Maybe you could add a small blurb to mention |
Thank you @jelhan! |
text/0000-deprecate-transition-methods-of-controller-and-route.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Chris Ng <[email protected]>
text/0000-deprecate-transition-methods-of-controller-and-route.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Lloyd Smith <[email protected]>
- https://github.com/emberjs/ember.js/issues/11152 | ||
- https://github.com/emberjs/ember.js/issues/12945 | ||
- https://github.com/emberjs/ember.js/issues/14875 | ||
- https://github.com/emberjs/ember.js/issues/15801 |
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.
This issue describes a bug with the Router service's transitionTo method. As a workaround for the issue, you can use the Route/Controller's transitionTo. Is this bug going to be fixed as part of this deprecation? Otherwise, we are stuck between using a deprecated API or having a buggy experience.
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.
Yes, we need to fix this before the deprecation goes in. @rwjblue is actively working on this per @krisselden.
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 came here to mention something similar. There have been multiple cases that we have run into where it's not possible to replace a use of route.transitionTo
with the RouterService
's transitionTo
. I'll have to go digging to find the details but they have been related to query params.
I remember at the time I last ran into it reading the RouterService RFC and being convinced by the "Query Parameter Semantics" section that this was by design:
Today, queryParams impose unnecessarily high cost because we cannot generate URLs or determine if a link is active without taking into account the default values of query parameters. Determining their default values is expensive, because it involves instantiating the corresponding controller, even in cases where we will never visit its route.
Therefore, the queryParams argument to the newurlFor
,transitionTo
,replaceWith
, andisActive
methods defined in this document will behave differently.
I take that to mean that RouterService.transitionTo
will never be a drop in replacement for router.transitionTo
. If this is true then should these edge cases be acknowledged in the "Transition path" section of this RFC?
We discussed this in the core team meeting today and we've decided to move it into Final Comment Period. Thanks for submitting this RFC, @jelhan! |
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.
Some frontmatter house keeping.
text/0000-deprecate-transition-methods-of-controller-and-route.md
Outdated
Show resolved
Hide resolved
text/0000-deprecate-transition-methods-of-controller-and-route.md
Outdated
Show resolved
Hide resolved
text/0000-deprecate-transition-methods-of-controller-and-route.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Ricardo Mendes <[email protected]>
Thank you for the “How we teach this” audit of learning materials. I think this depreciation will be helpful because we don’t need to teach as many things to beginners. That seems like a win to me. |
@jelhan Thank you for working on writing the proposal. From the perspectives of a new learner and a contributor to the Ember Guides, I agree that it will be good to simplify how a route transition is to occur from controllers and routes. Today, I was able to spend half an hour on updating the syntax I did encounter several instances of
|
Rendered