@warp-drive/core 5.7.0-alpha.14 → 5.7.0-alpha.16

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 (69) hide show
  1. package/declarations/graph/-private/-diff.d.ts +8 -8
  2. package/declarations/graph/-private/-edge-definition.d.ts +2 -2
  3. package/declarations/graph/-private/-state.d.ts +2 -2
  4. package/declarations/graph/-private/-utils.d.ts +5 -5
  5. package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +3 -3
  6. package/declarations/graph/-private/edges/collection.d.ts +10 -10
  7. package/declarations/graph/-private/edges/implicit.d.ts +5 -5
  8. package/declarations/graph/-private/edges/resource.d.ts +5 -5
  9. package/declarations/graph/-private/graph.d.ts +15 -15
  10. package/declarations/graph/-private/operations/replace-related-records.d.ts +4 -4
  11. package/declarations/graph/-private/operations/update-relationship.d.ts +3 -3
  12. package/declarations/index.d.ts +1 -1
  13. package/declarations/reactive/-private/default-mode.d.ts +2 -2
  14. package/declarations/reactive/-private/document.d.ts +6 -16
  15. package/declarations/reactive/-private/fields/managed-array.d.ts +2 -2
  16. package/declarations/reactive/-private/fields/many-array-manager.d.ts +2 -2
  17. package/declarations/reactive/-private/hooks.d.ts +2 -2
  18. package/declarations/reactive/-private/record.d.ts +44 -5
  19. package/declarations/reactive/-private/schema.d.ts +12 -12
  20. package/declarations/reactive/-private/symbols.d.ts +1 -0
  21. package/declarations/reactive.d.ts +277 -1
  22. package/declarations/request/-private/context.d.ts +2 -2
  23. package/declarations/request/-private/manager.d.ts +2 -2
  24. package/declarations/request/-private/types.d.ts +4 -4
  25. package/declarations/store/-private/cache-handler/types.d.ts +9 -9
  26. package/declarations/store/-private/cache-handler/utils.d.ts +4 -4
  27. package/declarations/store/-private/caches/instance-cache.d.ts +18 -18
  28. package/declarations/store/-private/default-cache-policy.d.ts +25 -38
  29. package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +13 -11
  30. package/declarations/store/-private/{caches/identifier-cache.d.ts → managers/cache-key-manager.d.ts} +21 -19
  31. package/declarations/store/-private/managers/cache-manager.d.ts +46 -94
  32. package/declarations/store/-private/managers/notification-manager.d.ts +21 -22
  33. package/declarations/store/-private/managers/record-array-manager.d.ts +15 -15
  34. package/declarations/store/-private/network/request-cache.d.ts +11 -11
  35. package/declarations/store/-private/new-core-tmp/expensive-subscription.d.ts +24 -0
  36. package/declarations/store/-private/new-core-tmp/request-state.d.ts +1 -1
  37. package/declarations/store/-private/record-arrays/-utils.d.ts +3 -3
  38. package/declarations/store/-private/record-arrays/legacy-live-array.d.ts +2 -2
  39. package/declarations/store/-private/record-arrays/legacy-many-array.d.ts +2 -2
  40. package/declarations/store/-private/record-arrays/resource-array.d.ts +9 -9
  41. package/declarations/store/-private/store-service.d.ts +19 -16
  42. package/declarations/store/-private.d.ts +1 -1
  43. package/declarations/store/-types/q/cache-capabilities-manager.d.ts +15 -24
  44. package/declarations/store/-types/q/identifier.d.ts +9 -6
  45. package/declarations/store/-types/q/schema-service.d.ts +9 -9
  46. package/declarations/store/deprecated/-private.d.ts +5 -5
  47. package/declarations/types/-private.d.ts +1 -1
  48. package/declarations/types/cache/aliases.d.ts +2 -2
  49. package/declarations/types/cache/change.d.ts +2 -2
  50. package/declarations/types/cache/mutations.d.ts +13 -13
  51. package/declarations/types/cache/operations.d.ts +20 -20
  52. package/declarations/types/cache/relationship.d.ts +4 -4
  53. package/declarations/types/cache.d.ts +51 -113
  54. package/declarations/types/graph.d.ts +12 -12
  55. package/declarations/types/identifier.d.ts +60 -76
  56. package/declarations/types/request.d.ts +6 -6
  57. package/declarations/types/schema/concepts.d.ts +2 -2
  58. package/declarations/types/spec/document.d.ts +6 -6
  59. package/dist/graph/-private.js +125 -125
  60. package/dist/index.js +2 -2
  61. package/dist/reactive/-private.js +1 -1
  62. package/dist/reactive.js +126 -4
  63. package/dist/{request-state-CCrTjb0Z.js → request-state-CQ0Q6d1V.js} +3493 -3483
  64. package/dist/store/-private.js +1 -1
  65. package/dist/store.js +30 -43
  66. package/dist/{symbols-C5p2hcy9.js → symbols-sql1_mdx.js} +2 -1
  67. package/dist/types/-private.js +1 -1
  68. package/dist/types/identifier.js +19 -45
  69. package/package.json +3 -3
