@ember-data/store 5.4.0-beta.12 → 5.4.0-beta.13

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, 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-CW2kp6Ua.js";
@@ -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
  });
@@ -5396,10 +5295,10 @@ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.ENABLE_LEGACY_SCHEMA
5396
5295
  })(this._schema) : {};
5397
5296
  deprecate(`Use \`store.schema\` instead of \`store.getSchemaDefinitionService()\``, false, {
5398
5297
  id: 'ember-data:schema-service-updates',
5399
- until: '5.0',
5298
+ until: '6.0',
5400
5299
  for: 'ember-data',
5401
5300
  since: {
5402
- available: '5.4',
5301
+ available: '4.13',
5403
5302
  enabled: '5.4'
5404
5303
  }
5405
5304
  });
@@ -5408,10 +5307,10 @@ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.ENABLE_LEGACY_SCHEMA
5408
5307
  Store.prototype.registerSchemaDefinitionService = function (schema) {
5409
5308
  deprecate(`Use \`store.createSchemaService\` instead of \`store.registerSchemaDefinitionService()\``, false, {
5410
5309
  id: 'ember-data:schema-service-updates',
5411
- until: '5.0',
5310
+ until: '6.0',
5412
5311
  for: 'ember-data',
5413
5312
  since: {
5414
- available: '5.4',
5313
+ available: '4.13',
5415
5314
  enabled: '5.4'
5416
5315
  }
5417
5316
  });
@@ -5420,10 +5319,10 @@ if (macroCondition(getGlobalConfig().WarpDrive.deprecations.ENABLE_LEGACY_SCHEMA
5420
5319
  Store.prototype.registerSchema = function (schema) {
5421
5320
  deprecate(`Use \`store.createSchemaService\` instead of \`store.registerSchema()\``, false, {
5422
5321
  id: 'ember-data:schema-service-updates',
5423
- until: '5.0',
5322
+ until: '6.0',
5424
5323
  for: 'ember-data',
5425
5324
  since: {
5426
- available: '5.4',
5325
+ available: '4.13',
5427
5326
  enabled: '5.4'
5428
5327
  }
5429
5328
  });