From 490fc80a6663da5d8ac7c7b62b5d92323203b82f Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Thu, 19 Aug 2021 21:17:49 -0500 Subject: [PATCH 1/3] Implicit injection deprecations for v4.0.0 --- content/ember/v4/deprecate-implicit-injection.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 content/ember/v4/deprecate-implicit-injection.md diff --git a/content/ember/v4/deprecate-implicit-injection.md b/content/ember/v4/deprecate-implicit-injection.md new file mode 100644 index 00000000..fd99a188 --- /dev/null +++ b/content/ember/v4/deprecate-implicit-injection.md @@ -0,0 +1,8 @@ +--- +id: implicit-injections +title: "Implicit Injections" +until: '5.0.0' +since: '4.0.0' +--- + +Implicit injections have been [deprecated](https://deprecations.emberjs.com/v3.x#toc_implicit-injections) since Ember v3.26.0. As of v4.0.0, implicit injections do nothing and should be removed based on suggestions in the original deprecation. From 0d7f2332b4816da1155c3effc7d1ca54575f4a57 Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Sat, 21 Aug 2021 20:29:12 -0500 Subject: [PATCH 2/3] add before examples --- .../ember/v4/deprecate-implicit-injection.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/content/ember/v4/deprecate-implicit-injection.md b/content/ember/v4/deprecate-implicit-injection.md index fd99a188..bcc06a89 100644 --- a/content/ember/v4/deprecate-implicit-injection.md +++ b/content/ember/v4/deprecate-implicit-injection.md @@ -6,3 +6,40 @@ since: '4.0.0' --- Implicit injections have been [deprecated](https://deprecations.emberjs.com/v3.x#toc_implicit-injections) since Ember v3.26.0. As of v4.0.0, implicit injections do nothing and should be removed based on suggestions in the original deprecation. + +Before: + +```js +export default { + initialize(app) { + app.inject('route', 'store', 'service:store'); + } +} +``` + +```js +import { Route } from '@ember/routing/route'; + +export default class ApplicationRoute extends Route { + model() { + return this.store.findQuery('user', 123); + } +} +``` + +After: + +```js +import { Route } from '@ember/routing/route'; +import { inject as service } from '@ember/service'; + +export default class ApplicationRoute extends Route { + @service store; + + model() { + return this.store.findQuery('user', 123); + } +} +``` + +For a more detailed explanation with additional examples, see the old deprecation [guides](https://deprecations.emberjs.com/v3.x#toc_implicit-injections). \ No newline at end of file From 97aa177703288ed9849109e88b3e61cd2bd13d1b Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Sun, 22 Aug 2021 14:04:52 -0500 Subject: [PATCH 3/3] call out 3.26 --- content/ember/v4/deprecate-implicit-injection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/ember/v4/deprecate-implicit-injection.md b/content/ember/v4/deprecate-implicit-injection.md index bcc06a89..258d51a9 100644 --- a/content/ember/v4/deprecate-implicit-injection.md +++ b/content/ember/v4/deprecate-implicit-injection.md @@ -42,4 +42,4 @@ export default class ApplicationRoute extends Route { } ``` -For a more detailed explanation with additional examples, see the old deprecation [guides](https://deprecations.emberjs.com/v3.x#toc_implicit-injections). \ No newline at end of file +For a more detailed explanation with additional examples, see the 3.x deprecation [guides](https://deprecations.emberjs.com/v3.x#toc_implicit-injections). \ No newline at end of file