@@ -1,2 +1,2 @@
1
- export { C as CacheHandler, D as DISPOSE, R as RecordArrayManager, x as Signals, S as Store, g as StoreMap, _ as _clearCaches, n as _deprecatingNormalize, b as coerceId, c as constructResource, B as consumeInternalSignal, h as createLegacyManyArray, m as createRequestSubscription, v as defineGate, w as defineNonEnumerableSignal, u as defineSignal, e as ensureStringId, t as entangleSignal, f as fastPush, q as gate, E as getOrCreateInternalSignal, k as getPromiseState, o as getRequestState, a as isDocumentIdentifier, i as isStableIdentifier, l as log, j as logGroup, p as memoized, A as notifyInternalSignal, y as peekInternalSignal, r as recordIdentifierFor, d as setRecordIdentifier, s as storeFor, z as withSignalStore } from "../request-state-CCrTjb0Z.js";
1
+ export { C as CacheHandler, D as DISPOSE, R as RecordArrayManager, x as Signals, S as Store, g as StoreMap, _ as _clearCaches, n as _deprecatingNormalize, b as coerceId, c as constructResource, B as consumeInternalSignal, h as createLegacyManyArray, m as createRequestSubscription, v as defineGate, w as defineNonEnumerableSignal, u as defineSignal, e as ensureStringId, t as entangleSignal, f as fastPush, q as gate, E as getOrCreateInternalSignal, k as getPromiseState, o as getRequestState, a as isRequestKey, i as isResourceKey, l as log, j as logGroup, p as memoized, A as notifyInternalSignal, y as peekInternalSignal, r as recordIdentifierFor, d as setRecordIdentifier, s as storeFor, z as withSignalStore } from "../request-state-CQ0Q6d1V.js";
2
2
  export { A as ARRAY_SIGNAL, O as OBJECT_SIGNAL, c as createMemo, w as waitFor } from "../configure-B48bFHOl.js";
package/dist/store.js CHANGED
@@ -94,7 +94,7 @@ function parseCacheControlValue(stringToParse) {
94
94
  }
95
95
  return parsedValue;
96
96
  }
