@ember-data/store 5.8.0-alpha.4 → 5.8.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -32
- package/package.json +5 -5
- package/unstable-preview-types/index.d.ts +3 -1
package/dist/index.js
CHANGED
|
@@ -1,45 +1,21 @@
|
|
|
1
1
|
import { deprecate } from '@ember/debug';
|
|
2
2
|
import { macroCondition, getGlobalConfig, dependencySatisfies, importSync } from '@embroider/macros';
|
|
3
|
+
export { CacheHandler, Store as default, recordIdentifierFor, setIdentifierForgetMethod, setIdentifierGenerationMethod, setIdentifierResetMethod, setIdentifierUpdateMethod, setKeyInfoForResource, storeFor } from '@warp-drive/core';
|
|
3
4
|
import { setupSignals } from '@warp-drive/core/configure';
|
|
4
5
|
import { peekTransient } from '@warp-drive/core/types/-private';
|
|
5
|
-
export { CacheHandler, Store as default, recordIdentifierFor, setIdentifierForgetMethod, setIdentifierGenerationMethod, setIdentifierResetMethod, setIdentifierUpdateMethod, setKeyInfoForResource, storeFor } from '@warp-drive/core';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* <p align="center">
|
|
9
|
-
* <img
|
|
10
|
-
* class="project-logo"
|
|
11
|
-
* src="https://raw.githubusercontent.com/warp-drive-data/warp-drive/4612c9354e4c54d53327ec2cf21955075ce21294/ember-data-logo-light.svg#gh-light-mode-only"
|
|
12
|
-
* alt="EmberData Store"
|
|
13
|
-
* width="240px"
|
|
14
|
-
* title="EmberData Store"
|
|
15
|
-
* />
|
|
16
|
-
* </p>
|
|
17
|
-
*
|
|
18
8
|
* This package provides [*Ember***Data**](https://github.com/warp-drive-data/warp-drive/)'s `Store` class.
|
|
19
9
|
*
|
|
20
|
-
* A
|
|
21
|
-
* and sources of data (such as your API or a local persistence layer) accessed via a
|
|
10
|
+
* A {@link Store} coordinates interaction between your application, a {@link Cache},
|
|
11
|
+
* and sources of data (such as your API or a local persistence layer) accessed via a {@link RequestManager}.
|
|
22
12
|
*
|
|
23
13
|
* Optionally, a Store can be configured to hydrate the response data into rich presentation classes.
|
|
24
14
|
*
|
|
25
|
-
* ## Installation
|
|
26
|
-
*
|
|
27
|
-
* If you have installed `ember-data` then you already have this package installed.
|
|
28
|
-
* Otherwise you can install it using your javascript package manager of choice.
|
|
29
|
-
* For instance with [pnpm](https://pnpm.io/)
|
|
30
|
-
*
|
|
31
|
-
* ```
|
|
32
|
-
* pnpm add @ember-data/store
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* After installing you will want to configure your first `Store`. Read more below
|
|
36
|
-
* for how to create and configure stores for your application.
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
15
|
* ## 🔨 Creating A Store
|
|
40
16
|
*
|
|
41
|
-
* To use a `Store` we will need to do few things: add a
|
|
42
|
-
* to store data **in-memory**, add a
|
|
17
|
+
* To use a `Store` we will need to do few things: add a {@link Cache}
|
|
18
|
+
* to store data **in-memory**, add a {@link Handler} to fetch data from a source,
|
|
43
19
|
* and implement `instantiateRecord` to tell the store how to display the data for individual resources.
|
|
44
20
|
*
|
|
45
21
|
* > **Note**
|
|
@@ -50,7 +26,7 @@ export { CacheHandler, Store as default, recordIdentifierFor, setIdentifierForge
|
|
|
50
26
|
*
|
|
51
27
|
* To start, let's install a [JSON:API](https://jsonapi.org/) cache. If your app uses `GraphQL` or `REST` other
|
|
52
28
|
* caches may better fit your data. You can author your own cache by creating one that
|
|
53
|
-
* conforms to the
|
|
29
|
+
* conforms to the {@link Cache | spec}.
|
|
54
30
|
*
|
|
55
31
|
* The package `@ember-data/json-api` provides a [JSON:API](https://jsonapi.org/) cache we can use.
|
|
56
32
|
* After installing it, we can configure the store to use this cache.
|
|
@@ -125,8 +101,7 @@ export { CacheHandler, Store as default, recordIdentifierFor, setIdentifierForge
|
|
|
125
101
|
* ### Presenting Data from the Cache
|
|
126
102
|
*
|
|
127
103
|
* Now that we have a source and a cache for our data, we need to configure how
|
|
128
|
-
* the Store delivers that data back to our application. We do this via the hook
|
|
129
|
-
* [instantiateRecord](https://api.emberjs.com/ember-data/release/classes/Store/methods/instantiateRecord%20(hook)?anchor=instantiateRecord%20(hook)),
|
|
104
|
+
* the Store delivers that data back to our application. We do this via the {@link Store.instantiateRecord | instantiateRecord hook}
|
|
130
105
|
* which allows us to transform the data for a resource before handing it to the application.
|
|
131
106
|
*
|
|
132
107
|
* A naive way to present the data would be to return it as JSON. Typically instead
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-data/store",
|
|
3
|
-
"version": "5.8.0-alpha.
|
|
3
|
+
"version": "5.8.0-alpha.6",
|
|
4
4
|
"description": "The core of EmberData. Provides the Store service which coordinates the cache with the network and presentation layers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@embroider/macros": "^1.18.1",
|
|
36
|
-
"@warp-drive/core": "5.8.0-alpha.
|
|
36
|
+
"@warp-drive/core": "5.8.0-alpha.6"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@ember-data/tracking": "5.8.0-alpha.
|
|
39
|
+
"@ember-data/tracking": "5.8.0-alpha.6",
|
|
40
40
|
"@ember/test-waiters": "^3.1.0 || ^4.0.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependenciesMeta": {
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"@babel/plugin-transform-typescript": "^7.28.0",
|
|
53
53
|
"@babel/preset-env": "^7.28.3",
|
|
54
54
|
"@babel/preset-typescript": "^7.27.1",
|
|
55
|
-
"@warp-drive/internal-config": "5.8.0-alpha.
|
|
56
|
-
"@ember-data/tracking": "5.8.0-alpha.
|
|
55
|
+
"@warp-drive/internal-config": "5.8.0-alpha.6",
|
|
56
|
+
"@ember-data/tracking": "5.8.0-alpha.6",
|
|
57
57
|
"@ember/test-waiters": "^4.1.1",
|
|
58
58
|
"ember-source": "~6.6.0",
|
|
59
59
|
"typescript": "^5.9.2",
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/// <reference path="./-private.d.ts" />
|
|
3
3
|
/// <reference path="./types.d.ts" />
|
|
4
4
|
declare module '@ember-data/store' {
|
|
5
|
-
|
|
5
|
+
import { Store } from "@warp-drive/core";
|
|
6
|
+
export { Store as default };
|
|
7
|
+
export { type StoreRequestContext, CacheHandler, type Document, type CachePolicy, type StoreRequestInput, recordIdentifierFor, storeFor, type DocumentCacheOperation, type CacheOperation, type NotificationType, setIdentifierGenerationMethod, setIdentifierUpdateMethod, setIdentifierForgetMethod, setIdentifierResetMethod, setKeyInfoForResource } from "@warp-drive/core";
|
|
6
8
|
|
|
7
9
|
}
|