Skip to content

Commit

Permalink
Add guide for importing-inject-from-ember-service deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
bertdeblock committed Dec 9, 2024
1 parent f671e3c commit 70dee01
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/templates/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
<li class='list-unstyled' data-test-ember-5-link>
<LinkTo @route='ember' @model='v5.x'>v5.x</LinkTo>
</li>
<li class='list-unstyled' data-test-ember-6-link>
<LinkTo @route='ember' @model='v6.x'>v6.x</LinkTo>
</li>
</ul>
</li>
<li class='item list-unstyled'>
Expand Down
20 changes: 20 additions & 0 deletions content/ember/v6/importing-inject-from-ember-service.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Importing `inject` from `@ember/service`
until: 7.0.0
since: 6.3.0
displayId: importing-inject-from-ember-service
---

Importing `inject` from `@ember/service` is deprecated. Please import `service` instead.

Example:

```diff
import { Route } from '@ember/routing/route';
- import { inject as service } from '@ember/service';
+ import { service } from '@ember/service';

export default class MyRoute extends Route {
@service store;
}
```
2 changes: 2 additions & 0 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ module.exports = function (defaults) {
prember: {
urls: [
'/',
'/v6.x',
'/v5.x',
'/v4.x',
'/v3.x',
'/v2.x',
'/v1.x',
'/ember/v6.x',
'/ember/v5.x',
'/ember/v4.x',
'/ember/v3.x',
Expand Down
1 change: 1 addition & 0 deletions lib/content-docs-generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const contentFolders = [
'ember/v3',
'ember/v4',
'ember/v5',
'ember/v6',
'ember-data/v2',
'ember-data/v3',
'ember-data/v4',
Expand Down
10 changes: 10 additions & 0 deletions tests/acceptance/visual-regression-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ module('Acceptance | visual regression', function (hooks) {

await percySnapshot('ember-5.x');

// v6.x Ember
await click('[data-test-main-deprecations-link]');
await click('[data-test-ember-6-link] > a');

assert
.dom('[data-test-deprecations-added-in]')
.hasText('Deprecations Added in Ember 6.x');

await percySnapshot('ember-6.x');

// Individual page
await visit('/id/ember-polyfills-deprecate-assign');
assert.dom('h1').hasText('Deprecation Guide for Ember.assign');
Expand Down

0 comments on commit 70dee01

Please sign in to comment.