@ember-data/store 5.3.9 → 5.3.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 CHANGED
@@ -108,12 +108,9 @@ import RequestManager from '@ember-data/request';
108
108
  import Fetch from '@ember-data/request/fetch';
109
109
 
110
110
  export default class extends Store {
111
- constructor() {
112
- super(...arguments);
113
- this.requestManager = new RequestManager();
114
- this.requestManager.use([Fetch]);
115
- this.requestManager.useCache(CacheHandler);
116
- }
111
+ requestManager = new RequestManager()
112
+ .use([Fetch])
113
+ .useCache(CacheHandler);
117
114
  }
118
115
  ```
119
116
 
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, 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 "./handler-CET_Ja8V.js";
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 "./handler-DX830Swd.js";
@@ -1,6 +1,6 @@
1
1
  import { deprecate, warn } from '@ember/debug';
2
2
  import { macroCondition, getGlobalConfig, dependencySatisfies, importSync } from '@embroider/macros';
3
- import { SkipCache, EnableHydration } from '@warp-drive/core-types/request';
3
+ import { EnableHydration, SkipCache } from '@warp-drive/core-types/request';
4
4
  import { getOrSetGlobal, setTransient, peekTransient } from '@warp-drive/core-types/-private';
5
5
  import { CACHE_OWNER, DEBUG_STALE_CACHE_OWNER, DEBUG_CLIENT_ORIGINATED, DEBUG_IDENTIFIER_BUCKET } from '@warp-drive/core-types/identifier';
6
6
  import { dasherize } from '@ember-data/request-utils/string';
@@ -25,7 +25,7 @@ function coerceId(id) {
25
25
  until: '6.0',
26
26
  for: 'ember-data',
27
27
  since: {
28
- available: '5.3',
28
+ available: '4.13',
29
29
  enabled: '5.3'
30
30
  }
31
31
  });
@@ -60,7 +60,7 @@ function normalizeModelName(type) {
60
60
  until: '6.0',
61
61
  for: 'ember-data',
62
62
  since: {
63
- available: '5.3',
63
+ available: '4.13',
64
64
  enabled: '5.3'
65
65
  }
66
66
  });
@@ -2157,7 +2157,7 @@ class CacheManager {
2157
2157
  /**
2158
2158
  * @module @ember-data/store
2159
2159
  */
2160
- // eslint-disable-next-line no-restricted-imports
2160
+
2161
2161
  let tokenId = 0;
2162
2162
  const CacheOperations = new Set(['added', 'removed', 'state', 'updated', 'invalidated']);
2163
2163
  function isCacheOperationValue(value) {
@@ -2374,71 +2374,6 @@ class NotificationManager {
2374
2374
  */
2375
2375
 
2376
2376
  const NativeProxy = Proxy;
2377
- var __defProp = Object.defineProperty;
2378
- var __export = (target, all) => {
2379
- for (var name in all) __defProp(target, name, {
2380
- get: all[name],
2381
- enumerable: true
2382
- });
2383
- };
2384
-
2385
- // src/runtime.ts
2386
- var runtime_exports = {};
2387
- __export(runtime_exports, {
2388
- c: () => decorateClass,
2389
- f: () => decorateFieldV1,
2390
- g: () => decorateFieldV2,
2391
- i: () => initializeDeferredDecorator,
2392
- m: () => decorateMethodV1,
2393
- n: () => decorateMethodV2,
2394
- p: () => decoratePOJO
2395
- });
2396
- var deferred = /* @__PURE__ */new WeakMap();
2397
- function deferDecorator(proto, prop, desc) {
2398
- let map = deferred.get(proto);
2399
- if (!map) {
2400
- map = /* @__PURE__ */new Map();
2401
- deferred.set(proto, map);
2402
- }
2403
- map.set(prop, desc);
2404
- }
2405
- function findDeferredDecorator(target, prop) {
2406
- let cursor = target.prototype;
2407
- while (cursor) {
2408
- let desc = deferred.get(cursor)?.get(prop);
2409
- if (desc) {
2410
- return desc;
2411
- }
2412
- cursor = cursor.prototype;
2413
- }
2414
- }
2415
- function decorateFieldV1(target, prop, decorators, initializer) {
2416
- return decorateFieldV2(target.prototype, prop, decorators, initializer);
2417
- }
2418
- function decorateFieldV2(prototype, prop, decorators, initializer) {
2419
- let desc = {
2420
- configurable: true,
2421
- enumerable: true,
2422
- writable: true,
2423
- initializer: null
2424
- };
2425
- if (initializer) {
2426
- desc.initializer = initializer;
2427
- }
2428
- for (let decorator of decorators) {
2429
- desc = decorator(prototype, prop, desc) || desc;
2430
- }
2431
- if (desc.initializer === void 0) {
2432
- Object.defineProperty(prototype, prop, desc);
2433
- } else {
2434
- deferDecorator(prototype, prop, desc);
2435
- }
2436
- }
2437
- function decorateMethodV1({
2438
- prototype
2439
- }, prop, decorators) {
2440
- return decorateMethodV2(prototype, prop, decorators);
2441
- }
2442
2377
  function decorateMethodV2(prototype, prop, decorators) {
2443
2378
  const origDesc = Object.getOwnPropertyDescriptor(prototype, prop);
2444
2379
  let desc = {
@@ -2453,46 +2388,6 @@ function decorateMethodV2(prototype, prop, decorators) {
2453
2388
  }
2454
2389
  Object.defineProperty(prototype, prop, desc);
2455
2390
  }
2456
- function initializeDeferredDecorator(target, prop) {
2457
- let desc = findDeferredDecorator(target.constructor, prop);
2458
- if (desc) {
2459
- Object.defineProperty(target, prop, {
2460
- enumerable: desc.enumerable,
2461
- configurable: desc.configurable,
2462
- writable: desc.writable,
2463
- value: desc.initializer ? desc.initializer.call(target) : void 0
2464
- });
2465
- }
2466
- }
2467
- function decorateClass(target, decorators) {
2468
- return decorators.reduce((accum, decorator) => decorator(accum) || accum, target);
2469
- }
2470
- function decoratePOJO(pojo, decorated) {
2471
- for (let [type, prop, decorators] of decorated) {
2472
- if (type === "field") {
2473
- decoratePojoField(pojo, prop, decorators);
2474
- } else {
2475
- decorateMethodV2(pojo, prop, decorators);
2476
- }
2477
- }
2478
- return pojo;
2479
- }
2480
- function decoratePojoField(pojo, prop, decorators) {
2481
- let desc = {
2482
- configurable: true,
2483
- enumerable: true,
2484
- writable: true,
2485
- initializer: () => Object.getOwnPropertyDescriptor(pojo, prop)?.value
2486
- };
2487
- for (let decorator of decorators) {
2488
- desc = decorator(pojo, prop, desc) || desc;
2489
- }
2490
- if (desc.initializer) {
2491
- desc.value = desc.initializer.call(pojo);
2492
- delete desc.initializer;
2493
- }
2494
- Object.defineProperty(pojo, prop, desc);
2495
- }
2496
2391
 
2497
2392
  /**
2498
2393
  @module @ember-data/store
@@ -2788,7 +2683,6 @@ class IdentifierArray {
2788
2683
  }
2789
2684
  const original = target[index];
2790
2685
  const newIdentifier = extractIdentifierFromRecord$1(value);
2791
- target[index] = newIdentifier;
2792
2686
  macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
2793
2687
  if (!test) {
2794
2688
  throw new Error(`Expected a record`);
@@ -2917,7 +2811,11 @@ const desc = {
2917
2811
  enumerable: true,
2918
2812
  configurable: false,
2919
2813
  get: function () {
2920
- return this;
2814
+ // here to support computed chains
2815
+ // and {{#each}}
2816
+ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_COMPUTED_CHAINS)) {
2817
+ return this;
2818
+ }
2921
2819
  }
2922
2820
  };
2923
2821
  compat(desc);
@@ -3641,7 +3539,8 @@ const EmptyClass = class {
3641
3539
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
3642
3540
  constructor(args) {}
3643
3541
  };
3644
- const BaseClass = macroCondition(dependencySatisfies('ember-source', '*')) ? macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_STORE_EXTENDS_EMBER_OBJECT) ? importSync('@ember/object') : EmptyClass : EmptyClass;
3542
+ const _BaseClass = macroCondition(dependencySatisfies('ember-source', '*')) ? macroCondition(getGlobalConfig().WarpDrive.deprecations.DEPRECATE_STORE_EXTENDS_EMBER_OBJECT) ? importSync('@ember/object') : EmptyClass : EmptyClass;
3543
+ const BaseClass = _BaseClass.default ? _BaseClass.default : _BaseClass;
3645
3544
  if (BaseClass !== EmptyClass) {
3646
3545
  deprecate(`The Store class extending from EmberObject is deprecated.
