Skip to content

Commit

Permalink
Remove ControllerContentModelAliasDeprecation for deprecatingAlias
Browse files Browse the repository at this point in the history
So, this is kind of a fun one.

ControllerContentModelAliasDeprecation was introduced, from what I
could tell, because in the 1.x days of Ember, Controllers had a
`content` property, which `model` was aliased to.
We decided to flip that, and make `model` the source of truth and
`content` the alias.
Problem though, until that flip, if someone overrode `content`,
`model` would break too, hence the addon.

Nowadays, it is now fine to override `content`, and we don't need
to warn anymore that it is deprecated. It is then, time to remove
it. Which I did. Removing code is the best.

We now bumped the deprecation up a notch and made it a deprecating
alias instead, and eventually we will remove the `content` alias.

Here's to removing yet more code in the future, and make Ember
sparkle-clean.
  • Loading branch information
locks committed Jul 22, 2017
1 parent f7f80ca commit 5d684a7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 54 deletions.
2 changes: 1 addition & 1 deletion features.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"ember-views.render-double-modify": "2.0.0",
"ember-routing.router-resource": "2.0.0",
"ember-routing.top-level-render-helper": "2.11.0",
"ember-runtime.controller-content": "2.16.0",
"ember-runtime.controller-proxy": "2.0.0",
"ember-runtime.action-handler-_actions": "2.0.0",
"ember-runtime.enumerable-contains": "2.7.0",
"ember-runtime.will-merge-mixin": "2.0.0",
"ember-runtime.frozen-copy": "2.0.0",
"ember-runtime.freezable-init": "2.0.0",
"ember-string-utils.fmt": "2.0.0",
Expand Down
7 changes: 3 additions & 4 deletions packages/ember-runtime/lib/mixins/controller.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Mixin, alias } from 'ember-metal';
import { deprecatingAlias } from 'ember-runtime';
import ActionHandler from './action_handler';
import ControllerContentModelAliasDeprecation from './controller_content_model_alias_deprecation';

/**
@class ControllerMixin
@namespace Ember
@uses Ember.ActionHandler
@private
*/
export default Mixin.create(ActionHandler, ControllerContentModelAliasDeprecation, {
export default Mixin.create(ActionHandler, {
/* ducktype as a controller */
isController: true,

Expand Down Expand Up @@ -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' })
});

This file was deleted.

0 comments on commit 5d684a7

Please sign in to comment.