97
- function isExpired(identifier, request, config) {
97
+ function isExpired(cacheKey, request, config) {
98
98
  const {
99
99
  constraints
100
100
  } = config;
@@ -104,7 +104,7 @@ function isExpired(identifier, request, config) {
104
104
  if (macroCondition(getGlobalConfig().WarpDrive.activeLogging.LOG_CACHE_POLICY)) {
105
105
  if (getGlobalConfig().WarpDrive.debug.LOG_CACHE_POLICY || globalThis.getWarpDriveRuntimeConfig().debug.LOG_CACHE_POLICY) {
106
106
  // eslint-disable-next-line no-console
107
- console.log(`CachePolicy: ${identifier.lid} is ${result ? 'EXPIRED' : 'NOT expired'} because constraints.isExpired returned ${result}`);
107
+ console.log(`CachePolicy: ${cacheKey.lid} is ${result ? 'EXPIRED' : 'NOT expired'} because constraints.isExpired returned ${result}`);
108
108
  }
109
109
  }
110
110
  return result;
@@ -117,7 +117,7 @@ function isExpired(identifier, request, config) {
117
117
  if (macroCondition(getGlobalConfig().WarpDrive.activeLogging.LOG_CACHE_POLICY)) {
118
118
  if (getGlobalConfig().WarpDrive.debug.LOG_CACHE_POLICY || globalThis.getWarpDriveRuntimeConfig().debug.LOG_CACHE_POLICY) {
119
119
  // eslint-disable-next-line no-console
120
- console.log(`CachePolicy: ${identifier.lid} is EXPIRED because no headers were provided`);
120
+ console.log(`CachePolicy: ${cacheKey.lid} is EXPIRED because no headers were provided`);
121
121
  }
122
122
  }
123
123
 
@@ -138,7 +138,7 @@ function isExpired(identifier, request, config) {
138
138
  if (macroCondition(getGlobalConfig().WarpDrive.activeLogging.LOG_CACHE_POLICY)) {
139
139
  if (getGlobalConfig().WarpDrive.debug.LOG_CACHE_POLICY || globalThis.getWarpDriveRuntimeConfig().debug.LOG_CACHE_POLICY) {
140
140
  // eslint-disable-next-line no-console
141
- console.log(`CachePolicy: ${identifier.lid} is ${result ? 'EXPIRED' : 'NOT expired'} because the time set by X-WarpDrive-Expires header is ${result ? 'in the past' : 'in the future'}`);
141
+ console.log(`CachePolicy: ${cacheKey.lid} is ${result ? 'EXPIRED' : 'NOT expired'} because the time set by X-WarpDrive-Expires header is ${result ? 'in the past' : 'in the future'}`);
142
142
  }
143
143
  }
144
144
  return result;
@@ -174,7 +174,7 @@ function isExpired(identifier, request, config) {
174
174
  if (macroCondition(getGlobalConfig().WarpDrive.activeLogging.LOG_CACHE_POLICY)) {
175
175
  if (getGlobalConfig().WarpDrive.debug.LOG_CACHE_POLICY || globalThis.getWarpDriveRuntimeConfig().debug.LOG_CACHE_POLICY) {
176
176
  // eslint-disable-next-line no-console
177
- console.log(`CachePolicy: ${identifier.lid} is ${result ? 'EXPIRED' : 'NOT expired'} because the time set by Cache-Control header is ${result ? 'in the past' : 'in the future'}`);
177
+ console.log(`CachePolicy: ${cacheKey.lid} is ${result ? 'EXPIRED' : 'NOT expired'} because the time set by Cache-Control header is ${result ? 'in the past' : 'in the future'}`);
178
178
  }
179
179
  }
180
180
  return result;
@@ -192,7 +192,7 @@ function isExpired(identifier, request, config) {
192
192
  if (macroCondition(getGlobalConfig().WarpDrive.activeLogging.LOG_CACHE_POLICY)) {
193
193
  if (getGlobalConfig().WarpDrive.debug.LOG_CACHE_POLICY || globalThis.getWarpDriveRuntimeConfig().debug.LOG_CACHE_POLICY) {
194
194
  // eslint-disable-next-line no-console
195
- console.log(`CachePolicy: ${identifier.lid} is ${result ? 'EXPIRED' : 'NOT expired'} because the time set by Expires header is ${result ? 'in the past' : 'in the future'}`);
195
+ console.log(`CachePolicy: ${cacheKey.lid} is ${result ? 'EXPIRED' : 'NOT expired'} because the time set by Expires header is ${result ? 'in the past' : 'in the future'}`);
196
196
  }
197
197
  }
198
198
  return result;
@@ -205,7 +205,7 @@ function isExpired(identifier, request, config) {
205
205
  if (macroCondition(getGlobalConfig().WarpDrive.activeLogging.LOG_CACHE_POLICY)) {
206
206
  if (getGlobalConfig().WarpDrive.debug.LOG_CACHE_POLICY || globalThis.getWarpDriveRuntimeConfig().debug.LOG_CACHE_POLICY) {
207
207
  // eslint-disable-next-line no-console
208
- console.log(`CachePolicy: ${identifier.lid} is EXPIRED because no Date header was provided`);
208
+ console.log(`CachePolicy: ${cacheKey.lid} is EXPIRED because no Date header was provided`);
209
209
  }
210
210
  }
211
211
  return true;
@@ -222,7 +222,7 @@ function isExpired(identifier, request, config) {
222
222
  if (macroCondition(getGlobalConfig().WarpDrive.activeLogging.LOG_CACHE_POLICY)) {
223
223
  if (getGlobalConfig().WarpDrive.debug.LOG_CACHE_POLICY || globalThis.getWarpDriveRuntimeConfig().debug.LOG_CACHE_POLICY) {
224
224
  // eslint-disable-next-line no-console
225
- console.log(`CachePolicy: ${identifier.lid} is ${result ? 'EXPIRED' : 'NOT expired'} because the apiCacheHardExpires time since the response's Date header is ${result ? 'in the past' : 'in the future'}`);
225
+ console.log(`CachePolicy: ${cacheKey.lid} is ${result ? 'EXPIRED' : 'NOT expired'} because the apiCacheHardExpires time since the response's Date header is ${result ? 'in the past' : 'in the future'}`);
226
226
  }
227
227
  }
228
228
  return result;
@@ -263,7 +263,7 @@ function isExpired(identifier, request, config) {
263
263
  * request for that type is successful.
264
264
  *
265
265
  * For this to work, the `createRecord` request must include the `cacheOptions.types` array
266
- * with the types that should be invalidated, or its request should specify the identifiers
266
+ * with the types that should be invalidated, or its request should specify the ResourceKeys
267
267
  * of the records that are being created via `records`. Providing both is valid.
268
268
  *
269
269
  * > [!NOTE]
@@ -352,22 +352,20 @@ class DefaultCachePolicy {
352
352
  }
353
353
 
354
354
  /**
355
- * Invalidate a request by its identifier for a given store instance.
355
+ * Invalidate a request by its CacheKey for the given store instance.
356
356
  *
357
357
  * While the store argument may seem redundant, the CachePolicy
358
358
  * is designed to be shared across multiple stores / forks
359
359
  * of the store.
360
360
  *
361
361
  * ```ts
362
- * store.lifetimes.invalidateRequest(store, identifier);
362
+ * store.lifetimes.invalidateRequest(store, cacheKey);
363
363
  * ```
364
364
  *
365
365
  * @public
366
- * @param {StableDocumentIdentifier} identifier
367
- * @param {Store} store
368
366
  */
369
- invalidateRequest(identifier, store) {
370
- this._getStore(store).invalidated.add(identifier);
367
+ invalidateRequest(cacheKey, store) {
368
+ this._getStore(store).invalidated.add(cacheKey);
371
369
  }
372
370
 
373
371
  /**
@@ -386,8 +384,6 @@ class DefaultCachePolicy {
386
384
  * ```
387
385
  *
388
386
  * @public
389
- * @param {String} type
390
- * @param {Store} store
391
387
  */
392
388
  invalidateRequestsForType(type, store) {
393
389
  const storeCache = this._getStore(store);
@@ -414,13 +410,8 @@ class DefaultCachePolicy {
414
410
  * This method should not be invoked directly by consumers.
415
411
  *
416
412
  * @public
417
- * @param {ImmutableRequestInfo} request
418
- * @param {ImmutableResponse} response
419
- * @param {Store} store
420
- * @param {StableDocumentIdentifier | null} identifier
421
- * @return {void}
422
413
  */
423
- didRequest(request, response, identifier, store) {
414
+ didRequest(request, response, cacheKey, store) {
424
415
  // if this is a successful createRecord request, invalidate the cacheKey for the type
425
416
  if (request.op === 'createRecord') {
426
417
  const statusNumber = response?.status ?? 0;
@@ -437,15 +428,15 @@ class DefaultCachePolicy {
437
428
 
438
429
  // add this document's cacheKey to a map for all associated types
439
430
  // it is recommended to only use this for queries
440
- } else if (identifier && request.cacheOptions?.types?.length) {
431
+ } else if (cacheKey && request.cacheOptions?.types?.length) {
441
432
  const storeCache = this._getStore(store);
442
433
  request.cacheOptions?.types.forEach(type => {
443
434
  const set = storeCache.types.get(type);
444
435
  if (set) {
445
- set.add(identifier);
446
- storeCache.invalidated.delete(identifier);
436
+ set.add(cacheKey);
437
+ storeCache.invalidated.delete(cacheKey);
447
438
  } else {
448
- storeCache.types.set(type, new Set([identifier]));
439
+ storeCache.types.set(type, new Set([cacheKey]));
449
440
  }
450
441
  });
451
442
  }
@@ -463,28 +454,26 @@ class DefaultCachePolicy {
463
454
  * and the cache will be updated before returning the response.
464
455
  *
465
456
  * @public
466
- * @param {StableDocumentIdentifier} identifier
467
- * @param {Store} store
468
- * @return {Boolean} true if the request is considered hard expired
457
+ * @return true if the request is considered hard expired
469
458
  */
470
- isHardExpired(identifier, store) {
459
+ isHardExpired(cacheKey, store) {
471
460
  // if we are explicitly invalidated, we are hard expired
472
461
  const storeCache = this._getStore(store);
473
- if (storeCache.invalidated.has(identifier)) {
462
+ if (storeCache.invalidated.has(cacheKey)) {
474
463
  return true;
475
464
  }
476
465
  const cache = store.cache;
477
- const cached = cache.peekRequest(identifier);
466
+ const cached = cache.peekRequest(cacheKey);
478
467
  if (!cached?.response) {
479
468
  if (macroCondition(getGlobalConfig().WarpDrive.activeLogging.LOG_CACHE_POLICY)) {
480
469
  if (getGlobalConfig().WarpDrive.debug.LOG_CACHE_POLICY || globalThis.getWarpDriveRuntimeConfig().debug.LOG_CACHE_POLICY) {
481
470
  // eslint-disable-next-line no-console
482
- console.log(`CachePolicy: ${identifier.lid} is EXPIRED because no cache entry was found`);
471
+ console.log(`CachePolicy: ${cacheKey.lid} is EXPIRED because no cache entry was found`);
483
472
  }
484
473
  }
485
474
  return true;
486
475
  }
487
- return isExpired(identifier, cached, this.config);
476
+ return isExpired(cacheKey, cached, this.config);
488
477
  }
489
478
 
490
479
  /**
@@ -498,25 +487,23 @@ class DefaultCachePolicy {
498
487
  * request is made to update the cache via the configured request handlers.
499
488
  *
500
489
  * @public
501
- * @param {StableDocumentIdentifier} identifier
502
- * @param {Store} store
503
- * @return {Boolean} true if the request is considered soft expired
490
+ * @return true if the request is considered soft expired
504
491
  */
505
- isSoftExpired(identifier, store) {
492
+ isSoftExpired(cacheKey, store) {
506
493
  if (macroCondition(getGlobalConfig().WarpDrive.env.TESTING)) {
507
494
  if (!this.config.disableTestOptimization) {
508
495
  return false;
509
496
  }
510
497
  }
511
498
  const cache = store.cache;
512
- const cached = cache.peekRequest(identifier);
499
+ const cached = cache.peekRequest(cacheKey);
513
500
  if (cached?.response) {
514
501
  const date = cached.response.headers.get('date');
515
502
  if (!date) {
516
503
  if (macroCondition(getGlobalConfig().WarpDrive.activeLogging.LOG_CACHE_POLICY)) {
517
504
  if (getGlobalConfig().WarpDrive.debug.LOG_CACHE_POLICY || globalThis.getWarpDriveRuntimeConfig().debug.LOG_CACHE_POLICY) {
518
505
  // eslint-disable-next-line no-console
519
- console.log(`CachePolicy: ${identifier.lid} is STALE because no date header was found`);
506
+ console.log(`CachePolicy: ${cacheKey.lid} is STALE because no date header was found`);
520
507
  }
521
508
  }
522
509
  return true;
@@ -528,7 +515,7 @@ class DefaultCachePolicy {
528
515
  if (macroCondition(getGlobalConfig().WarpDrive.activeLogging.LOG_CACHE_POLICY)) {
529
516
  if (getGlobalConfig().WarpDrive.debug.LOG_CACHE_POLICY || globalThis.getWarpDriveRuntimeConfig().debug.LOG_CACHE_POLICY) {
530
517
  // eslint-disable-next-line no-console
531
- console.log(`CachePolicy: ${identifier.lid} is ${result ? 'STALE' : 'NOT stale'}. Expiration time: ${deadline}, now: ${now}`);
518
+ console.log(`CachePolicy: ${cacheKey.lid} is ${result ? 'STALE' : 'NOT stale'}. Expiration time: ${deadline}, now: ${now}`);
532
519
  }
533
520
  }
534
521
  return result;
@@ -537,7 +524,7 @@ class DefaultCachePolicy {
537
524
  if (macroCondition(getGlobalConfig().WarpDrive.activeLogging.LOG_CACHE_POLICY)) {
538
525
  if (getGlobalConfig().WarpDrive.debug.LOG_CACHE_POLICY || globalThis.getWarpDriveRuntimeConfig().debug.LOG_CACHE_POLICY) {
539
526
  // eslint-disable-next-line no-console
540
- console.log(`CachePolicy: ${identifier.lid} is STALE because no cache entry was found`);
527
+ console.log(`CachePolicy: ${cacheKey.lid} is STALE because no cache entry was found`);
541
528
  }
542
529
  }
543
530
  return true;
@@ -34,5 +34,6 @@ import { getOrSetGlobal } from './types/-private.js';
34
34
  const SOURCE = getOrSetGlobal('SOURCE', Symbol('#source'));
35
35
  const Destroy = getOrSetGlobal('Destroy', Symbol.dispose || Symbol.for('Dispose'));
36
36
  const Checkout = getOrSetGlobal('Checkout', Symbol('Checkout'));
37
+ const Commit = getOrSetGlobal('Commit', Symbol('Commit'));
37
38
  const Context = getOrSetGlobal('Context', Symbol('Context'));
38
- export { Context as C, Destroy as D, SOURCE as S, Checkout as a };
39
+ export { Context as C, Destroy as D, SOURCE as S, Checkout as a, Commit as b };
@@ -1,6 +1,6 @@
1
1
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
2
2
  const name = "@warp-drive/core";
3
- const version = "5.7.0-alpha.14";
3
+ const version = "5.7.0-alpha.16";
4
4
 
5
5
  // in testing mode, we utilize globals to ensure only one copy exists of
6
6
  // these maps, due to bugs in ember-auto-import
@@ -2,7 +2,7 @@ import { macroCondition, getGlobalConfig } from '@embroider/macros';
2
2
 
3
3
  // provided for additional debuggability
4
4
  const DEBUG_CLIENT_ORIGINATED = Symbol('record-originated-on-client');
5
- const DEBUG_IDENTIFIER_BUCKET = Symbol('identifier-bucket');
5
+ const DEBUG_KEY_TYPE = Symbol('key-type');
6
6
  const DEBUG_STALE_CACHE_OWNER = Symbol('warpDriveStaleCache');
7
7
  function ProdSymbol(str, debugStr) {
8
8
  return macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? Symbol(debugStr) : str;
@@ -12,78 +12,52 @@ function ProdSymbol(str, debugStr) {
12
12
  const CACHE_OWNER = ProdSymbol('__$co', 'CACHE_OWNER');
13
13
 
14
14
  /**
15
- * An Identifier specific to a record which may or may not
16
- * be present in the cache.
15
+ * A referentially stable object with a unique string (lid) that can be used
16
+ * as a reference to request data in the cache.
17
17
  *
18
- * The absence of an `id` DOES NOT indicate that this
19
- * Identifier is for a new client-created record as it
20
- * may also indicate that it was generated for a secondary
21
- * index and the primary `id` index is not yet known.
18
+ * Only requests that are assigned a RequestKey are retrievable/replayable from
19
+ * the cache, though requests without RequestKeys may still update cache state.
22
20
  *
23
- * @internal
21
+ * @public
24
22
  */
25
23
 
24
+ /** @deprecated use {@link RequestKey} */
25
+
26
26
  /**
27
- * Used when an Identifier is known to be the stable version
28
- *
29
- * @internal
27
+ * Used when an ResourceKey is known to be the stable version
30
28
  */
31
29
 
32
30
  /**
33
- * Used when a StableRecordIdentifier was not created locally as part
31
+ * Used when a ResourceKey was not created locally as part
34
32
  * of a call to store.createRecord
35
33
  *
36
- * Distinguishing between this Identifier and one for a client created
37
- * record that was created with an ID is generally speaking not possible
34
+ * Distinguishing between this ResourceKey and one for a client created
35
+ * resource that was created with an ID is generally speaking not possible
38
36
  * at runtime, so anything with an ID typically narrows to this.
39
- *
40
- * @internal
41
37
  */
42
38
 
39
+ /** @deprecated use {@link PersistedResourceKey} */
40
+
43
41
  /**
44
- * Used when a StableRecordIdentifier was created locally
42
+ * Used when a ResourceKey was created locally
45
43
  * (by a call to store.createRecord).
46
44
  *
47
- * It is possible in rare circumstances to have a StableRecordIdentifier
45
+ * It is possible in rare circumstances to have a ResourceKey
48
46
  * that is not for a new record but does not have an ID. This would
49
47
  * happen if a user intentionally created one for use with a secondary-index
50
48
  * prior to the record having been fully loaded.
51
- *
52
- * @internal
53
49
  */
54
50
 
55
51
  /**
56
52
  * A referentially stable object with a unique string (lid) that can be used
57
53
  * as a reference to data in the cache.
58
54
  *
59
- * Every record instance has a unique identifier, and identifiers may refer
55
+ * Every resource has a unique ResourceKey, and ResourceKeys may refer
60
56
  * to data that has never been loaded (for instance, in an async relationship).
61
57
  *
62
- * @class StableRecordIdentifier
63
58
  * @public
64
59
  */
65
60
 
66
- /**
67
- * A string representing a unique identity.
68
- *
69
- * @property lid
70
- * @type {String}
71
- * @public
72
- */
73
- /**
74
- * the primary resource `type` or `modelName` this identity belongs to.
75
- *
76
- * @property type
77
- * @type {String}
78
- * @public
79
- */
80
- /**
81
- * the primary id for the record this identity belongs to. `null`
82
- * if not yet assigned an id.
83
- *
84
- * @property id
85
- * @type {String | null}
86
- * @public
87
- */
61
+ /** @deprecated use {@link ResourceKey} */
88
62
 
89
- export { CACHE_OWNER, DEBUG_CLIENT_ORIGINATED, DEBUG_IDENTIFIER_BUCKET, DEBUG_STALE_CACHE_OWNER };
63
+ export { CACHE_OWNER, DEBUG_CLIENT_ORIGINATED, DEBUG_KEY_TYPE, DEBUG_STALE_CACHE_OWNER };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warp-drive/core",
3
- "version": "5.7.0-alpha.14",
3
+ "version": "5.7.0-alpha.16",
4
4
  "description": "Core package for WarpDrive | All the Universal Basics",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -37,13 +37,13 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@embroider/macros": "^1.16.12",
40
- "@warp-drive/build-config": "5.7.0-alpha.14"
40
+ "@warp-drive/build-config": "5.7.0-alpha.16"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@babel/core": "^7.26.10",
44
44
  "@babel/plugin-transform-typescript": "^7.27.0",
45
45
  "@babel/preset-typescript": "^7.27.0",
46
- "@warp-drive/internal-config": "5.7.0-alpha.14",
46
+ "@warp-drive/internal-config": "5.7.0-alpha.16",
47
47
  "decorator-transforms": "^2.3.0",
48
48
  "ember-source": "~6.3.0",
49
49
  "expect-type": "^1.2.1",