From 032d28c2d752dacdf5912751ac34915d50a36209 Mon Sep 17 00:00:00 2001 From: Wesley Workman Date: Mon, 25 Jul 2016 17:53:39 -0400 Subject: [PATCH] Moved ember-handlebars-safestring from Pending Features to Deprecated in 2.8. --- source/deprecations/v2.x.html.md | 118 ++++++++++++++++--------------- 1 file changed, 60 insertions(+), 58 deletions(-) diff --git a/source/deprecations/v2.x.html.md b/source/deprecations/v2.x.html.md index 796bcb2f83..7ef84d5ff5 100644 --- a/source/deprecations/v2.x.html.md +++ b/source/deprecations/v2.x.html.md @@ -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 @@ -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. @@ -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: @@ -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).