@ember-data/store 5.5.0-alpha.1 → 5.5.0-alpha.10

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/addon/-private.js CHANGED
@@ -1 +1 @@
1
- export { f as AdapterPopulatedRecordArray, C as CacheHandler, h as IDENTIFIER_ARRAY_TAG, I as IdentifierArray, M as MUTATE, I as RecordArray, R as RecordArrayManager, g as SOURCE, S as Store, m as StoreMap, _ as _clearCaches, e as coerceId, j as fastPush, i as isStableIdentifier, n as notifyArray, p as peekCache, r as recordIdentifierFor, k as removeRecordDataFor, o as setCacheFor, c as setIdentifierForgetMethod, a as setIdentifierGenerationMethod, d as setIdentifierResetMethod, b as setIdentifierUpdateMethod, l as setRecordIdentifier, s as storeFor } from "./store-service-aee9dd76";
1
+ export { f as AdapterPopulatedRecordArray, C as CacheHandler, h as IDENTIFIER_ARRAY_TAG, I as IdentifierArray, M as MUTATE, I as RecordArray, R as RecordArrayManager, g as SOURCE, S as Store, m as StoreMap, _ as _clearCaches, e as coerceId, j as fastPush, i as isStableIdentifier, n as notifyArray, p as peekCache, r as recordIdentifierFor, k as removeRecordDataFor, o as setCacheFor, c as setIdentifierForgetMethod, a as setIdentifierGenerationMethod, d as setIdentifierResetMethod, b as setIdentifierUpdateMethod, l as setRecordIdentifier, s as storeFor } from "./store-service-76b33f02";
package/addon/index.js CHANGED
@@ -1 +1 @@
1
- export { C as CacheHandler, S as default, r as recordIdentifierFor, c as setIdentifierForgetMethod, a as setIdentifierGenerationMethod, d as setIdentifierResetMethod, b as setIdentifierUpdateMethod, s as storeFor } from "./store-service-aee9dd76";
1
+ export { C as CacheHandler, S as default, r as recordIdentifierFor, c as setIdentifierForgetMethod, a as setIdentifierGenerationMethod, d as setIdentifierResetMethod, b as setIdentifierUpdateMethod, s as storeFor } from "./store-service-76b33f02";
@@ -1,8 +1,8 @@
1
- import { macroCondition, getOwnConfig } from '@embroider/macros';
2
1
  import { getOwner } from '@ember/application';
3
2
  import { assert, deprecate, warn } from '@ember/debug';
4
3
  import EmberObject from '@ember/object';
5
4
  import { tracked } from '@glimmer/tracking';
5
+ import { macroCondition, getOwnConfig } from '@embroider/macros';
6
6
  import { dasherize } from '@ember/string';
7
7
  import { _backburner } from '@ember/runloop';
8
8
  import { addToTransaction, subscribe, addTransactionCB } from '@ember-data/tracking/-private';
@@ -391,12 +391,10 @@ function copyDocumentProperties(target, source) {
391
391
  }
392
392
  }
393
393
 
394
- // Used by the store to normalize IDs entering the store. Despite the fact
395
- // that developers may provide IDs as numbers (e.g., `store.findRecord('person', 1)`),
396
- // it is important that internally we use strings, since IDs may be serialized
397
- // and lose type information. For example, Ember's router may put a record's
398
- // ID into the URL, and if we later try to deserialize that URL and find the
399
- // corresponding record, we will not know if it is a string or a number.
394
+ /**
395
+ @module @ember-data/store
396
+ */
397
+
400
398
  function coerceId(id) {
401
399
  if (macroCondition(getOwnConfig().deprecations.DEPRECATE_NON_STRICT_ID)) {
402
400
  let normalized;
@@ -1415,11 +1413,6 @@ function peekCache(instance) {
1415
1413
  }
1416
1414
  return null;
1417
1415
  }
1418
-
1419
- /**
1420
- @module @ember-data/store
1421
- */
1422
-
1423
1416
  const RecordCache = new Map();
1424
1417
  function peekRecordIdentifier(record) {
1425
1418
  return RecordCache.get(record);
@@ -2410,6 +2403,10 @@ class CacheManager {
2410
2403
  return _classPrivateFieldBase(this, _cache)[_cache].isDeletionCommitted(identifier);
2411
2404
  }
2412
2405
  }
2406
+
2407
+ /**
2408
+ * @module @ember-data/store
2409
+ */
2413
2410
  let tokenId = 0;
2414
2411
  const CacheOperations = new Set(['added', 'removed', 'state', 'updated']);
2415
2412
  function isCacheOperationValue(value) {
@@ -2625,8 +2622,10 @@ const IS_COLLECTION = Symbol.for('Collection');
2625
2622
  function notifyArray(arr) {
2626
2623
  addToTransaction(arr[IDENTIFIER_ARRAY_TAG]);
2627
2624
  if (macroCondition(getOwnConfig().deprecations.DEPRECATE_COMPUTED_CHAINS)) {
2625
+ // @ts-expect-error tagForProperty is mistyped to Tag instead of DirtyableTag
2628
2626
  // eslint-disable-next-line
2629
2627
  dirtyTag(tagForProperty(arr, 'length'));
2628
+ // @ts-expect-error tagForProperty is mistyped to Tag instead of DirtyableTag
2630
2629
  // eslint-disable-next-line
2631
2630
  dirtyTag(tagForProperty(arr, '[]'));
2632
2631
  }
@@ -3361,13 +3360,13 @@ function sync(array, changes, arraySet) {
3361
3360
  } else {
3362
3361
  if (arraySet.has(key)) {
3363
3362
  removes.push(key);
3363
+ arraySet.delete(key);
3364
3364
  }
3365
3365
  }
3366
3366
  });
3367
3367
  if (removes.length) {
3368
3368
  if (removes.length === state.length) {
3369
3369
  state.length = 0;
3370
- arraySet.clear();
3371
3370
  // changing the reference breaks the Proxy
3372
3371
  // state = array[SOURCE] = [];
3373
3372
  } else {
@@ -3394,6 +3393,9 @@ function sync(array, changes, arraySet) {
3394
3393
  }
3395
3394
  }
3396
3395
 
3396
+ /**
3397
+ * @module @ember-data/store
3398
+ */
3397
3399
  const Touching = Symbol('touching');
3398
3400
  const RequestPromise = Symbol('promise');
3399
3401
  const EMPTY_ARR = macroCondition(getOwnConfig().env.DEBUG) ? Object.freeze([]) : [];
@@ -3628,6 +3630,11 @@ function constructResource(type, id, lid) {
3628
3630
  }
3629
3631
  }
3630
3632
 
3633
+ /**
3634
+ @module @ember-data/store
3635
+ */
3636
+ // this import location is deprecated but breaks in 4.8 and older
3637
+
3631
3638
  /**
3632
3639
  * A Store coordinates interaction between your application, a [Cache](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache),
3633
3640
  * and sources of data (such as your API or a local persistence layer)