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
|
@@ -80359,11 +80359,10 @@ var InMemorySubscriptions = class {
|
|
|
80359
80359
|
constructor(cache) {
|
|
80360
80360
|
this.cache = cache;
|
|
80361
80361
|
}
|
|
80362
|
-
subscribers =
|
|
80363
|
-
referenceCounts = {};
|
|
80362
|
+
subscribers = /* @__PURE__ */ new Map();
|
|
80364
80363
|
keyVersions = {};
|
|
80365
80364
|
activeFields(parent2) {
|
|
80366
|
-
return Object.keys(this.subscribers
|
|
80365
|
+
return Object.keys(this.subscribers.get(parent2) || {});
|
|
80367
80366
|
}
|
|
80368
80367
|
add({
|
|
80369
80368
|
parent: parent2,
|
|
@@ -80437,27 +80436,28 @@ var InMemorySubscriptions = class {
|
|
|
80437
80436
|
type
|
|
80438
80437
|
}) {
|
|
80439
80438
|
const spec = selection[0];
|
|
80440
|
-
if (!this.subscribers
|
|
80441
|
-
this.subscribers
|
|
80439
|
+
if (!this.subscribers.has(id2)) {
|
|
80440
|
+
this.subscribers.set(id2, /* @__PURE__ */ new Map());
|
|
80442
80441
|
}
|
|
80443
|
-
|
|
80444
|
-
|
|
80442
|
+
const subscriber = this.subscribers.get(id2);
|
|
80443
|
+
if (!subscriber.has(key)) {
|
|
80444
|
+
subscriber.set(key, {
|
|
80445
|
+
selections: [],
|
|
80446
|
+
referenceCounts: /* @__PURE__ */ new Map()
|
|
80447
|
+
});
|
|
80445
80448
|
}
|
|
80449
|
+
const subscriberField = subscriber.get(key);
|
|
80446
80450
|
if (!this.keyVersions[key]) {
|
|
80447
80451
|
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
80448
80452
|
}
|
|
80449
80453
|
this.keyVersions[key].add(key);
|
|
80450
|
-
if (!
|
|
80451
|
-
|
|
80452
|
-
}
|
|
80453
|
-
if (!this.referenceCounts[id2]) {
|
|
80454
|
-
this.referenceCounts[id2] = {};
|
|
80455
|
-
}
|
|
80456
|
-
if (!this.referenceCounts[id2][key]) {
|
|
80457
|
-
this.referenceCounts[id2][key] = /* @__PURE__ */ new Map();
|
|
80454
|
+
if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
|
|
80455
|
+
subscriberField.selections.push([spec, selection[1]]);
|
|
80458
80456
|
}
|
|
80459
|
-
|
|
80460
|
-
|
|
80457
|
+
subscriberField.referenceCounts.set(
|
|
80458
|
+
spec.set,
|
|
80459
|
+
(subscriberField.referenceCounts.get(spec.set) || 0) + 1
|
|
80460
|
+
);
|
|
80461
80461
|
this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
|
|
80462
80462
|
}
|
|
80463
80463
|
registerList({
|
|
@@ -80544,7 +80544,7 @@ var InMemorySubscriptions = class {
|
|
|
80544
80544
|
}
|
|
80545
80545
|
}
|
|
80546
80546
|
get(id2, field) {
|
|
80547
|
-
return this.subscribers
|
|
80547
|
+
return this.subscribers.get(id2)?.get(field)?.selections || [];
|
|
80548
80548
|
}
|
|
80549
80549
|
remove(id2, selection, targets, variables, visited = []) {
|
|
80550
80550
|
visited.push(id2);
|
|
@@ -80570,24 +80570,24 @@ var InMemorySubscriptions = class {
|
|
|
80570
80570
|
}
|
|
80571
80571
|
}
|
|
80572
80572
|
reset() {
|
|
80573
|
-
const subscribers =
|
|
80574
|
-
([id2]) => !id2.startsWith(rootID)
|
|
80575
|
-
);
|
|
80573
|
+
const subscribers = [...this.subscribers.entries()].filter(([id2]) => !id2.startsWith(rootID));
|
|
80576
80574
|
for (const [id2, _fields] of subscribers) {
|
|
80577
|
-
|
|
80575
|
+
this.subscribers.delete(id2);
|
|
80578
80576
|
}
|
|
80579
80577
|
const subscriptionSpecs = subscribers.flatMap(
|
|
80580
|
-
([_id, fields]) =>
|
|
80578
|
+
([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
|
|
80581
80579
|
);
|
|
80582
80580
|
return subscriptionSpecs;
|
|
80583
80581
|
}
|
|
80584
80582
|
removeSubscribers(id2, fieldName, specs) {
|
|
80585
80583
|
let targets = [];
|
|
80584
|
+
const subscriber = this.subscribers.get(id2);
|
|
80585
|
+
const subscriberField = subscriber?.get(fieldName);
|
|
80586
80586
|
for (const spec of specs) {
|
|
80587
|
-
|
|
80587
|
+
const counts = subscriber?.get(fieldName)?.referenceCounts;
|
|
80588
|
+
if (!counts?.has(spec.set)) {
|
|
80588
80589
|
continue;
|
|
80589
80590
|
}
|
|
80590
|
-
const counts = this.referenceCounts[id2][fieldName];
|
|
80591
80591
|
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
80592
80592
|
counts.set(spec.set, newVal);
|
|
80593
80593
|
if (newVal <= 0) {
|
|
@@ -80595,18 +80595,19 @@ var InMemorySubscriptions = class {
|
|
|
80595
80595
|
counts.delete(spec.set);
|
|
80596
80596
|
}
|
|
80597
80597
|
}
|
|
80598
|
-
if (
|
|
80599
|
-
|
|
80598
|
+
if (subscriberField) {
|
|
80599
|
+
subscriberField.selections = this.get(id2, fieldName).filter(
|
|
80600
80600
|
([{ set }]) => !targets.includes(set)
|
|
80601
80601
|
);
|
|
80602
80602
|
}
|
|
80603
80603
|
}
|
|
80604
80604
|
removeAllSubscribers(id2, targets, visited = []) {
|
|
80605
80605
|
visited.push(id2);
|
|
80606
|
-
|
|
80607
|
-
|
|
80608
|
-
|
|
80609
|
-
|
|
80606
|
+
const subscriber = this.subscribers.get(id2);
|
|
80607
|
+
for (const [key, val] of subscriber?.entries() ?? []) {
|
|
80608
|
+
const subscribers = targets || val.selections.map(([spec]) => spec);
|
|
80609
|
+
this.removeSubscribers(id2, key, subscribers);
|
|
80610
|
+
const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, key);
|
|
80610
80611
|
if (kind === "scalar") {
|
|
80611
80612
|
continue;
|
|
80612
80613
|
}
|
|
@@ -174379,11 +174380,10 @@ var InMemorySubscriptions2 = class {
|
|
|
174379
174380
|
constructor(cache) {
|
|
174380
174381
|
this.cache = cache;
|
|
174381
174382
|
}
|
|
174382
|
-
subscribers =
|
|
174383
|
-
referenceCounts = {};
|
|
174383
|
+
subscribers = /* @__PURE__ */ new Map();
|
|
174384
174384
|
keyVersions = {};
|
|
174385
174385
|
activeFields(parent2) {
|
|
174386
|
-
return Object.keys(this.subscribers
|
|
174386
|
+
return Object.keys(this.subscribers.get(parent2) || {});
|
|
174387
174387
|
}
|
|
174388
174388
|
add({
|
|
174389
174389
|
parent: parent2,
|
|
@@ -174457,27 +174457,28 @@ var InMemorySubscriptions2 = class {
|
|
|
174457
174457
|
type
|
|
174458
174458
|
}) {
|
|
174459
174459
|
const spec = selection[0];
|
|
174460
|
-
if (!this.subscribers
|
|
174461
|
-
this.subscribers
|
|
174460
|
+
if (!this.subscribers.has(id2)) {
|
|
174461
|
+
this.subscribers.set(id2, /* @__PURE__ */ new Map());
|
|
174462
174462
|
}
|
|
174463
|
-
|
|
174464
|
-
|
|
174463
|
+
const subscriber = this.subscribers.get(id2);
|
|
174464
|
+
if (!subscriber.has(key)) {
|
|
174465
|
+
subscriber.set(key, {
|
|
174466
|
+
selections: [],
|
|
174467
|
+
referenceCounts: /* @__PURE__ */ new Map()
|
|
174468
|
+
});
|
|
174465
174469
|
}
|
|
174470
|
+
const subscriberField = subscriber.get(key);
|
|
174466
174471
|
if (!this.keyVersions[key]) {
|
|
174467
174472
|
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
174468
174473
|
}
|
|
174469
174474
|
this.keyVersions[key].add(key);
|
|
174470
|
-
if (!
|
|
174471
|
-
|
|
174472
|
-
}
|
|
174473
|
-
if (!this.referenceCounts[id2]) {
|
|
174474
|
-
this.referenceCounts[id2] = {};
|
|
174475
|
-
}
|
|
174476
|
-
if (!this.referenceCounts[id2][key]) {
|
|
174477
|
-
this.referenceCounts[id2][key] = /* @__PURE__ */ new Map();
|
|
174475
|
+
if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
|
|
174476
|
+
subscriberField.selections.push([spec, selection[1]]);
|
|
174478
174477
|
}
|
|
174479
|
-
|
|
174480
|
-
|
|
174478
|
+
subscriberField.referenceCounts.set(
|
|
174479
|
+
spec.set,
|
|
174480
|
+
(subscriberField.referenceCounts.get(spec.set) || 0) + 1
|
|
174481
|
+
);
|
|
174481
174482
|
this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
|
|
174482
174483
|
}
|
|
174483
174484
|
registerList({
|
|
@@ -174564,7 +174565,7 @@ var InMemorySubscriptions2 = class {
|
|
|
174564
174565
|
}
|
|
174565
174566
|
}
|
|
174566
174567
|
get(id2, field) {
|
|
174567
|
-
return this.subscribers
|
|
174568
|
+
return this.subscribers.get(id2)?.get(field)?.selections || [];
|
|
174568
174569
|
}
|
|
174569
174570
|
remove(id2, selection, targets, variables, visited = []) {
|
|
174570
174571
|
visited.push(id2);
|
|
@@ -174590,24 +174591,24 @@ var InMemorySubscriptions2 = class {
|
|
|
174590
174591
|
}
|
|
174591
174592
|
}
|
|
174592
174593
|
reset() {
|
|
174593
|
-
const subscribers =
|
|
174594
|
-
([id2]) => !id2.startsWith(rootID2)
|
|
174595
|
-
);
|
|
174594
|
+
const subscribers = [...this.subscribers.entries()].filter(([id2]) => !id2.startsWith(rootID2));
|
|
174596
174595
|
for (const [id2, _fields] of subscribers) {
|
|
174597
|
-
|
|
174596
|
+
this.subscribers.delete(id2);
|
|
174598
174597
|
}
|
|
174599
174598
|
const subscriptionSpecs = subscribers.flatMap(
|
|
174600
|
-
([_id, fields]) =>
|
|
174599
|
+
([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
|
|
174601
174600
|
);
|
|
174602
174601
|
return subscriptionSpecs;
|
|
174603
174602
|
}
|
|
174604
174603
|
removeSubscribers(id2, fieldName, specs) {
|
|
174605
174604
|
let targets = [];
|
|
174605
|
+
const subscriber = this.subscribers.get(id2);
|
|
174606
|
+
const subscriberField = subscriber?.get(fieldName);
|
|
174606
174607
|
for (const spec of specs) {
|
|
174607
|
-
|
|
174608
|
+
const counts = subscriber?.get(fieldName)?.referenceCounts;
|
|
174609
|
+
if (!counts?.has(spec.set)) {
|
|
174608
174610
|
continue;
|
|
174609
174611
|
}
|
|
174610
|
-
const counts = this.referenceCounts[id2][fieldName];
|
|
174611
174612
|
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
174612
174613
|
counts.set(spec.set, newVal);
|
|
174613
174614
|
if (newVal <= 0) {
|
|
@@ -174615,18 +174616,19 @@ var InMemorySubscriptions2 = class {
|
|
|
174615
174616
|
counts.delete(spec.set);
|
|
174616
174617
|
}
|
|
174617
174618
|
}
|
|
174618
|
-
if (
|
|
174619
|
-
|
|
174619
|
+
if (subscriberField) {
|
|
174620
|
+
subscriberField.selections = this.get(id2, fieldName).filter(
|
|
174620
174621
|
([{ set }]) => !targets.includes(set)
|
|
174621
174622
|
);
|
|
174622
174623
|
}
|
|
174623
174624
|
}
|
|
174624
174625
|
removeAllSubscribers(id2, targets, visited = []) {
|
|
174625
174626
|
visited.push(id2);
|
|
174626
|
-
|
|
174627
|
-
|
|
174628
|
-
|
|
174629
|
-
|
|
174627
|
+
const subscriber = this.subscribers.get(id2);
|
|
174628
|
+
for (const [key, val] of subscriber?.entries() ?? []) {
|
|
174629
|
+
const subscribers = targets || val.selections.map(([spec]) => spec);
|
|
174630
|
+
this.removeSubscribers(id2, key, subscribers);
|
|
174631
|
+
const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, key);
|
|
174630
174632
|
if (kind === "scalar") {
|
|
174631
174633
|
continue;
|
|
174632
174634
|
}
|
|
@@ -80356,11 +80356,10 @@ var InMemorySubscriptions = class {
|
|
|
80356
80356
|
constructor(cache) {
|
|
80357
80357
|
this.cache = cache;
|
|
80358
80358
|
}
|
|
80359
|
-
subscribers =
|
|
80360
|
-
referenceCounts = {};
|
|
80359
|
+
subscribers = /* @__PURE__ */ new Map();
|
|
80361
80360
|
keyVersions = {};
|
|
80362
80361
|
activeFields(parent2) {
|
|
80363
|
-
return Object.keys(this.subscribers
|
|
80362
|
+
return Object.keys(this.subscribers.get(parent2) || {});
|
|
80364
80363
|
}
|
|
80365
80364
|
add({
|
|
80366
80365
|
parent: parent2,
|
|
@@ -80434,27 +80433,28 @@ var InMemorySubscriptions = class {
|
|
|
80434
80433
|
type
|
|
80435
80434
|
}) {
|
|
80436
80435
|
const spec = selection[0];
|
|
80437
|
-
if (!this.subscribers
|
|
80438
|
-
this.subscribers
|
|
80436
|
+
if (!this.subscribers.has(id2)) {
|
|
80437
|
+
this.subscribers.set(id2, /* @__PURE__ */ new Map());
|
|
80439
80438
|
}
|
|
80440
|
-
|
|
80441
|
-
|
|
80439
|
+
const subscriber = this.subscribers.get(id2);
|
|
80440
|
+
if (!subscriber.has(key)) {
|
|
80441
|
+
subscriber.set(key, {
|
|
80442
|
+
selections: [],
|
|
80443
|
+
referenceCounts: /* @__PURE__ */ new Map()
|
|
80444
|
+
});
|
|
80442
80445
|
}
|
|
80446
|
+
const subscriberField = subscriber.get(key);
|
|
80443
80447
|
if (!this.keyVersions[key]) {
|
|
80444
80448
|
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
80445
80449
|
}
|
|
80446
80450
|
this.keyVersions[key].add(key);
|
|
80447
|
-
if (!
|
|
80448
|
-
|
|
80449
|
-
}
|
|
80450
|
-
if (!this.referenceCounts[id2]) {
|
|
80451
|
-
this.referenceCounts[id2] = {};
|
|
80452
|
-
}
|
|
80453
|
-
if (!this.referenceCounts[id2][key]) {
|
|
80454
|
-
this.referenceCounts[id2][key] = /* @__PURE__ */ new Map();
|
|
80451
|
+
if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
|
|
80452
|
+
subscriberField.selections.push([spec, selection[1]]);
|
|
80455
80453
|
}
|
|
80456
|
-
|
|
80457
|
-
|
|
80454
|
+
subscriberField.referenceCounts.set(
|
|
80455
|
+
spec.set,
|
|
80456
|
+
(subscriberField.referenceCounts.get(spec.set) || 0) + 1
|
|
80457
|
+
);
|
|
80458
80458
|
this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
|
|
80459
80459
|
}
|
|
80460
80460
|
registerList({
|
|
@@ -80541,7 +80541,7 @@ var InMemorySubscriptions = class {
|
|
|
80541
80541
|
}
|
|
80542
80542
|
}
|
|
80543
80543
|
get(id2, field) {
|
|
80544
|
-
return this.subscribers
|
|
80544
|
+
return this.subscribers.get(id2)?.get(field)?.selections || [];
|
|
80545
80545
|
}
|
|
80546
80546
|
remove(id2, selection, targets, variables, visited = []) {
|
|
80547
80547
|
visited.push(id2);
|
|
@@ -80567,24 +80567,24 @@ var InMemorySubscriptions = class {
|
|
|
80567
80567
|
}
|
|
80568
80568
|
}
|
|
80569
80569
|
reset() {
|
|
80570
|
-
const subscribers =
|
|
80571
|
-
([id2]) => !id2.startsWith(rootID)
|
|
80572
|
-
);
|
|
80570
|
+
const subscribers = [...this.subscribers.entries()].filter(([id2]) => !id2.startsWith(rootID));
|
|
80573
80571
|
for (const [id2, _fields] of subscribers) {
|
|
80574
|
-
|
|
80572
|
+
this.subscribers.delete(id2);
|
|
80575
80573
|
}
|
|
80576
80574
|
const subscriptionSpecs = subscribers.flatMap(
|
|
80577
|
-
([_id, fields]) =>
|
|
80575
|
+
([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
|
|
80578
80576
|
);
|
|
80579
80577
|
return subscriptionSpecs;
|
|
80580
80578
|
}
|
|
80581
80579
|
removeSubscribers(id2, fieldName, specs) {
|
|
80582
80580
|
let targets = [];
|
|
80581
|
+
const subscriber = this.subscribers.get(id2);
|
|
80582
|
+
const subscriberField = subscriber?.get(fieldName);
|
|
80583
80583
|
for (const spec of specs) {
|
|
80584
|
-
|
|
80584
|
+
const counts = subscriber?.get(fieldName)?.referenceCounts;
|
|
80585
|
+
if (!counts?.has(spec.set)) {
|
|
80585
80586
|
continue;
|
|
80586
80587
|
}
|
|
80587
|
-
const counts = this.referenceCounts[id2][fieldName];
|
|
80588
80588
|
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
80589
80589
|
counts.set(spec.set, newVal);
|
|
80590
80590
|
if (newVal <= 0) {
|
|
@@ -80592,18 +80592,19 @@ var InMemorySubscriptions = class {
|
|
|
80592
80592
|
counts.delete(spec.set);
|
|
80593
80593
|
}
|
|
80594
80594
|
}
|
|
80595
|
-
if (
|
|
80596
|
-
|
|
80595
|
+
if (subscriberField) {
|
|
80596
|
+
subscriberField.selections = this.get(id2, fieldName).filter(
|
|
80597
80597
|
([{ set }]) => !targets.includes(set)
|
|
80598
80598
|
);
|
|
80599
80599
|
}
|
|
80600
80600
|
}
|
|
80601
80601
|
removeAllSubscribers(id2, targets, visited = []) {
|
|
80602
80602
|
visited.push(id2);
|
|
80603
|
-
|
|
80604
|
-
|
|
80605
|
-
|
|
80606
|
-
|
|
80603
|
+
const subscriber = this.subscribers.get(id2);
|
|
80604
|
+
for (const [key, val] of subscriber?.entries() ?? []) {
|
|
80605
|
+
const subscribers = targets || val.selections.map(([spec]) => spec);
|
|
80606
|
+
this.removeSubscribers(id2, key, subscribers);
|
|
80607
|
+
const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, key);
|
|
80607
80608
|
if (kind === "scalar") {
|
|
80608
80609
|
continue;
|
|
80609
80610
|
}
|
|
@@ -174375,11 +174376,10 @@ var InMemorySubscriptions2 = class {
|
|
|
174375
174376
|
constructor(cache) {
|
|
174376
174377
|
this.cache = cache;
|
|
174377
174378
|
}
|
|
174378
|
-
subscribers =
|
|
174379
|
-
referenceCounts = {};
|
|
174379
|
+
subscribers = /* @__PURE__ */ new Map();
|
|
174380
174380
|
keyVersions = {};
|
|
174381
174381
|
activeFields(parent2) {
|
|
174382
|
-
return Object.keys(this.subscribers
|
|
174382
|
+
return Object.keys(this.subscribers.get(parent2) || {});
|
|
174383
174383
|
}
|
|
174384
174384
|
add({
|
|
174385
174385
|
parent: parent2,
|
|
@@ -174453,27 +174453,28 @@ var InMemorySubscriptions2 = class {
|
|
|
174453
174453
|
type
|
|
174454
174454
|
}) {
|
|
174455
174455
|
const spec = selection[0];
|
|
174456
|
-
if (!this.subscribers
|
|
174457
|
-
this.subscribers
|
|
174456
|
+
if (!this.subscribers.has(id2)) {
|
|
174457
|
+
this.subscribers.set(id2, /* @__PURE__ */ new Map());
|
|
174458
174458
|
}
|
|
174459
|
-
|
|
174460
|
-
|
|
174459
|
+
const subscriber = this.subscribers.get(id2);
|
|
174460
|
+
if (!subscriber.has(key)) {
|
|
174461
|
+
subscriber.set(key, {
|
|
174462
|
+
selections: [],
|
|
174463
|
+
referenceCounts: /* @__PURE__ */ new Map()
|
|
174464
|
+
});
|
|
174461
174465
|
}
|
|
174466
|
+
const subscriberField = subscriber.get(key);
|
|
174462
174467
|
if (!this.keyVersions[key]) {
|
|
174463
174468
|
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
174464
174469
|
}
|
|
174465
174470
|
this.keyVersions[key].add(key);
|
|
174466
|
-
if (!
|
|
174467
|
-
|
|
174468
|
-
}
|
|
174469
|
-
if (!this.referenceCounts[id2]) {
|
|
174470
|
-
this.referenceCounts[id2] = {};
|
|
174471
|
-
}
|
|
174472
|
-
if (!this.referenceCounts[id2][key]) {
|
|
174473
|
-
this.referenceCounts[id2][key] = /* @__PURE__ */ new Map();
|
|
174471
|
+
if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
|
|
174472
|
+
subscriberField.selections.push([spec, selection[1]]);
|
|
174474
174473
|
}
|
|
174475
|
-
|
|
174476
|
-
|
|
174474
|
+
subscriberField.referenceCounts.set(
|
|
174475
|
+
spec.set,
|
|
174476
|
+
(subscriberField.referenceCounts.get(spec.set) || 0) + 1
|
|
174477
|
+
);
|
|
174477
174478
|
this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
|
|
174478
174479
|
}
|
|
174479
174480
|
registerList({
|
|
@@ -174560,7 +174561,7 @@ var InMemorySubscriptions2 = class {
|
|
|
174560
174561
|
}
|
|
174561
174562
|
}
|
|
174562
174563
|
get(id2, field) {
|
|
174563
|
-
return this.subscribers
|
|
174564
|
+
return this.subscribers.get(id2)?.get(field)?.selections || [];
|
|
174564
174565
|
}
|
|
174565
174566
|
remove(id2, selection, targets, variables, visited = []) {
|
|
174566
174567
|
visited.push(id2);
|
|
@@ -174586,24 +174587,24 @@ var InMemorySubscriptions2 = class {
|
|
|
174586
174587
|
}
|
|
174587
174588
|
}
|
|
174588
174589
|
reset() {
|
|
174589
|
-
const subscribers =
|
|
174590
|
-
([id2]) => !id2.startsWith(rootID2)
|
|
174591
|
-
);
|
|
174590
|
+
const subscribers = [...this.subscribers.entries()].filter(([id2]) => !id2.startsWith(rootID2));
|
|
174592
174591
|
for (const [id2, _fields] of subscribers) {
|
|
174593
|
-
|
|
174592
|
+
this.subscribers.delete(id2);
|
|
174594
174593
|
}
|
|
174595
174594
|
const subscriptionSpecs = subscribers.flatMap(
|
|
174596
|
-
([_id, fields]) =>
|
|
174595
|
+
([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
|
|
174597
174596
|
);
|
|
174598
174597
|
return subscriptionSpecs;
|
|
174599
174598
|
}
|
|
174600
174599
|
removeSubscribers(id2, fieldName, specs) {
|
|
174601
174600
|
let targets = [];
|
|
174601
|
+
const subscriber = this.subscribers.get(id2);
|
|
174602
|
+
const subscriberField = subscriber?.get(fieldName);
|
|
174602
174603
|
for (const spec of specs) {
|
|
174603
|
-
|
|
174604
|
+
const counts = subscriber?.get(fieldName)?.referenceCounts;
|
|
174605
|
+
if (!counts?.has(spec.set)) {
|
|
174604
174606
|
continue;
|
|
174605
174607
|
}
|
|
174606
|
-
const counts = this.referenceCounts[id2][fieldName];
|
|
174607
174608
|
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
174608
174609
|
counts.set(spec.set, newVal);
|
|
174609
174610
|
if (newVal <= 0) {
|
|
@@ -174611,18 +174612,19 @@ var InMemorySubscriptions2 = class {
|
|
|
174611
174612
|
counts.delete(spec.set);
|
|
174612
174613
|
}
|
|
174613
174614
|
}
|
|
174614
|
-
if (
|
|
174615
|
-
|
|
174615
|
+
if (subscriberField) {
|
|
174616
|
+
subscriberField.selections = this.get(id2, fieldName).filter(
|
|
174616
174617
|
([{ set }]) => !targets.includes(set)
|
|
174617
174618
|
);
|
|
174618
174619
|
}
|
|
174619
174620
|
}
|
|
174620
174621
|
removeAllSubscribers(id2, targets, visited = []) {
|
|
174621
174622
|
visited.push(id2);
|
|
174622
|
-
|
|
174623
|
-
|
|
174624
|
-
|
|
174625
|
-
|
|
174623
|
+
const subscriber = this.subscribers.get(id2);
|
|
174624
|
+
for (const [key, val] of subscriber?.entries() ?? []) {
|
|
174625
|
+
const subscribers = targets || val.selections.map(([spec]) => spec);
|
|
174626
|
+
this.removeSubscribers(id2, key, subscribers);
|
|
174627
|
+
const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, key);
|
|
174626
174628
|
if (kind === "scalar") {
|
|
174627
174629
|
continue;
|
|
174628
174630
|
}
|