@ember-data/store 5.4.0-beta.1 → 5.4.0-beta.11
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/README.md +16 -4
- package/addon-main.cjs +5 -0
- package/dist/-private.js +1 -0
- package/{addon/store-service-f6cb9898.js → dist/cache-handler-C5ilAUZ5.js} +1950 -1474
- package/dist/cache-handler-C5ilAUZ5.js.map +1 -0
- package/{addon → dist}/index.js +4 -1
- package/dist/types.js +0 -0
- package/dist/types.js.map +1 -0
- package/package.json +61 -48
- package/unstable-preview-types/-private/cache-handler.d.ts +144 -0
- package/unstable-preview-types/-private/cache-handler.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 +176 -0
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +1 -0
- package/unstable-preview-types/-private/caches/instance-cache.d.ts +61 -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/document.d.ts +146 -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 +441 -0
- package/unstable-preview-types/-private/managers/cache-manager.d.ts.map +1 -0
- package/unstable-preview-types/-private/managers/notification-manager.d.ts +96 -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 +97 -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 +138 -0
- package/unstable-preview-types/-private/record-arrays/identifier-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 +1522 -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 +25 -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 +358 -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 +222 -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-f6cb9898.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/README.md
CHANGED
|
@@ -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';
|
|
@@ -185,5 +196,6 @@ Typically you will choose an existing record implementation such as `@ember-data
|
|
|
185
196
|
|
|
186
197
|
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
198
|
|
|
188
|
-
> **Note
|
|
199
|
+
> **Note**
|
|
200
|
+
> The `ember-data` package automatically includes the `@ember-data/model`
|
|
189
201
|
> 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, j as CollectionRecordArray, I as LiveArray, M as MUTATE, R as RecordArrayManager, k as SOURCE, S as Store, q as StoreMap, _ as _clearCaches, u as _deprecatingNormalize, g as coerceId, f as constructResource, h as ensureStringId, l as fastPush, i as isStableIdentifier, n as notifyArray, p as peekCache, r as recordIdentifierFor, m as removeRecordDataFor, t as setCacheFor, o as setRecordIdentifier, s as storeFor } from "./cache-handler-C5ilAUZ5.js";
|