houdini-svelte 1.2.35 → 1.2.36
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/build/plugin-cjs/index.js +64 -62
- package/build/plugin-esm/index.js +64 -62
- package/build/preprocess-cjs/index.js +64 -62
- package/build/preprocess-esm/index.js +64 -62
- package/build/test-cjs/index.js +128 -124
- package/build/test-esm/index.js +128 -124
- package/package.json +2 -2
|
@@ -77025,11 +77025,10 @@ var InMemorySubscriptions = class {
|
|
|
77025
77025
|
constructor(cache) {
|
|
77026
77026
|
this.cache = cache;
|
|
77027
77027
|
}
|
|
77028
|
-
subscribers =
|
|
77029
|
-
referenceCounts = {};
|
|
77028
|
+
subscribers = /* @__PURE__ */ new Map();
|
|
77030
77029
|
keyVersions = {};
|
|
77031
77030
|
activeFields(parent2) {
|
|
77032
|
-
return Object.keys(this.subscribers
|
|
77031
|
+
return Object.keys(this.subscribers.get(parent2) || {});
|
|
77033
77032
|
}
|
|
77034
77033
|
add({
|
|
77035
77034
|
parent: parent2,
|
|
@@ -77103,27 +77102,28 @@ var InMemorySubscriptions = class {
|
|
|
77103
77102
|
type
|
|
77104
77103
|
}) {
|
|
77105
77104
|
const spec = selection[0];
|
|
77106
|
-
if (!this.subscribers
|
|
77107
|
-
this.subscribers
|
|
77105
|
+
if (!this.subscribers.has(id2)) {
|
|
77106
|
+
this.subscribers.set(id2, /* @__PURE__ */ new Map());
|
|
77108
77107
|
}
|
|
77109
|
-
|
|
77110
|
-
|
|
77108
|
+
const subscriber = this.subscribers.get(id2);
|
|
77109
|
+
if (!subscriber.has(key)) {
|
|
77110
|
+
subscriber.set(key, {
|
|
77111
|
+
selections: [],
|
|
77112
|
+
referenceCounts: /* @__PURE__ */ new Map()
|
|
77113
|
+
});
|
|
77111
77114
|
}
|
|
77115
|
+
const subscriberField = subscriber.get(key);
|
|
77112
77116
|
if (!this.keyVersions[key]) {
|
|
77113
77117
|
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
77114
77118
|
}
|
|
77115
77119
|
this.keyVersions[key].add(key);
|
|
77116
|
-
if (!
|
|
77117
|
-
|
|
77118
|
-
}
|
|
77119
|
-
if (!this.referenceCounts[id2]) {
|
|
77120
|
-
this.referenceCounts[id2] = {};
|
|
77121
|
-
}
|
|
77122
|
-
if (!this.referenceCounts[id2][key]) {
|
|
77123
|
-
this.referenceCounts[id2][key] = /* @__PURE__ */ new Map();
|
|
77120
|
+
if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
|
|
77121
|
+
subscriberField.selections.push([spec, selection[1]]);
|
|
77124
77122
|
}
|
|
77125
|
-
|
|
77126
|
-
|
|
77123
|
+
subscriberField.referenceCounts.set(
|
|
77124
|
+
spec.set,
|
|
77125
|
+
(subscriberField.referenceCounts.get(spec.set) || 0) + 1
|
|
77126
|
+
);
|
|
77127
77127
|
this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
|
|
77128
77128
|
}
|
|
77129
77129
|
registerList({
|
|
@@ -77210,7 +77210,7 @@ var InMemorySubscriptions = class {
|
|
|
77210
77210
|
}
|
|
77211
77211
|
}
|
|
77212
77212
|
get(id2, field) {
|
|
77213
|
-
return this.subscribers
|
|
77213
|
+
return this.subscribers.get(id2)?.get(field)?.selections || [];
|
|
77214
77214
|
}
|
|
77215
77215
|
remove(id2, selection, targets, variables, visited = []) {
|
|
77216
77216
|
visited.push(id2);
|
|
@@ -77236,24 +77236,24 @@ var InMemorySubscriptions = class {
|
|
|
77236
77236
|
}
|
|
77237
77237
|
}
|
|
77238
77238
|
reset() {
|
|
77239
|
-
const subscribers =
|
|
77240
|
-
([id2]) => !id2.startsWith(rootID)
|
|
77241
|
-
);
|
|
77239
|
+
const subscribers = [...this.subscribers.entries()].filter(([id2]) => !id2.startsWith(rootID));
|
|
77242
77240
|
for (const [id2, _fields] of subscribers) {
|
|
77243
|
-
|
|
77241
|
+
this.subscribers.delete(id2);
|
|
77244
77242
|
}
|
|
77245
77243
|
const subscriptionSpecs = subscribers.flatMap(
|
|
77246
|
-
([_id, fields]) =>
|
|
77244
|
+
([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
|
|
77247
77245
|
);
|
|
77248
77246
|
return subscriptionSpecs;
|
|
77249
77247
|
}
|
|
77250
77248
|
removeSubscribers(id2, fieldName, specs) {
|
|
77251
77249
|
let targets = [];
|
|
77250
|
+
const subscriber = this.subscribers.get(id2);
|
|
77251
|
+
const subscriberField = subscriber?.get(fieldName);
|
|
77252
77252
|
for (const spec of specs) {
|
|
77253
|
-
|
|
77253
|
+
const counts = subscriber?.get(fieldName)?.referenceCounts;
|
|
77254
|
+
if (!counts?.has(spec.set)) {
|
|
77254
77255
|
continue;
|
|
77255
77256
|
}
|
|
77256
|
-
const counts = this.referenceCounts[id2][fieldName];
|
|
77257
77257
|
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
77258
77258
|
counts.set(spec.set, newVal);
|
|
77259
77259
|
if (newVal <= 0) {
|
|
@@ -77261,18 +77261,19 @@ var InMemorySubscriptions = class {
|
|
|
77261
77261
|
counts.delete(spec.set);
|
|
77262
77262
|
}
|
|
77263
77263
|
}
|
|
77264
|
-
if (
|
|
77265
|
-
|
|
77264
|
+
if (subscriberField) {
|
|
77265
|
+
subscriberField.selections = this.get(id2, fieldName).filter(
|
|
77266
77266
|
([{ set }]) => !targets.includes(set)
|
|
77267
77267
|
);
|
|
77268
77268
|
}
|
|
77269
77269
|
}
|
|
77270
77270
|
removeAllSubscribers(id2, targets, visited = []) {
|
|
77271
77271
|
visited.push(id2);
|
|
77272
|
-
|
|
77273
|
-
|
|
77274
|
-
|
|
77275
|
-
|
|
77272
|
+
const subscriber = this.subscribers.get(id2);
|
|
77273
|
+
for (const [key, val] of subscriber?.entries() ?? []) {
|
|
77274
|
+
const subscribers = targets || val.selections.map(([spec]) => spec);
|
|
77275
|
+
this.removeSubscribers(id2, key, subscribers);
|
|
77276
|
+
const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, key);
|
|
77276
77277
|
if (kind === "scalar") {
|
|
77277
77278
|
continue;
|
|
77278
77279
|
}
|
|
@@ -142574,11 +142575,10 @@ var InMemorySubscriptions2 = class {
|
|
|
142574
142575
|
constructor(cache) {
|
|
142575
142576
|
this.cache = cache;
|
|
142576
142577
|
}
|
|
142577
|
-
subscribers =
|
|
142578
|
-
referenceCounts = {};
|
|
142578
|
+
subscribers = /* @__PURE__ */ new Map();
|
|
142579
142579
|
keyVersions = {};
|
|
142580
142580
|
activeFields(parent2) {
|
|
142581
|
-
return Object.keys(this.subscribers
|
|
142581
|
+
return Object.keys(this.subscribers.get(parent2) || {});
|
|
142582
142582
|
}
|
|
142583
142583
|
add({
|
|
142584
142584
|
parent: parent2,
|
|
@@ -142652,27 +142652,28 @@ var InMemorySubscriptions2 = class {
|
|
|
142652
142652
|
type
|
|
142653
142653
|
}) {
|
|
142654
142654
|
const spec = selection[0];
|
|
142655
|
-
if (!this.subscribers
|
|
142656
|
-
this.subscribers
|
|
142655
|
+
if (!this.subscribers.has(id2)) {
|
|
142656
|
+
this.subscribers.set(id2, /* @__PURE__ */ new Map());
|
|
142657
142657
|
}
|
|
142658
|
-
|
|
142659
|
-
|
|
142658
|
+
const subscriber = this.subscribers.get(id2);
|
|
142659
|
+
if (!subscriber.has(key)) {
|
|
142660
|
+
subscriber.set(key, {
|
|
142661
|
+
selections: [],
|
|
142662
|
+
referenceCounts: /* @__PURE__ */ new Map()
|
|
142663
|
+
});
|
|
142660
142664
|
}
|
|
142665
|
+
const subscriberField = subscriber.get(key);
|
|
142661
142666
|
if (!this.keyVersions[key]) {
|
|
142662
142667
|
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
142663
142668
|
}
|
|
142664
142669
|
this.keyVersions[key].add(key);
|
|
142665
|
-
if (!
|
|
142666
|
-
|
|
142667
|
-
}
|
|
142668
|
-
if (!this.referenceCounts[id2]) {
|
|
142669
|
-
this.referenceCounts[id2] = {};
|
|
142670
|
-
}
|
|
142671
|
-
if (!this.referenceCounts[id2][key]) {
|
|
142672
|
-
this.referenceCounts[id2][key] = /* @__PURE__ */ new Map();
|
|
142670
|
+
if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
|
|
142671
|
+
subscriberField.selections.push([spec, selection[1]]);
|
|
142673
142672
|
}
|
|
142674
|
-
|
|
142675
|
-
|
|
142673
|
+
subscriberField.referenceCounts.set(
|
|
142674
|
+
spec.set,
|
|
142675
|
+
(subscriberField.referenceCounts.get(spec.set) || 0) + 1
|
|
142676
|
+
);
|
|
142676
142677
|
this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
|
|
142677
142678
|
}
|
|
142678
142679
|
registerList({
|
|
@@ -142759,7 +142760,7 @@ var InMemorySubscriptions2 = class {
|
|
|
142759
142760
|
}
|
|
142760
142761
|
}
|
|
142761
142762
|
get(id2, field) {
|
|
142762
|
-
return this.subscribers
|
|
142763
|
+
return this.subscribers.get(id2)?.get(field)?.selections || [];
|
|
142763
142764
|
}
|
|
142764
142765
|
remove(id2, selection, targets, variables, visited = []) {
|
|
142765
142766
|
visited.push(id2);
|
|
@@ -142785,24 +142786,24 @@ var InMemorySubscriptions2 = class {
|
|
|
142785
142786
|
}
|
|
142786
142787
|
}
|
|
142787
142788
|
reset() {
|
|
142788
|
-
const subscribers =
|
|
142789
|
-
([id2]) => !id2.startsWith(rootID2)
|
|
142790
|
-
);
|
|
142789
|
+
const subscribers = [...this.subscribers.entries()].filter(([id2]) => !id2.startsWith(rootID2));
|
|
142791
142790
|
for (const [id2, _fields] of subscribers) {
|
|
142792
|
-
|
|
142791
|
+
this.subscribers.delete(id2);
|
|
142793
142792
|
}
|
|
142794
142793
|
const subscriptionSpecs = subscribers.flatMap(
|
|
142795
|
-
([_id, fields]) =>
|
|
142794
|
+
([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
|
|
142796
142795
|
);
|
|
142797
142796
|
return subscriptionSpecs;
|
|
142798
142797
|
}
|
|
142799
142798
|
removeSubscribers(id2, fieldName, specs) {
|
|
142800
142799
|
let targets = [];
|
|
142800
|
+
const subscriber = this.subscribers.get(id2);
|
|
142801
|
+
const subscriberField = subscriber?.get(fieldName);
|
|
142801
142802
|
for (const spec of specs) {
|
|
142802
|
-
|
|
142803
|
+
const counts = subscriber?.get(fieldName)?.referenceCounts;
|
|
142804
|
+
if (!counts?.has(spec.set)) {
|
|
142803
142805
|
continue;
|
|
142804
142806
|
}
|
|
142805
|
-
const counts = this.referenceCounts[id2][fieldName];
|
|
142806
142807
|
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
142807
142808
|
counts.set(spec.set, newVal);
|
|
142808
142809
|
if (newVal <= 0) {
|
|
@@ -142810,18 +142811,19 @@ var InMemorySubscriptions2 = class {
|
|
|
142810
142811
|
counts.delete(spec.set);
|
|
142811
142812
|
}
|
|
142812
142813
|
}
|
|
142813
|
-
if (
|
|
142814
|
-
|
|
142814
|
+
if (subscriberField) {
|
|
142815
|
+
subscriberField.selections = this.get(id2, fieldName).filter(
|
|
142815
142816
|
([{ set }]) => !targets.includes(set)
|
|
142816
142817
|
);
|
|
142817
142818
|
}
|
|
142818
142819
|
}
|
|
142819
142820
|
removeAllSubscribers(id2, targets, visited = []) {
|
|
142820
142821
|
visited.push(id2);
|
|
142821
|
-
|
|
142822
|
-
|
|
142823
|
-
|
|
142824
|
-
|
|
142822
|
+
const subscriber = this.subscribers.get(id2);
|
|
142823
|
+
for (const [key, val] of subscriber?.entries() ?? []) {
|
|
142824
|
+
const subscribers = targets || val.selections.map(([spec]) => spec);
|
|
142825
|
+
this.removeSubscribers(id2, key, subscribers);
|
|
142826
|
+
const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, key);
|
|
142825
142827
|
if (kind === "scalar") {
|
|
142826
142828
|
continue;
|
|
142827
142829
|
}
|
|
@@ -77020,11 +77020,10 @@ var InMemorySubscriptions = class {
|
|
|
77020
77020
|
constructor(cache) {
|
|
77021
77021
|
this.cache = cache;
|
|
77022
77022
|
}
|
|
77023
|
-
subscribers =
|
|
77024
|
-
referenceCounts = {};
|
|
77023
|
+
subscribers = /* @__PURE__ */ new Map();
|
|
77025
77024
|
keyVersions = {};
|
|
77026
77025
|
activeFields(parent2) {
|
|
77027
|
-
return Object.keys(this.subscribers
|
|
77026
|
+
return Object.keys(this.subscribers.get(parent2) || {});
|
|
77028
77027
|
}
|
|
77029
77028
|
add({
|
|
77030
77029
|
parent: parent2,
|
|
@@ -77098,27 +77097,28 @@ var InMemorySubscriptions = class {
|
|
|
77098
77097
|
type
|
|
77099
77098
|
}) {
|
|
77100
77099
|
const spec = selection[0];
|
|
77101
|
-
if (!this.subscribers
|
|
77102
|
-
this.subscribers
|
|
77100
|
+
if (!this.subscribers.has(id2)) {
|
|
77101
|
+
this.subscribers.set(id2, /* @__PURE__ */ new Map());
|
|
77103
77102
|
}
|
|
77104
|
-
|
|
77105
|
-
|
|
77103
|
+
const subscriber = this.subscribers.get(id2);
|
|
77104
|
+
if (!subscriber.has(key)) {
|
|
77105
|
+
subscriber.set(key, {
|
|
77106
|
+
selections: [],
|
|
77107
|
+
referenceCounts: /* @__PURE__ */ new Map()
|
|
77108
|
+
});
|
|
77106
77109
|
}
|
|
77110
|
+
const subscriberField = subscriber.get(key);
|
|
77107
77111
|
if (!this.keyVersions[key]) {
|
|
77108
77112
|
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
77109
77113
|
}
|
|
77110
77114
|
this.keyVersions[key].add(key);
|
|
77111
|
-
if (!
|
|
77112
|
-
|
|
77113
|
-
}
|
|
77114
|
-
if (!this.referenceCounts[id2]) {
|
|
77115
|
-
this.referenceCounts[id2] = {};
|
|
77116
|
-
}
|
|
77117
|
-
if (!this.referenceCounts[id2][key]) {
|
|
77118
|
-
this.referenceCounts[id2][key] = /* @__PURE__ */ new Map();
|
|
77115
|
+
if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
|
|
77116
|
+
subscriberField.selections.push([spec, selection[1]]);
|
|
77119
77117
|
}
|
|
77120
|
-
|
|
77121
|
-
|
|
77118
|
+
subscriberField.referenceCounts.set(
|
|
77119
|
+
spec.set,
|
|
77120
|
+
(subscriberField.referenceCounts.get(spec.set) || 0) + 1
|
|
77121
|
+
);
|
|
77122
77122
|
this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
|
|
77123
77123
|
}
|
|
77124
77124
|
registerList({
|
|
@@ -77205,7 +77205,7 @@ var InMemorySubscriptions = class {
|
|
|
77205
77205
|
}
|
|
77206
77206
|
}
|
|
77207
77207
|
get(id2, field) {
|
|
77208
|
-
return this.subscribers
|
|
77208
|
+
return this.subscribers.get(id2)?.get(field)?.selections || [];
|
|
77209
77209
|
}
|
|
77210
77210
|
remove(id2, selection, targets, variables, visited = []) {
|
|
77211
77211
|
visited.push(id2);
|
|
@@ -77231,24 +77231,24 @@ var InMemorySubscriptions = class {
|
|
|
77231
77231
|
}
|
|
77232
77232
|
}
|
|
77233
77233
|
reset() {
|
|
77234
|
-
const subscribers =
|
|
77235
|
-
([id2]) => !id2.startsWith(rootID)
|
|
77236
|
-
);
|
|
77234
|
+
const subscribers = [...this.subscribers.entries()].filter(([id2]) => !id2.startsWith(rootID));
|
|
77237
77235
|
for (const [id2, _fields] of subscribers) {
|
|
77238
|
-
|
|
77236
|
+
this.subscribers.delete(id2);
|
|
77239
77237
|
}
|
|
77240
77238
|
const subscriptionSpecs = subscribers.flatMap(
|
|
77241
|
-
([_id, fields]) =>
|
|
77239
|
+
([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
|
|
77242
77240
|
);
|
|
77243
77241
|
return subscriptionSpecs;
|
|
77244
77242
|
}
|
|
77245
77243
|
removeSubscribers(id2, fieldName, specs) {
|
|
77246
77244
|
let targets = [];
|
|
77245
|
+
const subscriber = this.subscribers.get(id2);
|
|
77246
|
+
const subscriberField = subscriber?.get(fieldName);
|
|
77247
77247
|
for (const spec of specs) {
|
|
77248
|
-
|
|
77248
|
+
const counts = subscriber?.get(fieldName)?.referenceCounts;
|
|
77249
|
+
if (!counts?.has(spec.set)) {
|
|
77249
77250
|
continue;
|
|
77250
77251
|
}
|
|
77251
|
-
const counts = this.referenceCounts[id2][fieldName];
|
|
77252
77252
|
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
77253
77253
|
counts.set(spec.set, newVal);
|
|
77254
77254
|
if (newVal <= 0) {
|
|
@@ -77256,18 +77256,19 @@ var InMemorySubscriptions = class {
|
|
|
77256
77256
|
counts.delete(spec.set);
|
|
77257
77257
|
}
|
|
77258
77258
|
}
|
|
77259
|
-
if (
|
|
77260
|
-
|
|
77259
|
+
if (subscriberField) {
|
|
77260
|
+
subscriberField.selections = this.get(id2, fieldName).filter(
|
|
77261
77261
|
([{ set }]) => !targets.includes(set)
|
|
77262
77262
|
);
|
|
77263
77263
|
}
|
|
77264
77264
|
}
|
|
77265
77265
|
removeAllSubscribers(id2, targets, visited = []) {
|
|
77266
77266
|
visited.push(id2);
|
|
77267
|
-
|
|
77268
|
-
|
|
77269
|
-
|
|
77270
|
-
|
|
77267
|
+
const subscriber = this.subscribers.get(id2);
|
|
77268
|
+
for (const [key, val] of subscriber?.entries() ?? []) {
|
|
77269
|
+
const subscribers = targets || val.selections.map(([spec]) => spec);
|
|
77270
|
+
this.removeSubscribers(id2, key, subscribers);
|
|
77271
|
+
const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, key);
|
|
77271
77272
|
if (kind === "scalar") {
|
|
77272
77273
|
continue;
|
|
77273
77274
|
}
|
|
@@ -142568,11 +142569,10 @@ var InMemorySubscriptions2 = class {
|
|
|
142568
142569
|
constructor(cache) {
|
|
142569
142570
|
this.cache = cache;
|
|
142570
142571
|
}
|
|
142571
|
-
subscribers =
|
|
142572
|
-
referenceCounts = {};
|
|
142572
|
+
subscribers = /* @__PURE__ */ new Map();
|
|
142573
142573
|
keyVersions = {};
|
|
142574
142574
|
activeFields(parent2) {
|
|
142575
|
-
return Object.keys(this.subscribers
|
|
142575
|
+
return Object.keys(this.subscribers.get(parent2) || {});
|
|
142576
142576
|
}
|
|
142577
142577
|
add({
|
|
142578
142578
|
parent: parent2,
|
|
@@ -142646,27 +142646,28 @@ var InMemorySubscriptions2 = class {
|
|
|
142646
142646
|
type
|
|
142647
142647
|
}) {
|
|
142648
142648
|
const spec = selection[0];
|
|
142649
|
-
if (!this.subscribers
|
|
142650
|
-
this.subscribers
|
|
142649
|
+
if (!this.subscribers.has(id2)) {
|
|
142650
|
+
this.subscribers.set(id2, /* @__PURE__ */ new Map());
|
|
142651
142651
|
}
|
|
142652
|
-
|
|
142653
|
-
|
|
142652
|
+
const subscriber = this.subscribers.get(id2);
|
|
142653
|
+
if (!subscriber.has(key)) {
|
|
142654
|
+
subscriber.set(key, {
|
|
142655
|
+
selections: [],
|
|
142656
|
+
referenceCounts: /* @__PURE__ */ new Map()
|
|
142657
|
+
});
|
|
142654
142658
|
}
|
|
142659
|
+
const subscriberField = subscriber.get(key);
|
|
142655
142660
|
if (!this.keyVersions[key]) {
|
|
142656
142661
|
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
142657
142662
|
}
|
|
142658
142663
|
this.keyVersions[key].add(key);
|
|
142659
|
-
if (!
|
|
142660
|
-
|
|
142661
|
-
}
|
|
142662
|
-
if (!this.referenceCounts[id2]) {
|
|
142663
|
-
this.referenceCounts[id2] = {};
|
|
142664
|
-
}
|
|
142665
|
-
if (!this.referenceCounts[id2][key]) {
|
|
142666
|
-
this.referenceCounts[id2][key] = /* @__PURE__ */ new Map();
|
|
142664
|
+
if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
|
|
142665
|
+
subscriberField.selections.push([spec, selection[1]]);
|
|
142667
142666
|
}
|
|
142668
|
-
|
|
142669
|
-
|
|
142667
|
+
subscriberField.referenceCounts.set(
|
|
142668
|
+
spec.set,
|
|
142669
|
+
(subscriberField.referenceCounts.get(spec.set) || 0) + 1
|
|
142670
|
+
);
|
|
142670
142671
|
this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
|
|
142671
142672
|
}
|
|
142672
142673
|
registerList({
|
|
@@ -142753,7 +142754,7 @@ var InMemorySubscriptions2 = class {
|
|
|
142753
142754
|
}
|
|
142754
142755
|
}
|
|
142755
142756
|
get(id2, field) {
|
|
142756
|
-
return this.subscribers
|
|
142757
|
+
return this.subscribers.get(id2)?.get(field)?.selections || [];
|
|
142757
142758
|
}
|
|
142758
142759
|
remove(id2, selection, targets, variables, visited = []) {
|
|
142759
142760
|
visited.push(id2);
|
|
@@ -142779,24 +142780,24 @@ var InMemorySubscriptions2 = class {
|
|
|
142779
142780
|
}
|
|
142780
142781
|
}
|
|
142781
142782
|
reset() {
|
|
142782
|
-
const subscribers =
|
|
142783
|
-
([id2]) => !id2.startsWith(rootID2)
|
|
142784
|
-
);
|
|
142783
|
+
const subscribers = [...this.subscribers.entries()].filter(([id2]) => !id2.startsWith(rootID2));
|
|
142785
142784
|
for (const [id2, _fields] of subscribers) {
|
|
142786
|
-
|
|
142785
|
+
this.subscribers.delete(id2);
|
|
142787
142786
|
}
|
|
142788
142787
|
const subscriptionSpecs = subscribers.flatMap(
|
|
142789
|
-
([_id, fields]) =>
|
|
142788
|
+
([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
|
|
142790
142789
|
);
|
|
142791
142790
|
return subscriptionSpecs;
|
|
142792
142791
|
}
|
|
142793
142792
|
removeSubscribers(id2, fieldName, specs) {
|
|
142794
142793
|
let targets = [];
|
|
142794
|
+
const subscriber = this.subscribers.get(id2);
|
|
142795
|
+
const subscriberField = subscriber?.get(fieldName);
|
|
142795
142796
|
for (const spec of specs) {
|
|
142796
|
-
|
|
142797
|
+
const counts = subscriber?.get(fieldName)?.referenceCounts;
|
|
142798
|
+
if (!counts?.has(spec.set)) {
|
|
142797
142799
|
continue;
|
|
142798
142800
|
}
|
|
142799
|
-
const counts = this.referenceCounts[id2][fieldName];
|
|
142800
142801
|
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
142801
142802
|
counts.set(spec.set, newVal);
|
|
142802
142803
|
if (newVal <= 0) {
|
|
@@ -142804,18 +142805,19 @@ var InMemorySubscriptions2 = class {
|
|
|
142804
142805
|
counts.delete(spec.set);
|
|
142805
142806
|
}
|
|
142806
142807
|
}
|
|
142807
|
-
if (
|
|
142808
|
-
|
|
142808
|
+
if (subscriberField) {
|
|
142809
|
+
subscriberField.selections = this.get(id2, fieldName).filter(
|
|
142809
142810
|
([{ set }]) => !targets.includes(set)
|
|
142810
142811
|
);
|
|
142811
142812
|
}
|
|
142812
142813
|
}
|
|
142813
142814
|
removeAllSubscribers(id2, targets, visited = []) {
|
|
142814
142815
|
visited.push(id2);
|
|
142815
|
-
|
|
142816
|
-
|
|
142817
|
-
|
|
142818
|
-
|
|
142816
|
+
const subscriber = this.subscribers.get(id2);
|
|
142817
|
+
for (const [key, val] of subscriber?.entries() ?? []) {
|
|
142818
|
+
const subscribers = targets || val.selections.map(([spec]) => spec);
|
|
142819
|
+
this.removeSubscribers(id2, key, subscribers);
|
|
142820
|
+
const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, key);
|
|
142819
142821
|
if (kind === "scalar") {
|
|
142820
142822
|
continue;
|
|
142821
142823
|
}
|