@ember-data/store 5.6.0-alpha.0 → 5.6.0-alpha.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.
Files changed (100) hide show
  1. package/README.md +5 -5
  2. package/addon-main.cjs +1 -1
  3. package/dist/-private.js +1 -2
  4. package/dist/-private.js.map +1 -1
  5. package/dist/configure.js +1 -1
  6. package/dist/index.js +208 -5
  7. package/dist/index.js.map +1 -1
  8. package/package.json +8 -19
  9. package/unstable-preview-types/-private.d.ts +1 -30
  10. package/unstable-preview-types/-private.d.ts.map +1 -1
  11. package/unstable-preview-types/configure.d.ts +2 -6
  12. package/unstable-preview-types/configure.d.ts.map +1 -1
  13. package/unstable-preview-types/index.d.ts +2 -224
  14. package/unstable-preview-types/index.d.ts.map +1 -1
  15. package/unstable-preview-types/types.d.ts +1 -4
  16. package/unstable-preview-types/types.d.ts.map +1 -1
  17. package/dist/configure-BfLLW6GY.js +0 -161
  18. package/dist/configure-BfLLW6GY.js.map +0 -1
  19. package/dist/request-state-uRtpn0Lc.js +0 -7709
  20. package/dist/request-state-uRtpn0Lc.js.map +0 -1
  21. package/unstable-preview-types/-private/cache-handler/handler.d.ts +0 -62
  22. package/unstable-preview-types/-private/cache-handler/handler.d.ts.map +0 -1
  23. package/unstable-preview-types/-private/cache-handler/types.d.ts +0 -107
  24. package/unstable-preview-types/-private/cache-handler/types.d.ts.map +0 -1
  25. package/unstable-preview-types/-private/cache-handler/utils.d.ts +0 -34
  26. package/unstable-preview-types/-private/cache-handler/utils.d.ts.map +0 -1
  27. package/unstable-preview-types/-private/caches/cache-utils.d.ts +0 -11
  28. package/unstable-preview-types/-private/caches/cache-utils.d.ts.map +0 -1
  29. package/unstable-preview-types/-private/caches/identifier-cache.d.ts +0 -180
  30. package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +0 -1
  31. package/unstable-preview-types/-private/caches/instance-cache.d.ts +0 -64
  32. package/unstable-preview-types/-private/caches/instance-cache.d.ts.map +0 -1
  33. package/unstable-preview-types/-private/caches/resource-utils.d.ts +0 -12
  34. package/unstable-preview-types/-private/caches/resource-utils.d.ts.map +0 -1
  35. package/unstable-preview-types/-private/debug/utils.d.ts +0 -9
  36. package/unstable-preview-types/-private/debug/utils.d.ts.map +0 -1
  37. package/unstable-preview-types/-private/document.d.ts +0 -155
  38. package/unstable-preview-types/-private/document.d.ts.map +0 -1
  39. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +0 -179
  40. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts.map +0 -1
  41. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +0 -19
  42. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts.map +0 -1
  43. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +0 -31
  44. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts.map +0 -1
  45. package/unstable-preview-types/-private/managers/cache-manager.d.ts +0 -463
  46. package/unstable-preview-types/-private/managers/cache-manager.d.ts.map +0 -1
  47. package/unstable-preview-types/-private/managers/notification-manager.d.ts +0 -101
  48. package/unstable-preview-types/-private/managers/notification-manager.d.ts.map +0 -1
  49. package/unstable-preview-types/-private/managers/record-array-manager.d.ts +0 -101
  50. package/unstable-preview-types/-private/managers/record-array-manager.d.ts.map +0 -1
  51. package/unstable-preview-types/-private/network/request-cache.d.ts +0 -109
  52. package/unstable-preview-types/-private/network/request-cache.d.ts.map +0 -1
  53. package/unstable-preview-types/-private/new-core-tmp/promise-state.d.ts +0 -289
  54. package/unstable-preview-types/-private/new-core-tmp/promise-state.d.ts.map +0 -1
  55. package/unstable-preview-types/-private/new-core-tmp/reactivity/configure.d.ts +0 -92
  56. package/unstable-preview-types/-private/new-core-tmp/reactivity/configure.d.ts.map +0 -1
  57. package/unstable-preview-types/-private/new-core-tmp/reactivity/internal.d.ts +0 -172
  58. package/unstable-preview-types/-private/new-core-tmp/reactivity/internal.d.ts.map +0 -1
  59. package/unstable-preview-types/-private/new-core-tmp/reactivity/signal.d.ts +0 -32
  60. package/unstable-preview-types/-private/new-core-tmp/reactivity/signal.d.ts.map +0 -1
  61. package/unstable-preview-types/-private/new-core-tmp/request-state.d.ts +0 -276
  62. package/unstable-preview-types/-private/new-core-tmp/request-state.d.ts.map +0 -1
  63. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +0 -145
  64. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts.map +0 -1
  65. package/unstable-preview-types/-private/record-arrays/many-array.d.ts +0 -203
  66. package/unstable-preview-types/-private/record-arrays/many-array.d.ts.map +0 -1
  67. package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts +0 -118
  68. package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts.map +0 -1
  69. package/unstable-preview-types/-private/store-service.d.ts +0 -1601
  70. package/unstable-preview-types/-private/store-service.d.ts.map +0 -1
  71. package/unstable-preview-types/-private/store-service.type-test.d.ts +0 -4
  72. package/unstable-preview-types/-private/store-service.type-test.d.ts.map +0 -1
  73. package/unstable-preview-types/-private/utils/coerce-id.d.ts +0 -10
  74. package/unstable-preview-types/-private/utils/coerce-id.d.ts.map +0 -1
  75. package/unstable-preview-types/-private/utils/construct-resource.d.ts +0 -9
  76. package/unstable-preview-types/-private/utils/construct-resource.d.ts.map +0 -1
  77. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +0 -4
  78. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts.map +0 -1
  79. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +0 -4
  80. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts.map +0 -1
  81. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts +0 -4
  82. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts.map +0 -1
  83. package/unstable-preview-types/-types/overview.d.ts +0 -21
  84. package/unstable-preview-types/-types/overview.d.ts.map +0 -1
  85. package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts +0 -110
  86. package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts.map +0 -1
  87. package/unstable-preview-types/-types/q/ds-model.d.ts +0 -25
  88. package/unstable-preview-types/-types/q/ds-model.d.ts.map +0 -1
  89. package/unstable-preview-types/-types/q/identifier.d.ts +0 -193
  90. package/unstable-preview-types/-types/q/identifier.d.ts.map +0 -1
  91. package/unstable-preview-types/-types/q/promise-proxies.d.ts +0 -4
  92. package/unstable-preview-types/-types/q/promise-proxies.d.ts.map +0 -1
  93. package/unstable-preview-types/-types/q/record-data-json-api.d.ts +0 -36
  94. package/unstable-preview-types/-types/q/record-data-json-api.d.ts.map +0 -1
  95. package/unstable-preview-types/-types/q/record-instance.d.ts +0 -29
  96. package/unstable-preview-types/-types/q/record-instance.d.ts.map +0 -1
  97. package/unstable-preview-types/-types/q/schema-service.d.ts +0 -354
  98. package/unstable-preview-types/-types/q/schema-service.d.ts.map +0 -1
  99. package/unstable-preview-types/-types/q/store.d.ts +0 -38
  100. package/unstable-preview-types/-types/q/store.d.ts.map +0 -1
