From 8377bbe9473356914e372202c55e981a45806bd8 Mon Sep 17 00:00:00 2001 From: Ricardo Mendes Date: Tue, 26 Sep 2017 09:30:15 +0100 Subject: [PATCH 1/6] Update v2.x.html.md --- source/deprecations/v2.x.html.md | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/source/deprecations/v2.x.html.md b/source/deprecations/v2.x.html.md index fee8e2716d..6f95c89b29 100644 --- a/source/deprecations/v2.x.html.md +++ b/source/deprecations/v2.x.html.md @@ -1039,3 +1039,52 @@ export default Controller { content: alias('model') } ``` + +### Upcoming deprecations + +#### Ember.String#loc + +##### until: 3.0.0 +##### id: ember-string.loc + +Use a localization addon, like ember-i18n or ember-intl + +#### Ember.String#fmt + +##### until: 3.0.0 +##### id: ember-string.fmt + +Use a proper thing. + +#### Ember.String prototype extensions + +##### until: 3.0.0 +##### id: ember-string.prototype_extensions + +`"hello".capitalize()` to `capitalize("hello")`. + + +#### Ember.String imports + +##### until: 3.0.0 +##### id: ember-string.module_api + +``` +ember install @ember/string +``` + +Tired: + +``` +import Ember from 'ember'; + +Ember.String.capitalize("hello"); +``` + +Wired: + +``` +import { capitalize } from '@ember/string'; + +capitalize("hello"); +``` From e9942a1e0375035ac489c8b6dba5d1eb0a0d60b9 Mon Sep 17 00:00:00 2001 From: Ricardo Mendes Date: Tue, 26 Sep 2017 09:32:10 +0100 Subject: [PATCH 2/6] Update v2.x.html.md --- source/deprecations/v2.x.html.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/deprecations/v2.x.html.md b/source/deprecations/v2.x.html.md index 6f95c89b29..3216b630de 100644 --- a/source/deprecations/v2.x.html.md +++ b/source/deprecations/v2.x.html.md @@ -1061,8 +1061,8 @@ Use a proper thing. ##### until: 3.0.0 ##### id: ember-string.prototype_extensions -`"hello".capitalize()` to `capitalize("hello")`. - +a. `"hello".capitalize()` to `capitalize("hello")`. +b. `ember install ember-string-prototype-extensions`. #### Ember.String imports From 0207e74be2446ef6d0cf0ce10a32976197105509 Mon Sep 17 00:00:00 2001 From: Ricardo Mendes Date: Mon, 30 Oct 2017 15:53:51 +0000 Subject: [PATCH 3/6] fix until for Ember.String deprecations --- source/deprecations/v2.x.html.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/deprecations/v2.x.html.md b/source/deprecations/v2.x.html.md index 3216b630de..022a4c6160 100644 --- a/source/deprecations/v2.x.html.md +++ b/source/deprecations/v2.x.html.md @@ -1044,21 +1044,21 @@ export default Controller { #### Ember.String#loc -##### until: 3.0.0 +##### until: 3.5.0 ##### id: ember-string.loc Use a localization addon, like ember-i18n or ember-intl #### Ember.String#fmt -##### until: 3.0.0 +##### until: 3.5.0 ##### id: ember-string.fmt Use a proper thing. #### Ember.String prototype extensions -##### until: 3.0.0 +##### until: 3.5.0 ##### id: ember-string.prototype_extensions a. `"hello".capitalize()` to `capitalize("hello")`. @@ -1066,7 +1066,7 @@ b. `ember install ember-string-prototype-extensions`. #### Ember.String imports -##### until: 3.0.0 +##### until: 3.5.0 ##### id: ember-string.module_api ``` From 8351abd8deb0983ece1af6da78104ee5e043e567 Mon Sep 17 00:00:00 2001 From: Ricardo Mendes Date: Mon, 30 Oct 2017 17:58:47 +0000 Subject: [PATCH 4/6] improve deprecation messages --- source/deprecations/v2.x.html.md | 105 ++++++++++++++++++++++++++----- 1 file changed, 88 insertions(+), 17 deletions(-) diff --git a/source/deprecations/v2.x.html.md b/source/deprecations/v2.x.html.md index 022a4c6160..cf0dd1624f 100644 --- a/source/deprecations/v2.x.html.md +++ b/source/deprecations/v2.x.html.md @@ -1047,14 +1047,9 @@ export default Controller { ##### until: 3.5.0 ##### id: ember-string.loc -Use a localization addon, like ember-i18n or ember-intl +We recommend using a proper localization/internationalization solution. -#### Ember.String#fmt - -##### until: 3.5.0 -##### id: ember-string.fmt - -Use a proper thing. +You can consult a curated list of addons that provide these functionalities in the [Ember Observer Internationalization category](https://emberobserver.com/categories/internationalization). #### Ember.String prototype extensions @@ -1062,29 +1057,105 @@ Use a proper thing. ##### id: ember-string.prototype_extensions a. `"hello".capitalize()` to `capitalize("hello")`. -b. `ember install ember-string-prototype-extensions`. -#### Ember.String imports +b. `ember install ember-string-prototype-extensions`. +#### Ember.String namespace ##### until: 3.5.0 -##### id: ember-string.module_api +##### id: ember-string.html_safe +We are deprecating usage of the utilities under the `Ember.String` namespace. + +This includes: + +* camelize +* capitalize +* classify +* dasherize +* decamelize +* underscore +* loc +* w +* htmlSafe +* isHTMLSafe + +Starting with Ember v2.18.0 [TODO: update to proper version], the `@ember/string` +package was extracted from the Ember codebase into a separate module. +This marks the beginning of the effort to slim down the code that is included by +default in Ember applications. + +You should `ember install @ember/string`. + +##### `camelize`, `capitalize`, `classify`, `dasherize`, `decamelize`, `underscore`, `w` + +Go from: + +```javascript +import Ember from 'ember'; + +Ember.String.camelize("my string") // MyString +Ember.String.capitalize("my string") // My String +Ember.String.classify("my string") // MyString +Ember.String.dasherize("my string") // my-string +Ember.String.decamelize("MyString") // my string +Ember.String.underscore("my string") // my_string + +Ember.String.w("my string") // ``` -ember install @ember/string -``` -Tired: +To: + +```javascript +import { + camelize, + capitalize, + classify, + dasherize, + decamelize, + underscore, +} from '@ember/string' + +camelize("my string") // MyString +capitalize("my string") // My String +classify("my string") // MyString +dasherize("my string") // my-string +decamelize("MyString") // my string +underscore("my string") // my_string +w("my string") // ``` + +##### `Ember.String.htmlSafe` and `Ember.String.isHTMLSafe` + +Go from: + +```javascript import Ember from 'ember'; -Ember.String.capitalize("hello"); +let myString = "my string"; + +Ember.String.htmlSafe(myString) +Ember.String.isHTMLSafe(myString) ``` -Wired: +or: + +```javascript +import { htmlSafe, isHTMLSafe } from '@ember/component'; + +let myString = "my string"; +htmlSafe(myString) +isHTMLSafe(myString) ``` -import { capitalize } from '@ember/string'; -capitalize("hello"); +To: + +```javascript +import { htmlSafe, isHTMLSafe } from '@ember/template'; + +let myString = "my string"; + +htmlSafe(myString) +isHTMLSafe(myString) ``` From 39c5b99ed2e130db1e88ff332b125c53fbe5f814 Mon Sep 17 00:00:00 2001 From: Ricardo Mendes Date: Mon, 30 Oct 2017 18:02:41 +0000 Subject: [PATCH 5/6] move some Ember.String deprecations around --- .ruby-version | 2 +- source/deprecations/v2.x.html.md | 33 +++++++++++++++----------------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.ruby-version b/.ruby-version index 005119baaa..3f684d2d90 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.4.1 +2.3.4 diff --git a/source/deprecations/v2.x.html.md b/source/deprecations/v2.x.html.md index cf0dd1624f..e8e27e7102 100644 --- a/source/deprecations/v2.x.html.md +++ b/source/deprecations/v2.x.html.md @@ -1042,24 +1042,6 @@ export default Controller { ### Upcoming deprecations -#### Ember.String#loc - -##### until: 3.5.0 -##### id: ember-string.loc - -We recommend using a proper localization/internationalization solution. - -You can consult a curated list of addons that provide these functionalities in the [Ember Observer Internationalization category](https://emberobserver.com/categories/internationalization). - -#### Ember.String prototype extensions - -##### until: 3.5.0 -##### id: ember-string.prototype_extensions - -a. `"hello".capitalize()` to `capitalize("hello")`. - -b. `ember install ember-string-prototype-extensions`. - #### Ember.String namespace ##### until: 3.5.0 ##### id: ember-string.html_safe @@ -1159,3 +1141,18 @@ let myString = "my string"; htmlSafe(myString) isHTMLSafe(myString) ``` + +##### `Ember.String.loc` and `import { loc } from '@ember/string'` + +We recommend using a proper localization/internationalization solution. + +You can consult a curated list of addons that provide these functionalities in the [Ember Observer Internationalization category](https://emberobserver.com/categories/internationalization). + +#### Ember.String prototype extensions + +##### until: 3.5.0 +##### id: ember-string.prototype_extensions + +a. `"hello".capitalize()` to `capitalize("hello")`. + +b. `ember install ember-string-prototype-extensions`. From cccc3a0714fa71faf87e56c84655a7f7d6bc838a Mon Sep 17 00:00:00 2001 From: Ricardo Mendes Date: Mon, 30 Oct 2017 18:05:03 +0000 Subject: [PATCH 6/6] rename Ember.String namespace id --- .ruby-version | 2 +- source/deprecations/v2.x.html.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ruby-version b/.ruby-version index 3f684d2d90..005119baaa 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.4 +2.4.1 diff --git a/source/deprecations/v2.x.html.md b/source/deprecations/v2.x.html.md index e8e27e7102..43990278fa 100644 --- a/source/deprecations/v2.x.html.md +++ b/source/deprecations/v2.x.html.md @@ -1044,7 +1044,7 @@ export default Controller { #### Ember.String namespace ##### until: 3.5.0 -##### id: ember-string.html_safe +##### id: ember-string.namespace We are deprecating usage of the utilities under the `Ember.String` namespace.