-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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] Rename private property Route#router to Router#_router #16312
[BUGFIX beta] Rename private property Route#router to Router#_router #16312
Conversation
@Serabe ^ |
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, I think we need to deprecate this.router
in Ember.Route
instances (and add an entry on the website to describe how to handle the deprecation).
When folks inject the router service, it would clobber this "deprecating getter" and things should work just fine...
Working on it |
af3023b
to
f4a28f6
Compare
@rwjblue Done. I considered this a bugfix beta and I added the deprecation in 3.1, but let me know if you prefer it to stay in canary and go in 3.2. |
yeah, lets move to 3.2 on the deprecations app. I don't want to land a last minute deprecation just before release that ends up souring the yummy goodness of 3.1... |
The fact that this private property was named router was preventing user from injecting the router service into routes like this: ```js export default Route.extend({ router: service() }); ``` I consider that the above code is pretty reasonable, and it should be the private property the one that should be renamed to a clearer `_router` name that is less likely to collide with user-defined properties or methods. If you deem this an _intimate_ API we could consider adding a deprecated alias, but I don't have evidence to consider it such, as `router` is too common of a term to search for in emberobserver.
f4a28f6
to
4690f63
Compare
@rwjblue Documented in the new deprecations app in ember-learn/deprecation-app#106 Updated this PR so the URL points to the right anchor in the new app. |
The fact that this private property was named
router
was preventing usersfrom injecting the router service into routes like this:
I consider that the above code is pretty reasonable, and it should be
the private property the one that should be renamed to a clearer
_router
name that is less likely to collide with user-defined properties or methods.
If you deem this an intimate API we could consider adding a deprecated
alias, but I don't have evidence to consider it such, as
router
is toocommon of a term to search for in emberobserver.
Closes #16088