@ember-data/store 5.4.0-beta.16 → 5.4.0-beta.18

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/dist/-private.js CHANGED
@@ -1 +1 @@
1
- export { A as ARRAY_SIGNAL, C as CacheHandler, j as CollectionRecordArray, I as LiveArray, M as MUTATE, R as RecordArrayManager, v as RelatedCollection, 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, w as log, x as logGroup, n as notifyArray, p as peekCache, r as recordIdentifierFor, m as removeRecordDataFor, t as setCacheFor, o as setRecordIdentifier, s as storeFor } from "./many-array-V2cR1muR.js";
1
+ export { A as ARRAY_SIGNAL, C as CacheHandler, j as CollectionRecordArray, I as LiveArray, M as MUTATE, R as RecordArrayManager, v as RelatedCollection, 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, w as log, x as logGroup, n as notifyArray, p as peekCache, r as recordIdentifierFor, m as removeRecordDataFor, t as setCacheFor, o as setRecordIdentifier, s as storeFor } from "./many-array-uP6jS6_J.js";
package/dist/index.js CHANGED
@@ -1,4 +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, e as setKeyInfoForResource, s as storeFor } from "./many-array-V2cR1muR.js";
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-uP6jS6_J.js";
2
2
  import '@ember/debug';
3
3
  import '@embroider/macros';
4
4
  import '@ember-data/request-utils/string';
@@ -1,11 +1,11 @@
1
1
  import { deprecate, warn } from '@ember/debug';
2
2
  import { macroCondition, getGlobalConfig, dependencySatisfies, importSync } from '@embroider/macros';
3
- import { setLogging, getRuntimeConfig } from '@warp-drive/build-config/runtime';
4
3
  import { EnableHydration, SkipCache } from '@warp-drive/core-types/request';
4
+ import { setLogging, getRuntimeConfig } from '@warp-drive/core-types/runtime';
5
5
  import { getOrSetGlobal, peekTransient, setTransient } from '@warp-drive/core-types/-private';
6
6
  import { _backburner } from '@ember/runloop';
7
7
  import { defineSignal, createSignal, subscribe, createArrayTags, addToTransaction, addTransactionCB } from '@ember-data/tracking/-private';
8
- import { CACHE_OWNER, DEBUG_STALE_CACHE_OWNER, DEBUG_CLIENT_ORIGINATED, DEBUG_IDENTIFIER_BUCKET } from '@warp-drive/core-types/identifier';
8
+ import { CACHE_OWNER, DEBUG_STALE_CACHE_OWNER, DEBUG_IDENTIFIER_BUCKET, DEBUG_CLIENT_ORIGINATED } from '@warp-drive/core-types/identifier';
9
9
  import { dasherize } from '@ember-data/request-utils/string';
10
10
  import { compat } from '@ember-data/tracking';
11
11
 
@@ -662,15 +662,13 @@ function makeStableRecordIdentifier(recordIdentifier, bucket, clientOriginated)
662
662
  // we enforce immutability in dev
663
663
  // but preserve our ability to do controlled updates to the reference
664
664
  let wrapper = {
665
- get lid() {
666
- return recordIdentifier.lid;
667
- },
665
+ type: recordIdentifier.type,
666
+ lid: recordIdentifier.lid,
668
667
  get id() {
669
668
  return recordIdentifier.id;
670
- },
671
- get type() {
672
- return recordIdentifier.type;
673
- },
669
+ }
670
+ };
671
+ const proto = {
674
672
  get [CACHE_OWNER]() {
675
673
  return recordIdentifier[CACHE_OWNER];
676
674
  },
@@ -682,9 +680,15 @@ function makeStableRecordIdentifier(recordIdentifier, bucket, clientOriginated)
682
680
  },