package/README.md CHANGED
@@ -124,11 +124,11 @@ import RequestManager from '@ember-data/request';
124
124
  import { CacheHandler } from '@ember-data/store';
125
125
  import Fetch from '@ember-data/request/fetch';
126
126
 
127
- export default class extends RequestManager {
128
- constructor(createArgs) {
129
- super(createArgs);
130
- this.use([Fetch]);
131
- this.useCache(CacheHandler);
127
+ export default {
128
+ create() {
129
+ return new RequestManager()
130
+ .use([Fetch])
131
+ .useCache(CacheHandler);
132
132
  }
133
133
  }
134
134
  ```
package/addon-main.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const { addonShim } = require('@warp-drive/build-config/addon-shim.cjs');
3
+ const { addonShim } = require('@warp-drive/core/addon-shim.cjs');
4
4
 
5
5
  module.exports = addonShim(__dirname);
package/dist/-private.js CHANGED
@@ -1,2 +1 @@
1
- export { C as CacheHandler, k as CollectionRecordArray, I as LiveArray, M as MUTATE, R as RecordArrayManager, v as RelatedCollection, l as SOURCE, G as Signals, S as Store, q as StoreMap, _ as _clearCaches, u as _deprecatingNormalize, h as coerceId, g as constructResource, L as consumeInternalSignal, F as defineNonEnumerableSignal, E as defineSignal, j as ensureStringId, D as entangleSignal, m as fastPush, B as gate, N as getOrCreateInternalSignal, y as getPromiseState, z as getRequestState, f as isDocumentIdentifier, i as isStableIdentifier, w as log, x as logGroup, A as memoized, K as notifyInternalSignal, p as peekCache, H as peekInternalSignal, r as recordIdentifierFor, n as removeRecordDataFor, t as setCacheFor, o as setRecordIdentifier, s as storeFor, J as withSignalStore } from "./request-state-uRtpn0Lc.js";
2
- export { A as ARRAY_SIGNAL, O as OBJECT_SIGNAL, c as createMemo } from "./configure-BfLLW6GY.js";
1
+ export * from '@warp-drive/core/store/-private';
@@ -1 +1 @@
1
- {"version":3,"file":"-private.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"-private.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/configure.js CHANGED
@@ -1 +1 @@
1
- export { s as setupSignals } from "./configure-BfLLW6GY.js";
1
+ export { setupSignals } from '@warp-drive/core/configure';
package/dist/index.js CHANGED
@@ -1,5 +1,208 @@
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 "./request-state-uRtpn0Lc.js";
2
- import '@ember/debug';
3
- import '@embroider/macros';
4
- import '@ember-data/request-utils/string';
5
- import "./configure-BfLLW6GY.js";
1
+ import { deprecate } from '@ember/debug';
2
+ import { macroCondition, getGlobalConfig, dependencySatisfies, importSync } from '@embroider/macros';
3
+ import { setupSignals } from '@warp-drive/core/configure';
4
+ export { CacheHandler, Store as default, recordIdentifierFor, setIdentifierForgetMethod, setIdentifierGenerationMethod, setIdentifierResetMethod, setIdentifierUpdateMethod, setKeyInfoForResource, storeFor } from '@warp-drive/core';
5
+
6
+ /**
7
+ * <p align="center">
8
+ * <img
9
+ * class="project-logo"
10
+ * src="https://raw.githubusercontent.com/emberjs/data/4612c9354e4c54d53327ec2cf21955075ce21294/ember-data-logo-light.svg#gh-light-mode-only"
11
+ * alt="EmberData Store"
12
+ * width="240px"
13
+ * title="EmberData Store"
14
+ * />
15
+ * </p>
16
+ *
17
+ * This package provides [*Ember***Data**](https://github.com/emberjs/data/)'s `Store` class.
18
+ *
19
+ * A [Store](https://api.emberjs.com/ember-data/release/classes/Store) coordinates interaction between your application, a [Cache](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache),
20
+ * and sources of data (such as your API or a local persistence layer) accessed via a [RequestManager](https://github.com/emberjs/data/tree/main/packages/request).
21
+ *
22
+ * Optionally, a Store can be configured to hydrate the response data into rich presentation classes.
23
+ *
24
+ * ## Installation
25
+ *
26
+ * If you have installed `ember-data` then you already have this package installed.
27
+ * Otherwise you can install it using your javascript package manager of choice.
28
+ * For instance with [pnpm](https://pnpm.io/)
29
+ *
30
+ * ```
31
+ * pnpm add @ember-data/store
32
+ * ```
33
+ *
34
+ * After installing you will want to configure your first `Store`. Read more below
35
+ * for how to create and configure stores for your application.
36
+ *
37
+ *
38
+ * ## 🔨 Creating A Store
39
+ *
40
+ * 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)
41
+ * to store data **in-memory**, add a [Handler](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache) to fetch data from a source,
42
+ * and implement `instantiateRecord` to tell the store how to display the data for individual resources.
43
+ *
44
+ * > **Note**
45
+ * > If you are using the package `ember-data` then a JSON:API cache, RequestManager, LegacyNetworkHandler,
46
+ * > and `instantiateRecord` are configured for you by default.
47
+ *
48
+ * ### Configuring A Cache
49
+ *
50
+ * To start, let's install a [JSON:API](https://jsonapi.org/) cache. If your app uses `GraphQL` or `REST` other
51
+ * caches may better fit your data. You can author your own cache by creating one that
52
+ * conforms to the [spec](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache).
53
+ *
54
+ * The package `@ember-data/json-api` provides a [JSON:API](https://jsonapi.org/) cache we can use.
55
+ * After installing it, we can configure the store to use this cache.
56
+ *
57
+ * ```js
58
+ * import Store from '@ember-data/store';
59
+ * import Cache from '@ember-data/json-api';
60
+ *
61
+ * class extends Store {
62
+ * createCache(storeWrapper) {
63
+ * return new Cache(storeWrapper);
64
+ * }
65
+ * }
66
+ * ```
67
+ *
68
+ * Now that we have a `cache` let's setup something to handle fetching
69
+ * and saving data via our API.
70
+ *
71
+ * > **Note**
72
+ * > The `ember-data` package automatically includes and configures
73
+ * > the `@ember-data/json-api` cache for you.
74
+ *
75
+ * ### Handling Requests
76
+ *
77
+ * When *Ember***Data** needs to fetch or save data it will pass that request to your application's `RequestManager` for fulfillment. How this fulfillment occurs (in-memory, device storage, via single or multiple API requests, etc.) is then up to the registered request handlers.
78
+ *
79
+ * To start, let's install the `RequestManager` from `@ember-data/request` and the basic `Fetch` handler from ``@ember-data/request/fetch`.
80
+ *
81
+ * > **Note**
82
+ * > 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).
83
+ *
84
+ * ```ts
85
+ * import Store from '@ember-data/store';
86
+ * import RequestManager from '@ember-data/request';
87
+ * import Fetch from '@ember-data/request/fetch';
88
+ *
89
+ * export default class extends Store {
90
+ * requestManager = new RequestManager()
91
+ * .use([Fetch]);
92
+ * }
93
+ * ```
94
+ *
95
+ * **Using RequestManager as a Service**
96
+ *
97
+ * Alternatively if you have configured the `RequestManager` to be a service you may re-use it.
98
+ *
99
+ * *app/services/request.js*
100
+ * ```ts
101
+ * import RequestManager from '@ember-data/request';
102
+ * import Fetch from '@ember-data/request/fetch';
103
+ *
104
+ * export default {
105
+ * create() {
106
+ * return new RequestManager()
107
+ * .use([Fetch])
108
+ * .useCache(CacheHandler);
109
+ * }
110
+ * }
111
+ * ```
112
+ *
113
+ * *app/services/store.js*
114
+ * ```ts
115
+ * import Store from '@ember-data/store';
116
+ * import { service } from '@ember/service';
117
+ *
118
+ * export default class extends Store {
119
+ * @service('request') requestManager
120
+ * }
121
+ * ```
122
+ *
123
+ *
124
+ * ### Presenting Data from the Cache
125
+ *
126
+ * Now that we have a source and a cache for our data, we need to configure how
127
+ * the Store delivers that data back to our application. We do this via the hook
128
+ * [instantiateRecord](https://api.emberjs.com/ember-data/release/classes/Store/methods/instantiateRecord%20(hook)?anchor=instantiateRecord%20(hook)),
129
+ * which allows us to transform the data for a resource before handing it to the application.
130
+ *
131
+ * A naive way to present the data would be to return it as JSON. Typically instead
132
+ * this hook will be used to add reactivity and make each unique resource a singleton,
133
+ * ensuring that if the cache updates our presented data will reflect the new state.
134
+ *
135
+ * Below is an example of using the hooks `instantiateRecord` and a `teardownRecord`
136
+ * to provide minimal read-only reactive state for simple resources.
137
+ *
138
+ * ```ts
139
+ * import Store, { recordIdentifierFor } from '@ember-data/store';
140
+ * import { TrackedObject } from 'tracked-built-ins';
141
+ *
142
+ * class extends Store {
143
+ * instantiateRecord(identifier) {
144
+ * const { cache, notifications } = this;
145
+ *
146
+ * // create a TrackedObject with our attributes, id and type
147
+ * const record = new TrackedObject(Object.assign({}, cache.peek(identifier)));
148
+ * record.type = identifier.type;
149
+ * record.id = identifier.id;
150
+ *
151
+ * notifications.subscribe(identifier, (_, change) => {
152
+ * if (change === 'attributes') {
153
+ * Object.assign(record, cache.peek(identifier));
154
+ * }
155
+ * });
156
+ *
157
+ * return record;
158
+ * }
159
+ * }
160
+ * ```
161
+ *
162
+ * Because `instantiateRecord` is opaque to the nature of the record, an implementation
163
+ * can be anything from a fairly simple object to a robust proxy that intelligently links
164
+ * together associated records through relationships.
165
+ *
166
+ * This also enables creating a record that separates `edit` flows from `create` flows
167
+ * entirely. A record class might choose to implement a `checkout`method that gives access
168
+ * to an editable instance while the primary record continues to be read-only and reflect
169
+ * only persisted (non-mutated) state.
170
+ *
171
+ * Typically you will choose an existing record implementation such as `@ember-data/model`
172
+ * for your application.
173
+ *
174
+ * Because of the boundaries around instantiation and the cache, record implementations
175
+ * should be capable of interop both with each other and with any `Cache`. Due to this,
176
+ * if needed an application can utilize multiple record implementations and multiple cache
177
+ * implementations either to support enhanced features for only a subset of records or to
178
+ * be able to incrementally migrate from one record/cache to another record or cache.
179
+ *
180
+ * > **Note**
181
+ * > The `ember-data` package automatically includes the `@ember-data/model`
182
+ * > package and configures it for you.
183
+ *
184
+ * @module
185
+ */
186
+ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_TRACKING_PACKAGE)) {
187
+ let hasEmberDataTracking = false;
188
+ if (macroCondition(dependencySatisfies('@ember-data/tracking', '*'))) {
189
+ hasEmberDataTracking = true;
190
+ // @ts-expect-error
191
+ const {
192
+ buildSignalConfig
193
+ } = importSync('@ember-data/tracking');
194
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
195
+ setupSignals(buildSignalConfig);
196
+ }
197
+ const message = [`Using WarpDrive with EmberJS requires configuring it to use Ember's reactivity system.`, `Previously this was provided by installing the package '@ember-data/tracking', but this package is now deprecated.`, ``, `To resolve this deprecation, follow these steps:`, hasEmberDataTracking ? `- remove "@ember-data/tracking" and (if needed) "@ember-data-types/tracking" from your project in both your package.json and tsconfig.json` : false, `- add "@warp-drive/ember" to your project in both your package.json and tsconfig.json`, '- add the following import to your app.js file:', '', '\t```', `\timport '@warp-drive/ember/install';`, '\t```', ``, '- mark this deprecation as resolved in your project by adding the following to your WarpDrive config in ember-cli-build.js:', '', '\t```', '\tconst { setConfig } = await import("@warp-drive/build-config");', '\tsetConfig(app, __dirname, {', '\t deprecations: {', '\t DEPRECATE_TRACKING_PACKAGE: false,', '\t },', '\t});', '\t```', ``, `For more information, see the Package Unification RFC: https://rfcs.emberjs.com/id/1075-warp-drive-package-unification/`].filter(l => l !== false).join('\n');
198
+ deprecate(message, false, {
199
+ id: 'warp-drive.deprecate-tracking-package',
200
+ until: '6.0.0',
201
+ for: 'warp-drive',
202
+ since: {
203
+ enabled: '5.3.4',
204
+ available: '4.13'
205
+ },
206
+ url: 'https://deprecations.emberjs.com/id/warp-drive.deprecate-tracking-package'
207
+ });
208
+ }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["/**\n * <p align=\"center\">\n * <img\n * class=\"project-logo\"\n * src=\"https://raw.githubusercontent.com/emberjs/data/4612c9354e4c54d53327ec2cf21955075ce21294/ember-data-logo-light.svg#gh-light-mode-only\"\n * alt=\"EmberData Store\"\n * width=\"240px\"\n * title=\"EmberData Store\"\n * />\n * </p>\n *\n * This package provides [*Ember***Data**](https://github.com/emberjs/data/)'s `Store` class.\n *\n * A [Store](https://api.emberjs.com/ember-data/release/classes/Store) coordinates interaction between your application, a [Cache](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache),\n * and sources of data (such as your API or a local persistence layer) accessed via a [RequestManager](https://github.com/emberjs/data/tree/main/packages/request).\n *\n * Optionally, a Store can be configured to hydrate the response data into rich presentation classes.\n *\n * ## Installation\n *\n * If you have installed `ember-data` then you already have this package installed.\n * Otherwise you can install it using your javascript package manager of choice.\n * For instance with [pnpm](https://pnpm.io/)\n *\n * ```\n * pnpm add @ember-data/store\n * ```\n *\n * After installing you will want to configure your first `Store`. Read more below\n * for how to create and configure stores for your application.\n *\n *\n * ## 🔨 Creating A Store\n *\n * 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)\n * to store data **in-memory**, add a [Handler](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache) to fetch data from a source,\n * and implement `instantiateRecord` to tell the store how to display the data for individual resources.\n *\n * > **Note**\n * > If you are using the package `ember-data` then a JSON:API cache, RequestManager, LegacyNetworkHandler,\n * > and `instantiateRecord` are configured for you by default.\n *\n * ### Configuring A Cache\n *\n * To start, let's install a [JSON:API](https://jsonapi.org/) cache. If your app uses `GraphQL` or `REST` other\n * caches may better fit your data. You can author your own cache by creating one that\n * conforms to the [spec](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache).\n *\n * The package `@ember-data/json-api` provides a [JSON:API](https://jsonapi.org/) cache we can use.\n * After installing it, we can configure the store to use this cache.\n *\n * ```js\n * import Store from '@ember-data/store';\n * import Cache from '@ember-data/json-api';\n *\n * class extends Store {\n * createCache(storeWrapper) {\n * return new Cache(storeWrapper);\n * }\n * }\n * ```\n *\n * Now that we have a `cache` let's setup something to handle fetching\n * and saving data via our API.\n *\n * > **Note**\n * > The `ember-data` package automatically includes and configures\n * > the `@ember-data/json-api` cache for you.\n *\n * ### Handling Requests\n *\n * When *Ember***Data** needs to fetch or save data it will pass that request to your application's `RequestManager` for fulfillment. How this fulfillment occurs (in-memory, device storage, via single or multiple API requests, etc.) is then up to the registered request handlers.\n *\n * To start, let's install the `RequestManager` from `@ember-data/request` and the basic `Fetch` handler from ``@ember-data/request/fetch`.\n *\n * > **Note**\n * > 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).\n *\n * ```ts\n * import Store from '@ember-data/store';\n * import RequestManager from '@ember-data/request';\n * import Fetch from '@ember-data/request/fetch';\n *\n * export default class extends Store {\n * requestManager = new RequestManager()\n * .use([Fetch]);\n * }\n * ```\n *\n * **Using RequestManager as a Service**\n *\n * Alternatively if you have configured the `RequestManager` to be a service you may re-use it.\n *\n * *app/services/request.js*\n * ```ts\n * import RequestManager from '@ember-data/request';\n * import Fetch from '@ember-data/request/fetch';\n *\n * export default {\n * create() {\n * return new RequestManager()\n * .use([Fetch])\n * .useCache(CacheHandler);\n * }\n * }\n * ```\n *\n * *app/services/store.js*\n * ```ts\n * import Store from '@ember-data/store';\n * import { service } from '@ember/service';\n *\n * export default class extends Store {\n * @service('request') requestManager\n * }\n * ```\n *\n *\n * ### Presenting Data from the Cache\n *\n * Now that we have a source and a cache for our data, we need to configure how\n * the Store delivers that data back to our application. We do this via the hook\n * [instantiateRecord](https://api.emberjs.com/ember-data/release/classes/Store/methods/instantiateRecord%20(hook)?anchor=instantiateRecord%20(hook)),\n * which allows us to transform the data for a resource before handing it to the application.\n *\n * A naive way to present the data would be to return it as JSON. Typically instead\n * this hook will be used to add reactivity and make each unique resource a singleton,\n * ensuring that if the cache updates our presented data will reflect the new state.\n *\n * Below is an example of using the hooks `instantiateRecord` and a `teardownRecord`\n * to provide minimal read-only reactive state for simple resources.\n *\n * ```ts\n * import Store, { recordIdentifierFor } from '@ember-data/store';\n * import { TrackedObject } from 'tracked-built-ins';\n *\n * class extends Store {\n * instantiateRecord(identifier) {\n * const { cache, notifications } = this;\n *\n * // create a TrackedObject with our attributes, id and type\n * const record = new TrackedObject(Object.assign({}, cache.peek(identifier)));\n * record.type = identifier.type;\n * record.id = identifier.id;\n *\n * notifications.subscribe(identifier, (_, change) => {\n * if (change === 'attributes') {\n * Object.assign(record, cache.peek(identifier));\n * }\n * });\n *\n * return record;\n * }\n * }\n * ```\n *\n * Because `instantiateRecord` is opaque to the nature of the record, an implementation\n * can be anything from a fairly simple object to a robust proxy that intelligently links\n * together associated records through relationships.\n *\n * This also enables creating a record that separates `edit` flows from `create` flows\n * entirely. A record class might choose to implement a `checkout`method that gives access\n * to an editable instance while the primary record continues to be read-only and reflect\n * only persisted (non-mutated) state.\n *\n * Typically you will choose an existing record implementation such as `@ember-data/model`\n * for your application.\n *\n * Because of the boundaries around instantiation and the cache, record implementations\n * should be capable of interop both with each other and with any `Cache`. Due to this,\n * if needed an application can utilize multiple record implementations and multiple cache\n * implementations either to support enhanced features for only a subset of records or to\n * be able to incrementally migrate from one record/cache to another record or cache.\n *\n * > **Note**\n * > The `ember-data` package automatically includes the `@ember-data/model`\n * > package and configures it for you.\n *\n * @module\n */\nimport { deprecate } from '@ember/debug';\n\nimport { dependencySatisfies, importSync, macroCondition } from '@embroider/macros';\n\nimport { DEPRECATE_TRACKING_PACKAGE } from '@warp-drive/core/build-config/deprecations';\nimport { setupSignals } from '@warp-drive/core/configure';\n\nexport {\n Store as default,\n type StoreRequestContext,\n CacheHandler,\n type Document,\n type CachePolicy,\n type StoreRequestInput,\n recordIdentifierFor,\n storeFor,\n type DocumentCacheOperation,\n type CacheOperation,\n type NotificationType,\n setIdentifierGenerationMethod,\n setIdentifierUpdateMethod,\n setIdentifierForgetMethod,\n setIdentifierResetMethod,\n setKeyInfoForResource,\n} from '@warp-drive/core';\n\nif (DEPRECATE_TRACKING_PACKAGE) {\n let hasEmberDataTracking = false;\n if (macroCondition(dependencySatisfies('@ember-data/tracking', '*'))) {\n hasEmberDataTracking = true;\n // @ts-expect-error\n const { buildSignalConfig } = importSync('@ember-data/tracking');\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n setupSignals(buildSignalConfig);\n }\n\n const message = [\n `Using WarpDrive with EmberJS requires configuring it to use Ember's reactivity system.`,\n `Previously this was provided by installing the package '@ember-data/tracking', but this package is now deprecated.`,\n ``,\n `To resolve this deprecation, follow these steps:`,\n hasEmberDataTracking\n ? `- remove \"@ember-data/tracking\" and (if needed) \"@ember-data-types/tracking\" from your project in both your package.json and tsconfig.json`\n : false,\n `- add \"@warp-drive/ember\" to your project in both your package.json and tsconfig.json`,\n '- add the following import to your app.js file:',\n '',\n '\\t```',\n `\\timport '@warp-drive/ember/install';`,\n '\\t```',\n ``,\n '- mark this deprecation as resolved in your project by adding the following to your WarpDrive config in ember-cli-build.js:',\n '',\n '\\t```',\n '\\tconst { setConfig } = await import(\"@warp-drive/build-config\");',\n '\\tsetConfig(app, __dirname, {',\n '\\t deprecations: {',\n '\\t DEPRECATE_TRACKING_PACKAGE: false,',\n '\\t },',\n '\\t});',\n '\\t```',\n ``,\n `For more information, see the Package Unification RFC: https://rfcs.emberjs.com/id/1075-warp-drive-package-unification/`,\n ]\n .filter((l) => l !== false)\n .join('\\n');\n\n deprecate(message, false, {\n id: 'warp-drive.deprecate-tracking-package',\n until: '6.0.0',\n for: 'warp-drive',\n since: {\n enabled: '5.3.4',\n available: '4.13',\n },\n url: 'https://deprecations.emberjs.com/id/warp-drive.deprecate-tracking-package',\n });\n}\n"],"names":["macroCondition","getGlobalConfig","WarpDrive","deprecations","DEPRECATE_TRACKING_PACKAGE","hasEmberDataTracking","dependencySatisfies","buildSignalConfig","importSync","setupSignals","message","filter","l","join","deprecate","id","until","for","since","enabled","available","url"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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AG,EAAE;AACP,GAAC,CAAC;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-data/store",
3
- "version": "5.6.0-alpha.0",
3
+ "version": "5.6.0-alpha.11",
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,20 +33,17 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@embroider/macros": "^1.16.12",
36
- "@warp-drive/build-config": "5.6.0-alpha.0"
36
+ "@warp-drive/core": "5.6.0-alpha.11"
37
37
  },
