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

Deprecate Controller#content alias #15528

Merged
merged 1 commit into from
Aug 3, 2017
Merged

Deprecate Controller#content alias #15528

merged 1 commit into from
Aug 3, 2017

Conversation

locks
Copy link
Contributor

@locks locks commented Jul 19, 2017

  • Removes ControllerContentModelAliasDeprecation-related code.
  • Deprecates the Controller#content alias.

@@ -44,6 +44,6 @@ export default Mixin.create(ActionHandler, ControllerContentModelAliasDeprecatio
/**
@private
*/
content: alias('model')
content: deprecatingAlias('model')
Copy link
Member

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

@rwjblue
Copy link
Member

rwjblue commented Jul 19, 2017

Can you also remove the entry in features.json?

@locks locks force-pushed the controller-content-mixin branch from db79d4f to 5d684a7 Compare July 22, 2017 02:30
@locks
Copy link
Contributor Author

locks commented Jul 22, 2017

@rwjblue please re-review and 👀 the commit message for correctness 🙇

Copy link
Member

@rwjblue rwjblue left a 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' })
Copy link
Member

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.

Copy link
Contributor Author

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

@locks locks force-pushed the controller-content-mixin branch from 5d684a7 to cb71207 Compare July 31, 2017 01:25
@locks locks changed the title Delete controller_content_model_alias_deprecation.js Deprecate Controller#content alias Jul 31, 2017
@locks locks force-pushed the controller-content-mixin branch 5 times, most recently from 8da30d0 to 5705ec5 Compare July 31, 2017 09:11
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.
@locks locks force-pushed the controller-content-mixin branch from 5705ec5 to 2058272 Compare August 1, 2017 09:46
@locks locks merged commit 9b8f04d into master Aug 3, 2017
@locks locks deleted the controller-content-mixin branch August 3, 2017 17:19
@locks locks restored the controller-content-mixin branch August 3, 2017 17:19
@locks locks deleted the controller-content-mixin branch August 3, 2017 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants