Skip to content
This repository has been archived by the owner on Mar 22, 2019. It is now read-only.

deprecate Ember.K #2774

Merged
merged 1 commit into from
Dec 26, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions source/deprecations/v2.x.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -858,3 +858,38 @@ Index Content

For more informations of how to use `ember-elsewhere`, please visit the official
documentation [here](https://github.com/ef4/ember-elsewhere#ember-elsewhere).

### Deprecations Added in 2.12

#### `Ember.K`

##### until: 3.0.0
##### id: ember-metal.ember-k

Using `Ember.K` is deprecated in favor of defining a function inline. See [RFC 0178](https://github.com/emberjs/rfcs/blob/master/text/0178-deprecate-ember-k.md).

You can use the addon [ember-watson](https://github.com/abuiles/ember-watson#remove-usages-of-emberk) to automate the removal of `Ember.K` from your application.

Example object:

```js
Ember.Object.extend({
someFun: Ember.K
});
```

Command:

```sh
ember watson:remove-ember-k --empty
```

The result will be:

```js
Ember.Object.extend({
someFun() {}
});
```

If for some reason your app depends on the ability to chain `Ember.K` invocations, you can use the flag `--return-this`. It will replace `Ember.K` with a function that returns `this`.