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

Commit

Permalink
Merge pull request #2656 from workmanw/deprecation-2.8-safestring
Browse files Browse the repository at this point in the history
Added ember-handlebars-safestring to Deprecated in 2.8.
  • Loading branch information
rwjblue committed Jul 25, 2016
2 parents e67975b + 032d28c commit 90c7740
Showing 1 changed file with 60 additions and 58 deletions.
118 changes: 60 additions & 58 deletions source/deprecations/v2.x.html.md
Expand Up @@ -535,56 +535,7 @@ See the [guide on computed properties]
(https://guides.emberjs.com/v2.5.0/object-model/computed-properties/) for
further reading.

### Deprecations Added in Pending Features

#### Route#serialize

##### until: 3.0.0
##### id: ember-routing.serialize-function

The `Route#serialize` function was deprecated in favor of passing a `serialize` function into the route's definition in the router map. For more detailed information see the [Route Serializers RFC](https://github.com/emberjs/rfcs/blob/master/text/0120-route-serializers.md).

As an example, given a route like:

```js
// app/routes/post.js
import Ember from 'ember';
export default Ember.Route.extend({
// ...
serialize(model) {
return { post_id: model.id };
}
});

// app/router.js
export default Router.map(function() {
this.route('post', {
path: '/post/:post_id'
});
});
```

You would refactor it like so:

```js
// app/routes/post.js
import Ember from 'ember';
export default Ember.Route.extend({
// ...
});

// app/router.js
function serializePostRoute(model) {
return { post_id: model.id };
}

export default Router.map(function() {
this.route('post', {
path: '/post/:post_id',
serialize: serializePostRoute
});
});
```
### Deprecations Added in 2.8

#### Use Ember.String.htmlSafe over Ember.Handlebars.SafeString

Expand Down Expand Up @@ -655,12 +606,63 @@ If you're an addon maintainer, there is a polyfill for safe string detection ([e
that will help maintain backwards compatibility. Additionally, it's worth noting that `Ember.String.htmlSafe`
is supported back to pre-1.0, so there should be no concerns of backwards compatibility there.
### Deprecations Added in Pending Features
#### Route#serialize
##### until: 3.0.0
##### id: ember-routing.serialize-function
The `Route#serialize` function was deprecated in favor of passing a `serialize` function into the route's definition in the router map. For more detailed information see the [Route Serializers RFC](https://github.com/emberjs/rfcs/blob/master/text/0120-route-serializers.md).
As an example, given a route like:
```js
// app/routes/post.js
import Ember from 'ember';
export default Ember.Route.extend({
// ...
serialize(model) {
return { post_id: model.id };
}
});

// app/router.js
export default Router.map(function() {
this.route('post', {
path: '/post/:post_id'
});
});
```
You would refactor it like so:
```js
// app/routes/post.js
import Ember from 'ember';
export default Ember.Route.extend({
// ...
});

// app/router.js
function serializePostRoute(model) {
return { post_id: model.id };
}

export default Router.map(function() {
this.route('post', {
path: '/post/:post_id',
serialize: serializePostRoute
});
});
```
#### Enumerable#contains
##### until: 3.0.0
##### id: ember-runtime.enumerable-contains
The `Enumerable#contains` and `Array#contains` methods were deprecated in favor of `Enumerable#includes` and `Array#includes`
The `Enumerable#contains` and `Array#contains` methods were deprecated in favor of `Enumerable#includes` and `Array#includes`
to stay in line with ES standards. See [RFC](https://github.com/emberjs/rfcs/blob/master/text/0136-contains-to-includes.md) for details.
`contains` and `includes` have similar behaviors. A notable exception is how `NaN` values are handled.
Expand Down Expand Up @@ -706,9 +708,9 @@ Before:
```js
var arr = ['a', 'b'];

arr.addObject(NaN); // ['a', 'b', NaN]
arr.addObject(NaN); // ['a', 'b', NaN, NaN]
arr.without(NaN); // ['a', 'b', NaN, NaN]
arr.addObject(NaN); // ['a', 'b', NaN]
arr.addObject(NaN); // ['a', 'b', NaN, NaN]
arr.without(NaN); // ['a', 'b', NaN, NaN]
```
After:
Expand All @@ -718,10 +720,10 @@ var arr = ['a', 'b'];

var arr = ['a', 'b'];

arr.addObject(NaN); // ['a', 'b', NaN]
arr.addObject(NaN); // ['a', 'b', NaN]
arr.without(NaN); // ['a', 'b']
arr.addObject(NaN); // ['a', 'b', NaN]
arr.addObject(NaN); // ['a', 'b', NaN]
arr.without(NaN); // ['a', 'b']
```
Added in [PR #13553](https://github.com/emberjs/ember.js/pull/13553).

0 comments on commit 90c7740

Please sign in to comment.