683
681
  set [DEBUG_STALE_CACHE_OWNER](value) {
684
682
  recordIdentifier[DEBUG_STALE_CACHE_OWNER] = value;
683
+ },
684
+ get [DEBUG_CLIENT_ORIGINATED]() {
685
+ return clientOriginated;
686
+ },
687
+ get [DEBUG_IDENTIFIER_BUCKET]() {
688
+ return bucket;
685
689
  }
686
690
  };
687
- Object.defineProperty(wrapper, 'toString', {
691
+ Object.defineProperty(proto, 'toString', {
688
692
  enumerable: false,
689
693
  value: () => {
690
694
  const {
@@ -695,7 +699,7 @@ function makeStableRecordIdentifier(recordIdentifier, bucket, clientOriginated)
695
699
  return `${clientOriginated ? '[CLIENT_ORIGINATED] ' : ''}${String(type)}:${String(id)} (${lid})`;
696
700
  }
697
701
  });
698
- Object.defineProperty(wrapper, 'toJSON', {
702
+ Object.defineProperty(proto, 'toJSON', {
699
703
  enumerable: false,
700
704
  value: () => {
701
705
  const {
@@ -710,8 +714,7 @@ function makeStableRecordIdentifier(recordIdentifier, bucket, clientOriginated)
710
714
  };
711
715
  }
712
716
  });
713
- wrapper[DEBUG_CLIENT_ORIGINATED] = clientOriginated;
714
- wrapper[DEBUG_IDENTIFIER_BUCKET] = bucket;
717
+ Object.setPrototypeOf(wrapper, proto);
715
718
  DEBUG_MAP.set(wrapper, recordIdentifier);
716
719
  wrapper = freeze(wrapper);
717
720
  return wrapper;
@@ -2488,9 +2491,16 @@ class NotificationManager {
2488
2491
  }
2489
2492
  }
2490
2493
  }
2491
- } else if (macroCondition(getGlobalConfig().WarpDrive.activeLogging.LOG_METRIC_COUNTS)) {
2492
- if (getGlobalConfig().WarpDrive.debug.LOG_METRIC_COUNTS || globalThis.getWarpDriveRuntimeConfig().debug.LOG_METRIC_COUNTS) {
2493
- count(`DISCARDED notify ${'type' in identifier ? identifier.type : '<document>'} ${value} ${key}`);
2494
+ } else {
2495
+ if (macroCondition(getGlobalConfig().WarpDrive.activeLogging.LOG_NOTIFICATIONS)) {
2496
+ if (getGlobalConfig().WarpDrive.debug.LOG_NOTIFICATIONS || globalThis.getWarpDriveRuntimeConfig().debug.LOG_NOTIFICATIONS) {
2497
+ log('notify', 'discarded', `${'type' in identifier ? identifier.type : 'document'}`, identifier.lid, `${value}`, key || '');
2498
+ }
2499
+ }
2500
+ if (macroCondition(getGlobalConfig().WarpDrive.activeLogging.LOG_METRIC_COUNTS)) {
2501
+ if (getGlobalConfig().WarpDrive.debug.LOG_METRIC_COUNTS || globalThis.getWarpDriveRuntimeConfig().debug.LOG_METRIC_COUNTS) {
2502
+ count(`DISCARDED notify ${'type' in identifier ? identifier.type : '<document>'} ${value} ${key}`);
2503
+ }
2494
2504
  }
2495
2505
  }
2496
2506
  return hasSubscribers;
@@ -2920,6 +2930,15 @@ class IdentifierArray {
2920
2930
  return Array.prototype;
2921
2931
  }
2922
2932
  });
2933
+ if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
2934
+ Object.defineProperty(this, '__SHOW_ME_THE_DATA_(debug mode only)__', {
2935
+ enumerable: false,
2936
+ configurable: true,
2937
+ get() {
2938
+ return proxy.slice();
2939
+ }
2940
+ });
2941
+ }
2923
2942
  createArrayTags(proxy, _SIGNAL);
2924
2943
  this[NOTIFY] = this[NOTIFY].bind(proxy);
2925
2944
  return proxy;