38
38
  "peerDependencies": {
39
- "ember-source": "3.28.12 || ^4.0.4 || ^5.0.0 || ^6.0.0",
40
- "@ember-data/request": "5.6.0-alpha.0",
41
- "@ember-data/request-utils": "5.6.0-alpha.0",
42
- "@warp-drive/core-types": "5.6.0-alpha.0",
43
- "@ember-data/tracking": "5.6.0-alpha.0"
39
+ "@ember-data/tracking": "5.6.0-alpha.11",
40
+ "@ember/test-waiters": "^3.1.0 || ^4.0.0"
44
41
  },
45
42
  "peerDependenciesMeta": {
46
43
  "@ember-data/tracking": {
47
44
  "optional": true
48
45
  },
49
- "ember-source": {
46
+ "@ember/test-waiters": {
50
47
  "optional": true
51
48
  }
52
49
  },
@@ -55,21 +52,13 @@
55
52
  "@babel/plugin-transform-typescript": "^7.27.0",
56
53
  "@babel/preset-env": "^7.26.9",
57
54
  "@babel/preset-typescript": "^7.27.0",
58
- "@ember-data/request": "5.6.0-alpha.0",
59
- "@ember-data/request-utils": "5.6.0-alpha.0",
60
- "@glimmer/component": "^2.0.0",
61
- "@warp-drive/core-types": "5.6.0-alpha.0",
62
- "@warp-drive/internal-config": "5.6.0-alpha.0",
63
- "@ember-data/tracking": "5.6.0-alpha.0",
64
- "decorator-transforms": "^2.3.0",
55
+ "@warp-drive/internal-config": "5.6.0-alpha.11",
56
+ "@ember-data/tracking": "5.6.0-alpha.11",
57
+ "@ember/test-waiters": "^4.1.0",
65
58
  "ember-source": "~6.3.0",
66
- "expect-type": "^1.2.1",
67
59
  "typescript": "^5.8.3",
68
60
  "vite": "^5.4.15"
69
61
  },
