Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guide for importing-inject-from-ember-service deprecation #1336

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
19 changes: 19 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,19 @@
---
title: Importing `inject` from `@ember/service`
until: 7.0.0
since: 6.3.0
---

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

Example:

```js {data-filename="my-route.js" data-diff="-2,+3"}
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 @@ -110,6 +110,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
Loading