-
-
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
Deprecate Controller#content
alias
#15528
Conversation
@@ -44,6 +44,6 @@ export default Mixin.create(ActionHandler, ControllerContentModelAliasDeprecatio | |||
/** | |||
@private | |||
*/ | |||
content: alias('model') | |||
content: deprecatingAlias('model') |
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 will need an options hash with id, until, description, etc
Can you also remove the entry in features.json? |
db79d4f
to
5d684a7
Compare
@rwjblue please re-review and 👀 the commit message for correctness 🙇 |
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.
Looks good. Happy to land when green, but we still need to follow up with the deprecation guide stuff for the newly added deprecation.
@@ -44,6 +44,5 @@ export default Mixin.create(ActionHandler, ControllerContentModelAliasDeprecatio | |||
/** | |||
@private | |||
*/ | |||
content: alias('model') | |||
|
|||
content: deprecatingAlias('model', { id: 'ember-runtime.controller-content', until: '2.16.0' }) |
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.
We also need to add a deprecation guide entry to the website and add a url
property with the link.
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.
deprecation guide PRed: emberjs/website#2969
5d684a7
to
cb71207
Compare
Controller#content
alias
8da30d0
to
5705ec5
Compare
So, this is kind of a fun one. From what I can tell, `ControllerContentModelAliasDeprecation` was introduced, due to Controllers having a `content` property, which `model` was aliased to. This was done because `ObjectController` and `ArrayController` were proxying controllers. But, in Ember, routes set up the `model` property of its respective controller. What this meant is that if someone declared a `content` property in their controller, `model` would—seemingly unrelated—break, hence the `ControllerContentModelAliasDeprecation` mixin. Nowadays it is fine to override `content` because the source of truth was reverse, and `model` is now the primary property, being `content` the alias. It is, then, time to remove the old deprecation and instead deprecate the alias itself, so that in the future users can define a `content` property in their controllers if they so desire. Another API bites the dust. Here's to removing yet more code in the future, and make Ember sparkle-clean.
5705ec5
to
2058272
Compare
ControllerContentModelAliasDeprecation
-related code.Controller#content
alias.deprecatingAlias
.