70
- "engines": {
71
- "node": ">= 18.20.8"
72
- },
73
62
  "volta": {
74
63
  "extends": "../../package.json"
75
64
  },
@@ -1,33 +1,4 @@
1
1
  declare module '@ember-data/store/-private' {
2
- /**
3
- @module @ember-data/store
4
- */
5
- export { Store, storeFor } from '@ember-data/store/-private/store-service';
6
- export { recordIdentifierFor } from '@ember-data/store/-private/caches/instance-cache';
7
- export { CacheHandler, type StoreRequestContext } from '@ember-data/store/-private/cache-handler/handler';
8
- export { type CachePolicy } from '@ember-data/store/-private/cache-handler/types';
9
- export { isStableIdentifier, isDocumentIdentifier } from '@ember-data/store/-private/caches/identifier-cache';
10
- export { constructResource } from '@ember-data/store/-private/utils/construct-resource';
11
- export type { ReactiveDocument as Document } from '@ember-data/store/-private/document';
12
- export type { InstanceCache } from '@ember-data/store/-private/caches/instance-cache';
13
- export type { FindRecordQuery, Request, SaveRecordMutation, RequestCacheRequestState, RequestStateService, } from '@ember-data/store/-private/network/request-cache';
14
- export type { CreateRecordProperties } from '@ember-data/store/-private/store-service';
15
- export { coerceId, ensureStringId } from '@ember-data/store/-private/utils/coerce-id';
16
- export type { NativeProxy } from '@ember-data/store/-private/record-arrays/native-proxy-type-fix';
17
- export { IdentifierArray as LiveArray, Collection as CollectionRecordArray, SOURCE, MUTATE, } from '@ember-data/store/-private/record-arrays/identifier-array';
18
- export { RecordArrayManager, fastPush } from '@ember-data/store/-private/managers/record-array-manager';
19
- export { _clearCaches } from '@ember-data/store/-private/caches/instance-cache';
20
- export { peekCache, removeRecordDataFor } from '@ember-data/store/-private/caches/cache-utils';
21
- export { setRecordIdentifier, StoreMap } from '@ember-data/store/-private/caches/instance-cache';
22
- export { setCacheFor } from '@ember-data/store/-private/caches/cache-utils';
23
- export { normalizeModelName as _deprecatingNormalize } from '@ember-data/store/-private/utils/normalize-model-name';
24
- export type { StoreRequestInput } from '@ember-data/store/-private/cache-handler/handler';
25
- export { RelatedCollection } from '@ember-data/store/-private/record-arrays/many-array';
26
- export { log, logGroup } from '@ember-data/store/-private/debug/utils';
27
- export { getPromiseState, type PromiseState } from '@ember-data/store/-private/new-core-tmp/promise-state';
28
- export { getRequestState, type RequestLoadingState, type RequestCacheRequestState as RequestState, } from '@ember-data/store/-private/new-core-tmp/request-state';
29
- export { createMemo, type SignalHooks } from '@ember-data/store/-private/new-core-tmp/reactivity/configure';
30
- export { memoized, gate, entangleSignal, defineSignal, defineNonEnumerableSignal, } from '@ember-data/store/-private/new-core-tmp/reactivity/signal';
31
- export { ARRAY_SIGNAL, OBJECT_SIGNAL, Signals, type WarpDriveSignal, peekInternalSignal, withSignalStore, notifyInternalSignal, consumeInternalSignal, getOrCreateInternalSignal, } from '@ember-data/store/-private/new-core-tmp/reactivity/internal';
2
+ export * from '@warp-drive/core/store/-private';
32
3
  }
