@warp-drive/core 5.7.0-alpha.9 → 5.7.0
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/declarations/graph/-private/-diff.d.ts +7 -20
- package/declarations/graph/-private/-edge-definition.d.ts +3 -12
- package/declarations/graph/-private/-state.d.ts +0 -87
- package/declarations/graph/-private/-utils.d.ts +5 -11
- package/declarations/graph/-private/coerce-id.d.ts +0 -6
- package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +2 -14
- package/declarations/graph/-private/edges/collection.d.ts +10 -10
- package/declarations/graph/-private/edges/implicit.d.ts +5 -5
- package/declarations/graph/-private/edges/resource.d.ts +6 -7
- package/declarations/graph/-private/graph.d.ts +17 -51
- package/declarations/graph/-private/normalize-link.d.ts +0 -6
- package/declarations/graph/-private/operations/replace-related-records.d.ts +4 -59
- package/declarations/graph/-private/operations/update-relationship.d.ts +3 -7
- package/declarations/index.d.ts +1 -1
- package/declarations/reactive/-private/default-mode.d.ts +2 -2
- package/declarations/reactive/-private/document.d.ts +11 -27
- package/declarations/reactive/-private/fields/managed-array.d.ts +4 -6
- package/declarations/reactive/-private/fields/managed-object.d.ts +2 -8
- package/declarations/reactive/-private/fields/many-array-manager.d.ts +2 -2
- package/declarations/reactive/-private/hooks.d.ts +2 -2
- package/declarations/reactive/-private/record.d.ts +42 -30
- package/declarations/reactive/-private/schema.d.ts +11 -73
- package/declarations/reactive/-private/symbols.d.ts +2 -33
- package/declarations/reactive/-private.d.ts +1 -1
- package/declarations/reactive.d.ts +277 -1
- package/declarations/request/-private/context.d.ts +3 -5
- package/declarations/request/-private/fetch.d.ts +2 -2
- package/declarations/request/-private/manager.d.ts +24 -28
- package/declarations/request/-private/types.d.ts +22 -24
- package/declarations/request/-private/utils.d.ts +44 -2
- package/declarations/store/-private/cache-handler/handler.d.ts +2 -8
- package/declarations/store/-private/cache-handler/types.d.ts +10 -10
- package/declarations/store/-private/cache-handler/utils.d.ts +4 -5
- package/declarations/store/-private/caches/instance-cache.d.ts +21 -20
- package/declarations/store/-private/debug/utils.d.ts +1 -0
- package/declarations/store/-private/default-cache-policy.d.ts +25 -40
- package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +24 -15
- package/declarations/store/-private/{caches/identifier-cache.d.ts → managers/cache-key-manager.d.ts} +35 -53
- package/declarations/store/-private/managers/cache-manager.d.ts +46 -111
- package/declarations/store/-private/managers/notification-manager.d.ts +30 -45
- package/declarations/store/-private/managers/record-array-manager.d.ts +44 -41
- package/declarations/store/-private/network/request-cache.d.ts +21 -25
- package/declarations/store/-private/new-core-tmp/expensive-subscription.d.ts +24 -0
- package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +3 -41
- package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +14 -29
- package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +24 -3
- package/declarations/store/-private/new-core-tmp/request-state.d.ts +132 -37
- package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +51 -135
- package/declarations/store/-private/record-arrays/-utils.d.ts +80 -0
- package/declarations/store/-private/record-arrays/legacy-live-array.d.ts +81 -0
- package/declarations/store/-private/record-arrays/legacy-many-array.d.ts +133 -0
- package/declarations/store/-private/record-arrays/legacy-query.d.ts +81 -0
- package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +1 -124
- package/declarations/store/-private/record-arrays/resource-array.d.ts +67 -0
- package/declarations/store/-private/store-service.d.ts +156 -106
- package/declarations/store/-private/utils/coerce-id.d.ts +0 -6
- package/declarations/store/-private.d.ts +11 -13
- package/declarations/store/-types/q/cache-capabilities-manager.d.ts +15 -24
- package/declarations/store/-types/q/identifier.d.ts +9 -6
- package/declarations/store/-types/q/record-instance.d.ts +0 -1
- package/declarations/store/-types/q/schema-service.d.ts +9 -9
- package/declarations/store/-types/q/store.d.ts +6 -7
- package/declarations/store/deprecated/-private.d.ts +12 -24
- package/declarations/store/deprecated/store.d.ts +11 -16
- package/declarations/types/-private.d.ts +1 -1
- package/declarations/types/cache/aliases.d.ts +0 -11
- package/declarations/types/cache/change.d.ts +2 -2
- package/declarations/types/cache/mutations.d.ts +13 -37
- package/declarations/types/cache/operations.d.ts +115 -32
- package/declarations/types/cache/relationship.d.ts +4 -7
- package/declarations/types/cache.d.ts +51 -125
- package/declarations/types/graph.d.ts +12 -12
- package/declarations/types/identifier.d.ts +52 -78
- package/declarations/types/params.d.ts +2 -3
- package/declarations/types/request.d.ts +66 -42
- package/declarations/types/schema/concepts.d.ts +2 -2
- package/declarations/types/schema/fields.d.ts +30 -3
- package/declarations/types/spec/document.d.ts +6 -10
- package/declarations/types/spec/json-api-raw.d.ts +6 -9
- package/declarations/types.d.ts +0 -1
- package/declarations/utils/string.d.ts +2 -3
- package/dist/{configure-B48bFHOl.js → configure-C3x8YXzL.js} +5 -5
- package/dist/configure.js +1 -1
- package/dist/{context-COmAnXUQ.js → context-C_7OLieY.js} +48 -6
- package/dist/graph/-private.js +137 -144
- package/dist/index.js +25 -14
- package/dist/reactive/-private.js +1 -1
- package/dist/reactive.js +144 -1926
- package/dist/{request-state-CeN66aML.js → request-state-C955e0AL.js} +5968 -3033
- package/dist/request.js +1 -1
- package/dist/store/-private.js +2 -3
- package/dist/store.js +32 -44
- package/dist/{symbols-SIstXMLI.js → symbols-sql1_mdx.js} +3 -8
- package/dist/types/-private.js +1 -1
- package/dist/types/identifier.js +19 -45
- package/dist/types/request.js +45 -3
- package/dist/types/schema/fields.js +6 -0
- package/dist/utils/string.js +2 -2
- package/package.json +11 -11
- package/declarations/store/-private/caches/cache-utils.d.ts +0 -12
- package/declarations/store/-private/record-arrays/identifier-array.d.ts +0 -147
- package/declarations/store/-private/record-arrays/many-array.d.ts +0 -197
- package/dist/handler-SdXlte1w.js +0 -339
package/dist/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { setLogging, getRuntimeConfig } from './types/runtime.js';
|
|
2
|
-
import { a as cloneResponseProperties, I as IS_CACHE_HANDLER, b as assertValidRequest, e as executeNextHandler, d as getRequestResult, u as upgradePromise, s as setPromiseResult, f as clearRequestResult } from "./context-
|
|
2
|
+
import { a as cloneResponseProperties, I as IS_CACHE_HANDLER, b as assertValidRequest, e as executeNextHandler, d as getRequestResult, u as upgradePromise, s as setPromiseResult, f as clearRequestResult } from "./context-C_7OLieY.js";
|
|
3
3
|
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
4
|
-
import { w as waitFor } from "./configure-
|
|
4
|
+
import { w as waitFor } from "./configure-C3x8YXzL.js";
|
|
5
5
|
import { peekUniversalTransient, setUniversalTransient } from './types/-private.js';
|
|
6
|
-
|
|
7
|
-
export { C as CacheHandler } from "./
|
|
6
|
+
import { EnableHydration } from './types/request.js';
|
|
7
|
+
export { C as CacheHandler, S as Store, r as recordIdentifierFor, U as setIdentifierForgetMethod, Q as setIdentifierGenerationMethod, V as setIdentifierResetMethod, T as setIdentifierUpdateMethod, W as setKeyInfoForResource, s as storeFor } from "./request-state-C955e0AL.js";
|
|
8
8
|
import '@ember/debug';
|
|
9
9
|
import './utils/string.js';
|
|
10
|
+
import "./symbols-sql1_mdx.js";
|
|
10
11
|
|
|
11
12
|
// Lazily close over fetch to avoid breaking Mirage
|
|
12
13
|
const _fetch = typeof fetch !== 'undefined' ? (...args) => fetch(...args) : typeof FastBoot !== 'undefined' ? (...args) => FastBoot.require('node-fetch')(...args) : () => {
|
|
@@ -61,6 +62,9 @@ const Fetch = {
|
|
|
61
62
|
} else {
|
|
62
63
|
e.statusText = 'Unknown Network Error';
|
|
63
64
|
e.status = 0;
|
|
65
|
+
if (!(e instanceof DOMException)) {
|
|
66
|
+
e.code = 0;
|
|
67
|
+
}
|
|
64
68
|
e.isRequestError = true;
|
|
65
69
|
}
|
|
66
70
|
throw e;
|
|
@@ -184,7 +188,8 @@ function isDict(v) {
|
|
|
184
188
|
return v !== null && typeof v === 'object';
|
|
185
189
|
}
|
|
186
190
|
class RequestManager {
|
|
187
|
-
|
|
191
|
+
/** @internal */
|
|
192
|
+
|
|
188
193
|
/** @internal */
|
|
189
194
|
|
|
190
195
|
/**
|
|
@@ -202,6 +207,7 @@ class RequestManager {
|
|
|
202
207
|
Object.assign(this, options);
|
|
203
208
|
this._pending = new Map();
|
|
204
209
|
this._deduped = new Map();
|
|
210
|
+
this._handlers = [];
|
|
205
211
|
}
|
|
206
212
|
|
|
207
213
|
/**
|
|
@@ -218,13 +224,13 @@ class RequestManager {
|
|
|
218
224
|
if (this._hasCacheHandler) {
|
|
219
225
|
throw new Error(`\`RequestManager.useCache(<handler>)\` May only be invoked once.`);
|
|
220
226
|
}
|
|
221
|
-
if (Object.isFrozen(this
|
|
227
|
+
if (Object.isFrozen(this._handlers)) {
|
|
222
228
|
throw new Error(`\`RequestManager.useCache(<handler>)\` May only be invoked prior to any request having been made.`);
|
|
223
229
|
}
|
|
224
230
|
this._hasCacheHandler = true;
|
|
225
231
|
}
|
|
226
232
|
cacheHandler[IS_CACHE_HANDLER] = true;
|
|
227
|
-
this
|
|
233
|
+
this._handlers.unshift(cacheHandler);
|
|
228
234
|
return this;
|
|
229
235
|
}
|
|
230
236
|
|
|
@@ -236,11 +242,9 @@ class RequestManager {
|
|
|
236
242
|
* curry the request, or pass along a modified request.
|
|
237
243
|
*
|
|
238
244
|
* @public
|
|
239
|
-
* @param {Handler[]} newHandlers
|
|
240
|
-
* @return {ThisType}
|
|
241
245
|
*/
|
|
242
246
|
use(newHandlers) {
|
|
243
|
-
const handlers = this
|
|
247
|
+
const handlers = this._handlers;
|
|
244
248
|
if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
|
|
245
249
|
if (Object.isFrozen(handlers)) {
|
|
246
250
|
throw new Error(`Cannot add a Handler to a RequestManager after a request has been made`);
|
|
@@ -264,11 +268,9 @@ class RequestManager {
|
|
|
264
268
|
* Returns a Future that fulfills with a StructuredDocument
|
|
265
269
|
*
|
|
266
270
|
* @public
|
|
267
|
-
* @param {RequestInfo} request
|
|
268
|
-
* @return {Future}
|
|
269
271
|
*/
|
|
270
272
|
request(request) {
|
|
271
|
-
const handlers = this
|
|
273
|
+
const handlers = this._handlers;
|
|
272
274
|
if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
|
|
273
275
|
if (!Object.isFrozen(handlers)) {
|
|
274
276
|
Object.freeze(handlers);
|
|
@@ -287,7 +289,8 @@ class RequestManager {
|
|
|
287
289
|
stream: null,
|
|
288
290
|
hasRequestedStream: false,
|
|
289
291
|
id: requestId,
|
|
290
|
-
identifier: null
|
|
292
|
+
identifier: null,
|
|
293
|
+
requester: request[EnableHydration] && request.store ? request.store : this
|
|
291
294
|
};
|
|
292
295
|
const promise = executeNextHandler(handlers, request, 0, context);
|
|
293
296
|
|
|
@@ -360,6 +363,14 @@ class RequestManager {
|
|
|
360
363
|
}
|
|
361
364
|
}
|
|
362
365
|
|
|
366
|
+
/**
|
|
367
|
+
* This type exists for internal use only for
|
|
368
|
+
* where intimate contracts still exist either for
|
|
369
|
+
* the Test Suite or for Legacy code.
|
|
370
|
+
*
|
|
371
|
+
* @private
|
|
372
|
+
*/
|
|
373
|
+
|
|
363
374
|
/**
|
|
364
375
|
* @module
|
|
365
376
|
* @mergeModuleWith <project>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { C as Context } from "../symbols-sql1_mdx.js";
|