@ember-data/store 5.5.0-alpha.10 → 5.5.0-alpha.12
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/LICENSE.md +19 -7
- package/README.md +21 -12
- package/addon-main.cjs +5 -0
- package/dist/-private.js +1 -0
- package/{addon → dist}/index.js +4 -1
- package/{addon/store-service-76b33f02.js → dist/many-array-BwVo-2vv.js} +2828 -1528
- package/dist/many-array-BwVo-2vv.js.map +1 -0
- package/dist/types.js +0 -0
- package/dist/types.js.map +1 -0
- package/logos/NCC-1701-a-blue.svg +4 -0
- package/logos/NCC-1701-a-gold.svg +4 -0
- package/logos/NCC-1701-a-gold_100.svg +1 -0
- package/logos/NCC-1701-a-gold_base-64.txt +1 -0
- package/logos/NCC-1701-a.svg +4 -0
- package/logos/README.md +4 -0
- package/logos/docs-badge.svg +2 -0
- package/logos/github-header.svg +444 -0
- package/logos/social1.png +0 -0
- package/logos/social2.png +0 -0
- package/logos/warp-drive-logo-dark.svg +4 -0
- package/logos/warp-drive-logo-gold.svg +4 -0
- package/package.json +58 -53
- package/unstable-preview-types/-private/cache-handler/handler.d.ts +62 -0
- package/unstable-preview-types/-private/cache-handler/handler.d.ts.map +1 -0
- package/unstable-preview-types/-private/cache-handler/types.d.ts +107 -0
- package/unstable-preview-types/-private/cache-handler/types.d.ts.map +1 -0
- package/unstable-preview-types/-private/cache-handler/utils.d.ts +34 -0
- package/unstable-preview-types/-private/cache-handler/utils.d.ts.map +1 -0
- package/unstable-preview-types/-private/caches/cache-utils.d.ts +11 -0
- package/unstable-preview-types/-private/caches/cache-utils.d.ts.map +1 -0
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts +180 -0
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +1 -0
- package/unstable-preview-types/-private/caches/instance-cache.d.ts +64 -0
- package/unstable-preview-types/-private/caches/instance-cache.d.ts.map +1 -0
- package/unstable-preview-types/-private/caches/resource-utils.d.ts +12 -0
- package/unstable-preview-types/-private/caches/resource-utils.d.ts.map +1 -0
- package/unstable-preview-types/-private/debug/utils.d.ts +9 -0
- package/unstable-preview-types/-private/debug/utils.d.ts.map +1 -0
- package/unstable-preview-types/-private/document.d.ts +155 -0
- package/unstable-preview-types/-private/document.d.ts.map +1 -0
- package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +179 -0
- package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts.map +1 -0
- package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +19 -0
- package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts.map +1 -0
- package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +31 -0
- package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts.map +1 -0
- package/unstable-preview-types/-private/managers/cache-manager.d.ts +463 -0
- package/unstable-preview-types/-private/managers/cache-manager.d.ts.map +1 -0
- package/unstable-preview-types/-private/managers/notification-manager.d.ts +101 -0
- package/unstable-preview-types/-private/managers/notification-manager.d.ts.map +1 -0
- package/unstable-preview-types/-private/managers/record-array-manager.d.ts +101 -0
- package/unstable-preview-types/-private/managers/record-array-manager.d.ts.map +1 -0
- package/unstable-preview-types/-private/network/request-cache.d.ts +109 -0
- package/unstable-preview-types/-private/network/request-cache.d.ts.map +1 -0
- package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +150 -0
- package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts.map +1 -0
- package/unstable-preview-types/-private/record-arrays/many-array.d.ts +199 -0
- package/unstable-preview-types/-private/record-arrays/many-array.d.ts.map +1 -0
- package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts +118 -0
- package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts.map +1 -0
- package/unstable-preview-types/-private/store-service.d.ts +1595 -0
- package/unstable-preview-types/-private/store-service.d.ts.map +1 -0
- package/unstable-preview-types/-private/store-service.type-test.d.ts +4 -0
- package/unstable-preview-types/-private/store-service.type-test.d.ts.map +1 -0
- package/unstable-preview-types/-private/utils/coerce-id.d.ts +10 -0
- package/unstable-preview-types/-private/utils/coerce-id.d.ts.map +1 -0
- package/unstable-preview-types/-private/utils/construct-resource.d.ts +9 -0
- package/unstable-preview-types/-private/utils/construct-resource.d.ts.map +1 -0
- package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +4 -0
- package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts.map +1 -0
- package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +4 -0
- package/unstable-preview-types/-private/utils/normalize-model-name.d.ts.map +1 -0
- package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts +4 -0
- package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts.map +1 -0
- package/unstable-preview-types/-private.d.ts +28 -0
- package/unstable-preview-types/-private.d.ts.map +1 -0
- package/unstable-preview-types/-types/overview.d.ts +21 -0
- package/unstable-preview-types/-types/overview.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts +109 -0
- package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/ds-model.d.ts +25 -0
- package/unstable-preview-types/-types/q/ds-model.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/identifier.d.ts +193 -0
- package/unstable-preview-types/-types/q/identifier.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/promise-proxies.d.ts +4 -0
- package/unstable-preview-types/-types/q/promise-proxies.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/record-data-json-api.d.ts +36 -0
- package/unstable-preview-types/-types/q/record-data-json-api.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/record-instance.d.ts +29 -0
- package/unstable-preview-types/-types/q/record-instance.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/schema-service.d.ts +366 -0
- package/unstable-preview-types/-types/q/schema-service.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/store.d.ts +38 -0
- package/unstable-preview-types/-types/q/store.d.ts.map +1 -0
- package/unstable-preview-types/index.d.ts +223 -0
- package/unstable-preview-types/index.d.ts.map +1 -0
- package/unstable-preview-types/types.d.ts +7 -0
- package/unstable-preview-types/types.d.ts.map +1 -0
- package/addon/-private.js +0 -1
- package/addon/store-service-76b33f02.js.map +0 -1
- package/addon-main.js +0 -93
- /package/{addon → dist}/-private.js.map +0 -0
- /package/{addon → dist}/index.js.map +0 -0
- /package/{ember-data-logo-dark.svg → logos/ember-data-logo-dark.svg} +0 -0
- /package/{ember-data-logo-light.svg → logos/ember-data-logo-light.svg} +0 -0
package/LICENSE.md
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Copyright (c) 2017-2025 Ember.js and contributors
|
|
4
|
+
Copyright (c) 2011-2017 Tilde, Inc. and contributors
|
|
5
|
+
Copyright (c) 2011 LivingSocial Inc.
|
|
6
6
|
|
|
7
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
8
13
|
|
|
9
|
-
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
10
16
|
|
|
11
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<img
|
|
3
3
|
class="project-logo"
|
|
4
|
-
src="./ember-data-logo-dark.svg#gh-dark-mode-only"
|
|
4
|
+
src="./logos/ember-data-logo-dark.svg#gh-dark-mode-only"
|
|
5
5
|
alt="EmberData Store"
|
|
6
6
|
width="240px"
|
|
7
7
|
title="EmberData Store"
|
|
8
8
|
/>
|
|
9
9
|
<img
|
|
10
10
|
class="project-logo"
|
|
11
|
-
src="./ember-data-logo-light.svg#gh-light-mode-only"
|
|
11
|
+
src="./logos/ember-data-logo-light.svg#gh-light-mode-only"
|
|
12
12
|
alt="EmberData Store"
|
|
13
13
|
width="240px"
|
|
14
14
|
title="EmberData Store"
|
|
@@ -55,12 +55,21 @@ pnpm add @ember-data/store
|
|
|
55
55
|
|
|
56
56
|
After installing you will want to configure your first `Store`. Read more below for how to create and configure stores for your application.
|
|
57
57
|
|
|
58
|
+
**Tagged Releases**
|
|
59
|
+
|
|
60
|
+
- 
|
|
61
|
+
- 
|
|
62
|
+
- 
|
|
63
|
+
- 
|
|
64
|
+
- 
|
|
65
|
+
|
|
58
66
|
|
|
59
67
|
## 🔨 Creating A Store
|
|
60
68
|
|
|
61
69
|
To use a `Store` we will need to do few things: add a [Cache](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache) to store data **in-memory**, add a [Handler](https://github.com/emberjs/data/tree/main/packages/request#handling-requests) to fetch data from a source, and implement `instantiateRecord` to tell the store how to display the data for individual resources.
|
|
62
70
|
|
|
63
|
-
> **Note**
|
|
71
|
+
> **Note**
|
|
72
|
+
> If you are using the package `ember-data` then a `JSON:API` cache and `instantiateRecord` are configured for you by default.
|
|
64
73
|
|
|
65
74
|
### Configuring A Cache
|
|
66
75
|
|
|
@@ -81,7 +90,8 @@ class extends Store {
|
|
|
81
90
|
|
|
82
91
|
Now that we have a `cache` let's setup something to handle fetching and saving data via our API.
|
|
83
92
|
|
|
84
|
-
> **Note**
|
|
93
|
+
> **Note**
|
|
94
|
+
> The `ember-data` package automatically includes and configures the `@ember-data/json-api` cache for you.
|
|
85
95
|
|
|
86
96
|
### Handling Requests
|
|
87
97
|
|
|
@@ -89,7 +99,8 @@ When *Ember***Data** needs to fetch or save data it will pass that request to yo
|
|
|
89
99
|
|
|
90
100
|
To start, let's install the `RequestManager` from `@ember-data/request` and the basic `Fetch` handler from ``@ember-data/request/fetch`.
|
|
91
101
|
|
|
92
|
-
> **Note**
|
|
102
|
+
> **Note**
|
|
103
|
+
> If your app uses `GraphQL`, `REST` or different conventions for `JSON:API` than your cache expects, other handlers may better fit your data. You can author your own handler by creating one that conforms to the [handler interface](https://github.com/emberjs/data/tree/main/packages/request#handling-requests).
|
|
93
104
|
|
|
94
105
|
```ts
|
|
95
106
|
import Store, { CacheHandler } from '@ember-data/store';
|
|
@@ -97,12 +108,9 @@ import RequestManager from '@ember-data/request';
|
|
|
97
108
|
import Fetch from '@ember-data/request/fetch';
|
|
98
109
|
|
|
99
110
|
export default class extends Store {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
this.requestManager.use([Fetch]);
|
|
104
|
-
this.requestManager.useCache(CacheHandler);
|
|
105
|
-
}
|
|
111
|
+
requestManager = new RequestManager()
|
|
112
|
+
.use([Fetch])
|
|
113
|
+
.useCache(CacheHandler);
|
|
106
114
|
}
|
|
107
115
|
```
|
|
108
116
|
|
|
@@ -185,5 +193,6 @@ Typically you will choose an existing record implementation such as `@ember-data
|
|
|
185
193
|
|
|
186
194
|
Because of the boundaries around instantiation and the cache, record implementations should be capable of interop both with each other and with any `Cache`. Due to this, if needed an application can utilize multiple record implementations and multiple cache implementations either to support enhanced features for only a subset of records or to be able to incrementally migrate from one record/cache to another record or cache.
|
|
187
195
|
|
|
188
|
-
> **Note
|
|
196
|
+
> **Note**
|
|
197
|
+
> The `ember-data` package automatically includes the `@ember-data/model`
|
|
189
198
|
> package and configures it for you.
|
package/addon-main.cjs
ADDED
package/dist/-private.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { A as ARRAY_SIGNAL, C as CacheHandler, k as CollectionRecordArray, I as LiveArray, M as MUTATE, R as RecordArrayManager, w as RelatedCollection, l as SOURCE, S as Store, t as StoreMap, _ as _clearCaches, v as _deprecatingNormalize, h as coerceId, g as constructResource, j as ensureStringId, m as fastPush, f as isDocumentIdentifier, i as isStableIdentifier, x as log, y as logGroup, n as notifyArray, p as peekCache, r as recordIdentifierFor, o as removeRecordDataFor, u as setCacheFor, q as setRecordIdentifier, s as storeFor } from "./many-array-BwVo-2vv.js";
|
package/{addon → dist}/index.js
RENAMED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export { C as CacheHandler, S as default, r as recordIdentifierFor, c as setIdentifierForgetMethod, a as setIdentifierGenerationMethod, d as setIdentifierResetMethod, b as setIdentifierUpdateMethod, s as storeFor } from "./
|
|
1
|
+
export { C as CacheHandler, S as default, r as recordIdentifierFor, c as setIdentifierForgetMethod, a as setIdentifierGenerationMethod, d as setIdentifierResetMethod, b as setIdentifierUpdateMethod, e as setKeyInfoForResource, s as storeFor } from "./many-array-BwVo-2vv.js";
|
|
2
|
+
import '@ember/debug';
|
|
3
|
+
import '@embroider/macros';
|
|
4
|
+
import '@ember-data/request-utils/string';
|