3647
3546
  Please remove usage of EmberObject APIs and mark your class as not requiring it.
@@ -3663,7 +3562,7 @@ const app = new EmberApp(defaults, {
3663
3562
  until: '6.0',
3664
3563
  for: 'ember-data',
3665
3564
  since: {
3666
- available: '5.4',
3565
+ available: '4.13',
3667
3566
  enabled: '5.4'
3668
3567
  }
3669
3568
  });
@@ -3723,12 +3622,9 @@ class Store extends BaseClass {
3723
3622
  * import Fetch from '@ember-data/request/fetch';
3724
3623
  *
3725
3624
  * class extends Store {
3726
- * constructor() {
3727
- * super(...arguments);
3728
- * this.requestManager = new RequestManager();
3729
- * this.requestManager.use([Fetch]);
3730
- * this.requestManager.useCache(CacheHandler);
3731
- * }
3625
+ * requestManager = new RequestManager()
3626
+ * .use([Fetch])
3627
+ * .useCache(CacheHandler);
3732
3628
  * }
3733
3629
  * ```
3734
3630
  *
@@ -3970,7 +3866,7 @@ class Store extends BaseClass {
3970
3866
  // the user has had the chance to set the prop.
3971
3867
  const opts = {
3972
3868
  store: this,
3973
- [EnableHydration]: true
3869
+ [EnableHydration]: requestConfig[EnableHydration] ?? true
3974
3870
  };
3975
3871
  if (requestConfig.records) {
3976
3872
  const identifierCache = this.identifierCache;
@@ -5396,10 +5292,10 @@ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.ENABLE_LEGACY_SCHEMA
5396
5292
  })(this._schema) : {};
5397
5293
  deprecate(`Use \`store.schema\` instead of \`store.getSchemaDefinitionService()\``, false, {
5398
5294
  id: 'ember-data:schema-service-updates',
5399
- until: '5.0',
5295
+ until: '6.0',
5400
5296
  for: 'ember-data',
5401
5297
  since: {
5402
- available: '5.4',
5298
+ available: '4.13',
5403
5299
  enabled: '5.4'
5404
5300
  }
5405
5301
  });