33
4
  //# sourceMappingURL=-private.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"-private.d.ts","sourceRoot":"","sources":["../src/-private.ts"],"names":[],"mappings":"AAAA;;EAEE;AAEF,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC1F,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,YAAY,EAAE,gBAAgB,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACxE,YAAY,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEtE,YAAY,EACV,eAAe,EACf,OAAO,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AACnD,OAAO,EACL,YAAY,EACZ,aAAa,EACb,OAAO,EACP,KAAK,eAAe,EACpB,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,6CAA6C,CAAC"}
1
+ {"version":3,"file":"-private.d.ts","sourceRoot":"","sources":["../src/-private.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC"}
@@ -3,19 +3,15 @@ declare module '@ember-data/store/configure' {
3
3
  * Provides a configuration API for the reactivity system
4
4
  * that WarpDrive should use.
5
5
  *
6
- * @module @ember-data/store/configure
7
- * @main @ember-data/store/configure
6
+ * @module
8
7
  */
9
8
  /**
10
9
  * Configures the signals implementation to use. Supports multiple
11
10
  * implementations simultaneously.
12
11
  *
13
- * @method setupSignals
14
- * @static
15
- * @for @ember-data/store/configure
16
12
  * @public
17
13
  * @param {function} buildConfig - a function that takes options and returns a configuration object
18
14
  */
19
- export { setupSignals } from '@ember-data/store/-private/new-core-tmp/reactivity/configure';
15
+ export { setupSignals } from '@warp-drive/core/configure';
20
16
  }
21
17
  //# sourceMappingURL=configure.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../src/configure.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH;;;;;;;;;GASG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC"}
1
+ {"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../src/configure.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC"}