Skip to content

Commit 7f3cb7c

Browse files
Merge branch 'main' into fix-width-fix-no-code-doc
2 parents e52ed03 + 5d3bd1e commit 7f3cb7c

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: Store will no longer extend EmberObject in 6.0
3+
until: '6.0'
4+
since: '5.4'
5+
displayId: ember-data:deprecate-store-extends-ember-object
6+
---
7+
8+
The Store class extending from EmberObject is deprecated and the class will no
9+
longer extend from EmberObject in 6.0.
10+
11+
Please remove usage of [EmberObject APIs](https://api.emberjs.com/ember/release/modules/@ember%2Fobject)
12+
in your Store class.
13+
14+
To mark the class as no longer extending from EmberObject, in ember-cli-build.js
15+
set the following config:
16+
17+
```js
18+
const app = new EmberApp(defaults, {
19+
emberData: {
20+
deprecations: {
21+
DEPRECATE_STORE_EXTENDS_EMBER_OBJECT: false
22+
}
23+
}
24+
});
25+
```
26+
27+
If you are unsure whether your Store class uses EmberObject APIs, set this
28+
config and uses of those APIs will throw exceptions. The most common API that
29+
may have been used is `Store.extend({...`.
30+
31+
This deprecation is from RFC [#1026](https://rfcs.emberjs.com/id/1026-ember-data-deprecate-store-extends-ember-object).

content/ember/v6/importing-inject-from-ember-service.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,10 @@ export default class MyRoute extends Route {
1919
```
2020

2121
You can use the [ember-codemod-remove-inject-as-service](https://github.com/ijlee2/ember-codemod-remove-inject-as-service) codemod, to fix all violations.
22+
23+
If you're working on a library that needs to support ember-source prior to 4.1, you can support both styles of `service` via:
24+
```js
25+
import * as emberService from '@ember/service';
26+
27+
const service = emberService.service ?? emberService.inject;
28+
```

node-tests/index.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ describe('Json Tests', function () {
2424
`You don't need to define a displayId if it's the same as the file name`
2525
);
2626
}
27+
28+
// since is manditory and must be a string
29+
if (typeof contents.since !== 'string') {
30+
throw new Error('since frontmatter must be a string');
31+
}
32+
33+
// if you define an until then it must be a string
34+
if (contents.until && typeof contents.until !== 'string') {
35+
throw new Error('until frontmatter must be a string');
36+
}
2737
});
2838
});
2939
});

0 commit comments

Comments
 (0)