@ember-data/store 4.12.1 → 4.12.2
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, j as IDENTIFIER_ARRAY_TAG, I as IdentifierArray, M as MUTATE, I as RecordArray, R as RecordArrayManager, h as SOURCE, S as Store, _ as _clearCaches, e as coerceId, k as fastPush, i as isStableIdentifier, n as normalizeModelName, g as notifyArray, p as peekCache, r as recordIdentifierFor, l as removeRecordDataFor, c as setIdentifierForgetMethod, a as setIdentifierGenerationMethod, d as setIdentifierResetMethod, b as setIdentifierUpdateMethod, s as storeFor } from "./index-
|
|
1
|
+
export { f as AdapterPopulatedRecordArray, C as CacheHandler, j as IDENTIFIER_ARRAY_TAG, I as IdentifierArray, M as MUTATE, I as RecordArray, R as RecordArrayManager, h as SOURCE, S as Store, _ as _clearCaches, e as coerceId, k as fastPush, i as isStableIdentifier, n as normalizeModelName, g as notifyArray, p as peekCache, r as recordIdentifierFor, l as removeRecordDataFor, c as setIdentifierForgetMethod, a as setIdentifierGenerationMethod, d as setIdentifierResetMethod, b as setIdentifierUpdateMethod, s as storeFor } from "./index-0b6637cb";
|
|
@@ -5,7 +5,7 @@ import { getOwner, setOwner } from '@ember/application';
|
|
|
5
5
|
import EmberObject, { get, set } from '@ember/object';
|
|
6
6
|
import { _backburner } from '@ember/runloop';
|
|
7
7
|
import { tracked } from '@glimmer/tracking';
|
|
8
|
-
import {
|
|
8
|
+
import { addToTransaction, subscribe, addTransactionCB } from '@ember-data/tracking/-private';
|
|
9
9
|
import { tagForProperty } from '@ember/-internals/metal';
|
|
10
10
|
import { dependentKeyCompat } from '@ember/object/compat';
|
|
11
11
|
import { compare } from '@ember/utils';
|
|
@@ -200,6 +200,7 @@ function maybeUpdateUiObjects(store, request, options, document, isFromCache) {
|
|
|
200
200
|
return document;
|
|
201
201
|
}
|
|
202
202
|
const data = recordArrayManager.createArray({
|
|
203
|
+
type: request.url,
|
|
203
204
|
identifiers: document.data,
|
|
204
205
|
doc: document,
|
|
205
206
|
query: request
|
|
@@ -213,6 +214,7 @@ function maybeUpdateUiObjects(store, request, options, document, isFromCache) {
|
|
|
213
214
|
let managed = recordArrayManager._keyedArrays.get(identifier.lid);
|
|
214
215
|
if (!managed) {
|
|
215
216
|
managed = recordArrayManager.createArray({
|
|
217
|
+
type: identifier.lid,
|
|
216
218
|
identifiers: document.data,
|
|
217
219
|
doc: document
|
|
218
220
|
});
|
|
@@ -3856,7 +3858,7 @@ const MUTATE = Symbol('#update');
|
|
|
3856
3858
|
const NOTIFY = Symbol('#notify');
|
|
3857
3859
|
const IS_COLLECTION = Symbol.for('Collection');
|
|
3858
3860
|
function notifyArray(arr) {
|
|
3859
|
-
arr[IDENTIFIER_ARRAY_TAG]
|
|
3861
|
+
addToTransaction(arr[IDENTIFIER_ARRAY_TAG]);
|
|
3860
3862
|
if (macroCondition(getOwnConfig().deprecations.DEPRECATE_COMPUTED_CHAINS)) {
|
|
3861
3863
|
// eslint-disable-next-line
|
|
3862
3864
|
dirtyTag(tagForProperty(arr, 'length'));
|
|
@@ -3877,6 +3879,11 @@ let Tag = (_class = class Tag {
|
|
|
3877
3879
|
|
|
3878
3880
|
constructor() {
|
|
3879
3881
|
_initializerDefineProperty(this, "ref", _descriptor, this);
|
|
3882
|
+
if (macroCondition(getOwnConfig().env.DEBUG)) {
|
|
3883
|
+
const [arr, prop] = arguments;
|
|
3884
|
+
this._debug_base = arr.constructor.name + ':' + String(arr.modelName);
|
|
3885
|
+
this._debug_prop = prop;
|
|
3886
|
+
}
|
|
3880
3887
|
this.shouldReset = false;
|
|
3881
3888
|
this.t = false;
|
|
3882
3889
|
}
|
|
@@ -3996,7 +4003,6 @@ let IdentifierArray = (_class3 = class IdentifierArray {
|
|
|
3996
4003
|
this.isDestroyed = false;
|
|
3997
4004
|
this._updatingPromise = null;
|
|
3998
4005
|
this[IS_COLLECTION] = true;
|
|
3999
|
-
this[IDENTIFIER_ARRAY_TAG] = new Tag();
|
|
4000
4006
|
this[SOURCE] = void 0;
|
|
4001
4007
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
4002
4008
|
let self = this;
|
|
@@ -4004,6 +4010,8 @@ let IdentifierArray = (_class3 = class IdentifierArray {
|
|
|
4004
4010
|
this.store = options.store;
|
|
4005
4011
|
this._manager = options.manager;
|
|
4006
4012
|
this[SOURCE] = options.identifiers;
|
|
4013
|
+
// @ts-expect-error
|
|
4014
|
+
this[IDENTIFIER_ARRAY_TAG] = macroCondition(getOwnConfig().env.DEBUG) ? new Tag(this, 'length') : new Tag();
|
|
4007
4015
|
const store = options.store;
|
|
4008
4016
|
const boundFns = new Map();
|
|
4009
4017
|
const _TAG = this[IDENTIFIER_ARRAY_TAG];
|
|
@@ -6726,12 +6734,11 @@ class Store extends EmberObject {
|
|
|
6726
6734
|
// during unload
|
|
6727
6735
|
if (macroCondition(getOwnConfig().packages.HAS_GRAPH_PACKAGE)) {
|
|
6728
6736
|
const peekGraph = importSync('@ember-data/graph/-private').peekGraph;
|
|
6729
|
-
|
|
6737
|
+
const graph = peekGraph(this);
|
|
6730
6738
|
if (graph) {
|
|
6731
6739
|
graph.identifiers.clear();
|
|
6732
6740
|
}
|
|
6733
6741
|
}
|
|
6734
|
-
this.notifications.destroy();
|
|
6735
6742
|
this.recordArrayManager.clear();
|
|
6736
6743
|
this._instanceCache.clear();
|
|
6737
6744
|
} else {
|
|
@@ -7289,6 +7296,7 @@ class Store extends EmberObject {
|
|
|
7289
7296
|
graph.destroy();
|
|
7290
7297
|
}
|
|
7291
7298
|
}
|
|
7299
|
+
this.notifications.destroy();
|
|
7292
7300
|
this.recordArrayManager.destroy();
|
|
7293
7301
|
this.identifierCache.destroy();
|
|
7294
7302
|
this.unloadAll();
|