@@ -5408,10 +5304,10 @@ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.ENABLE_LEGACY_SCHEMA
5408
5304
  Store.prototype.registerSchemaDefinitionService = function (schema) {
5409
5305
  deprecate(`Use \`store.createSchemaService\` instead of \`store.registerSchemaDefinitionService()\``, false, {
5410
5306
  id: 'ember-data:schema-service-updates',
5411
- until: '5.0',
5307
+ until: '6.0',
5412
5308
  for: 'ember-data',
5413
5309
  since: {
5414
- available: '5.4',
5310
+ available: '4.13',
5415
5311
  enabled: '5.4'
5416
5312
  }
5417
5313
  });
@@ -5420,10 +5316,10 @@ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.ENABLE_LEGACY_SCHEMA
5420
5316
  Store.prototype.registerSchema = function (schema) {
5421
5317
  deprecate(`Use \`store.createSchemaService\` instead of \`store.registerSchema()\``, false, {
5422
5318
  id: 'ember-data:schema-service-updates',
5423
- until: '5.0',
5319
+ until: '6.0',
5424
5320
  for: 'ember-data',
5425
5321
  since: {
5426
- available: '5.4',
5322
+ available: '4.13',
5427
5323
  enabled: '5.4'
5428
5324
  }
5429
5325
  });