houdini-svelte 1.2.34 → 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.
@@ -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[parent2] || {});
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[id2]) {
77102
- this.subscribers[id2] = {};
77100
+ if (!this.subscribers.has(id2)) {
77101
+ this.subscribers.set(id2, /* @__PURE__ */ new Map());
77103
77102
  }
77104
- if (!this.subscribers[id2][key]) {
77105
- this.subscribers[id2][key] = [];
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 (!this.subscribers[id2][key].map(([{ set }]) => set).includes(spec.set)) {
77112
- this.subscribers[id2][key].push([spec, selection[1]]);
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
- const counts = this.referenceCounts[id2][key];
77121
- counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
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[id2]?.[field] || [];
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 = Object.entries(this.subscribers).filter(
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
- delete this.subscribers[id2];
77236
+ this.subscribers.delete(id2);
77239
77237
  }
77240
77238
  const subscriptionSpecs = subscribers.flatMap(
77241
- ([_id, fields]) => Object.values(fields).flatMap((field) => field.map(([spec]) => spec))
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
- if (!this.referenceCounts[id2]?.[fieldName]?.has(spec.set)) {
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 (this.subscribers[id2]) {
77260
- this.subscribers[id2][fieldName] = this.get(id2, fieldName).filter(
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
- for (const field of Object.keys(this.subscribers[id2] || [])) {
77268
- const subscribers = targets || this.subscribers[id2][field].map(([spec]) => spec);
77269
- this.removeSubscribers(id2, field, subscribers);
77270
- const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, field);
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
  }
@@ -134448,11 +134449,10 @@ var InMemorySubscriptions2 = class {
134448
134449
  constructor(cache) {
134449
134450
  this.cache = cache;
134450
134451
  }
134451
- subscribers = {};
134452
- referenceCounts = {};
134452
+ subscribers = /* @__PURE__ */ new Map();
134453
134453
  keyVersions = {};
134454
134454
  activeFields(parent2) {
134455
- return Object.keys(this.subscribers[parent2] || {});
134455
+ return Object.keys(this.subscribers.get(parent2) || {});
134456
134456
  }
134457
134457
  add({
134458
134458
  parent: parent2,
@@ -134526,27 +134526,28 @@ var InMemorySubscriptions2 = class {
134526
134526
  type
134527
134527
  }) {
134528
134528
  const spec = selection[0];
134529
- if (!this.subscribers[id2]) {
134530
- this.subscribers[id2] = {};
134529
+ if (!this.subscribers.has(id2)) {
134530
+ this.subscribers.set(id2, /* @__PURE__ */ new Map());
134531
134531
  }
134532
- if (!this.subscribers[id2][key]) {
134533
- this.subscribers[id2][key] = [];
134532
+ const subscriber = this.subscribers.get(id2);
134533
+ if (!subscriber.has(key)) {
134534
+ subscriber.set(key, {
134535
+ selections: [],
134536
+ referenceCounts: /* @__PURE__ */ new Map()
134537
+ });
134534
134538
  }
134539
+ const subscriberField = subscriber.get(key);
134535
134540
  if (!this.keyVersions[key]) {
134536
134541
  this.keyVersions[key] = /* @__PURE__ */ new Set();
134537
134542
  }
134538
134543
  this.keyVersions[key].add(key);
134539
- if (!this.subscribers[id2][key].map(([{ set }]) => set).includes(spec.set)) {
134540
- this.subscribers[id2][key].push([spec, selection[1]]);
134544
+ if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
134545
+ subscriberField.selections.push([spec, selection[1]]);
134541
134546
  }
134542
- if (!this.referenceCounts[id2]) {
134543
- this.referenceCounts[id2] = {};
134544
- }
134545
- if (!this.referenceCounts[id2][key]) {
134546
- this.referenceCounts[id2][key] = /* @__PURE__ */ new Map();
134547
- }
134548
- const counts = this.referenceCounts[id2][key];
134549
- counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
134547
+ subscriberField.referenceCounts.set(
134548
+ spec.set,
134549
+ (subscriberField.referenceCounts.get(spec.set) || 0) + 1
134550
+ );
134550
134551
  this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
134551
134552
  }
134552
134553
  registerList({
@@ -134633,7 +134634,7 @@ var InMemorySubscriptions2 = class {
134633
134634
  }
134634
134635
  }
134635
134636
  get(id2, field) {
134636
- return this.subscribers[id2]?.[field] || [];
134637
+ return this.subscribers.get(id2)?.get(field)?.selections || [];
134637
134638
  }
134638
134639
  remove(id2, selection, targets, variables, visited = []) {
134639
134640
  visited.push(id2);
@@ -134659,24 +134660,24 @@ var InMemorySubscriptions2 = class {
134659
134660
  }
134660
134661
  }
134661
134662
  reset() {
134662
- const subscribers = Object.entries(this.subscribers).filter(
134663
- ([id2]) => !id2.startsWith(rootID2)
134664
- );
134663
+ const subscribers = [...this.subscribers.entries()].filter(([id2]) => !id2.startsWith(rootID2));
134665
134664
  for (const [id2, _fields] of subscribers) {
134666
- delete this.subscribers[id2];
134665
+ this.subscribers.delete(id2);
134667
134666
  }
134668
134667
  const subscriptionSpecs = subscribers.flatMap(
134669
- ([_id, fields]) => Object.values(fields).flatMap((field) => field.map(([spec]) => spec))
134668
+ ([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
134670
134669
  );
134671
134670
  return subscriptionSpecs;
134672
134671
  }
134673
134672
  removeSubscribers(id2, fieldName, specs) {
134674
134673
  let targets = [];
134674
+ const subscriber = this.subscribers.get(id2);
134675
+ const subscriberField = subscriber?.get(fieldName);
134675
134676
  for (const spec of specs) {
134676
- if (!this.referenceCounts[id2]?.[fieldName]?.has(spec.set)) {
134677
+ const counts = subscriber?.get(fieldName)?.referenceCounts;
134678
+ if (!counts?.has(spec.set)) {
134677
134679
  continue;
134678
134680
  }
134679
- const counts = this.referenceCounts[id2][fieldName];
134680
134681
  const newVal = (counts.get(spec.set) || 0) - 1;
134681
134682
  counts.set(spec.set, newVal);
134682
134683
  if (newVal <= 0) {
@@ -134684,18 +134685,19 @@ var InMemorySubscriptions2 = class {
134684
134685
  counts.delete(spec.set);
134685
134686
  }
134686
134687
  }
134687
- if (this.subscribers[id2]) {
134688
- this.subscribers[id2][fieldName] = this.get(id2, fieldName).filter(
134688
+ if (subscriberField) {
134689
+ subscriberField.selections = this.get(id2, fieldName).filter(
134689
134690
  ([{ set }]) => !targets.includes(set)
134690
134691
  );
134691
134692
  }
134692
134693
  }
134693
134694
  removeAllSubscribers(id2, targets, visited = []) {
134694
134695
  visited.push(id2);
134695
- for (const field of Object.keys(this.subscribers[id2] || [])) {
134696
- const subscribers = targets || this.subscribers[id2][field].map(([spec]) => spec);
134697
- this.removeSubscribers(id2, field, subscribers);
134698
- const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, field);
134696
+ const subscriber = this.subscribers.get(id2);
134697
+ for (const [key, val] of subscriber?.entries() ?? []) {
134698
+ const subscribers = targets || val.selections.map(([spec]) => spec);
134699
+ this.removeSubscribers(id2, key, subscribers);
134700
+ const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, key);
134699
134701
  if (kind === "scalar") {
134700
134702
  continue;
134701
134703
  }
@@ -136144,7 +136146,7 @@ var FieldCollection = class {
136144
136146
  return Object.keys(this.fields).length + Object.keys(this.inlineFragments).length + Object.keys(this.fragmentSpreads).length;
136145
136147
  }
136146
136148
  add({ selection, external }) {
136147
- let include = this.config.defaultFragmentMasking === "disable";
136149
+ let include = this.applyFragments || this.config.defaultFragmentMasking === "disable";
136148
136150
  const maskEnableDirective = selection.directives?.find(
136149
136151
  ({ name }) => name.value === this.config.maskEnableDirective
136150
136152
  );
@@ -138425,7 +138427,12 @@ function prepareSelection({
138425
138427
  object.fragments = {
138426
138428
  ...object.fragments,
138427
138429
  [fragment22]: {
138428
- arguments: args ?? {}
138430
+ arguments: args && Object.keys(args ?? {}).length > 0 ? args : Object.fromEntries(
138431
+ withArguments(config2, field).map((arg) => [
138432
+ arg.name.value,
138433
+ arg.value
138434
+ ])
138435
+ )
138429
138436
  }
138430
138437
  };
138431
138438
  if (globalLoading || field.directives?.find((d) => d.name.value === config2.loadingDirective)) {
@@ -138750,7 +138757,7 @@ function artifactGenerator(stats) {
138750
138757
  document: doc,
138751
138758
  rootType,
138752
138759
  globalLoading,
138753
- includeFragments: doc.kind !== ArtifactKind2.Fragment,
138760
+ includeFragments: true,
138754
138761
  hasComponents: () => {
138755
138762
  hasComponents = true;
138756
138763
  },
@@ -138759,7 +138766,7 @@ function artifactGenerator(stats) {
138759
138766
  filepath: doc.filename,
138760
138767
  selections: selectionSet.selections,
138761
138768
  fragmentDefinitions,
138762
- applyFragments: doc.kind !== ArtifactKind2.Fragment
138769
+ applyFragments: true
138763
138770
  }),
138764
138771
  operations: operationsByPath(
138765
138772
  config2,
@@ -199175,11 +199182,10 @@ var InMemorySubscriptions3 = class {
199175
199182
  constructor(cache) {
199176
199183
  this.cache = cache;
199177
199184
  }
199178
- subscribers = {};
199179
- referenceCounts = {};
199185
+ subscribers = /* @__PURE__ */ new Map();
199180
199186
  keyVersions = {};
199181
199187
  activeFields(parent2) {
199182
- return Object.keys(this.subscribers[parent2] || {});
199188
+ return Object.keys(this.subscribers.get(parent2) || {});
199183
199189
  }
199184
199190
  add({
199185
199191
  parent: parent2,
@@ -199253,27 +199259,28 @@ var InMemorySubscriptions3 = class {
199253
199259
  type
199254
199260
  }) {
199255
199261
  const spec = selection[0];
199256
- if (!this.subscribers[id2]) {
199257
- this.subscribers[id2] = {};
199262
+ if (!this.subscribers.has(id2)) {
199263
+ this.subscribers.set(id2, /* @__PURE__ */ new Map());
199258
199264
  }
199259
- if (!this.subscribers[id2][key]) {
199260
- this.subscribers[id2][key] = [];
199265
+ const subscriber = this.subscribers.get(id2);
199266
+ if (!subscriber.has(key)) {
199267
+ subscriber.set(key, {
199268
+ selections: [],
199269
+ referenceCounts: /* @__PURE__ */ new Map()
199270
+ });
199261
199271
  }
199272
+ const subscriberField = subscriber.get(key);
199262
199273
  if (!this.keyVersions[key]) {
199263
199274
  this.keyVersions[key] = /* @__PURE__ */ new Set();
199264
199275
  }
199265
199276
  this.keyVersions[key].add(key);
199266
- if (!this.subscribers[id2][key].map(([{ set }]) => set).includes(spec.set)) {
199267
- this.subscribers[id2][key].push([spec, selection[1]]);
199268
- }
199269
- if (!this.referenceCounts[id2]) {
199270
- this.referenceCounts[id2] = {};
199277
+ if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
199278
+ subscriberField.selections.push([spec, selection[1]]);
199271
199279
  }
199272
- if (!this.referenceCounts[id2][key]) {
199273
- this.referenceCounts[id2][key] = /* @__PURE__ */ new Map();
199274
- }
199275
- const counts = this.referenceCounts[id2][key];
199276
- counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
199280
+ subscriberField.referenceCounts.set(
199281
+ spec.set,
199282
+ (subscriberField.referenceCounts.get(spec.set) || 0) + 1
199283
+ );
199277
199284
  this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
199278
199285
  }
199279
199286
  registerList({
@@ -199360,7 +199367,7 @@ var InMemorySubscriptions3 = class {
199360
199367
  }
199361
199368
  }
199362
199369
  get(id2, field) {
199363
- return this.subscribers[id2]?.[field] || [];
199370
+ return this.subscribers.get(id2)?.get(field)?.selections || [];
199364
199371
  }
199365
199372
  remove(id2, selection, targets, variables, visited = []) {
199366
199373
  visited.push(id2);
@@ -199386,24 +199393,24 @@ var InMemorySubscriptions3 = class {
199386
199393
  }
199387
199394
  }
199388
199395
  reset() {
199389
- const subscribers = Object.entries(this.subscribers).filter(
199390
- ([id2]) => !id2.startsWith(rootID3)
199391
- );
199396
+ const subscribers = [...this.subscribers.entries()].filter(([id2]) => !id2.startsWith(rootID3));
199392
199397
  for (const [id2, _fields] of subscribers) {
199393
- delete this.subscribers[id2];
199398
+ this.subscribers.delete(id2);
199394
199399
  }
199395
199400
  const subscriptionSpecs = subscribers.flatMap(
199396
- ([_id, fields]) => Object.values(fields).flatMap((field) => field.map(([spec]) => spec))
199401
+ ([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
199397
199402
  );
199398
199403
  return subscriptionSpecs;
199399
199404
  }
199400
199405
  removeSubscribers(id2, fieldName, specs) {
199401
199406
  let targets = [];
199407
+ const subscriber = this.subscribers.get(id2);
199408
+ const subscriberField = subscriber?.get(fieldName);
199402
199409
  for (const spec of specs) {
199403
- if (!this.referenceCounts[id2]?.[fieldName]?.has(spec.set)) {
199410
+ const counts = subscriber?.get(fieldName)?.referenceCounts;
199411
+ if (!counts?.has(spec.set)) {
199404
199412
  continue;
199405
199413
  }
199406
- const counts = this.referenceCounts[id2][fieldName];
199407
199414
  const newVal = (counts.get(spec.set) || 0) - 1;
199408
199415
  counts.set(spec.set, newVal);
199409
199416
  if (newVal <= 0) {
@@ -199411,18 +199418,19 @@ var InMemorySubscriptions3 = class {
199411
199418
  counts.delete(spec.set);
199412
199419
  }
199413
199420
  }
199414
- if (this.subscribers[id2]) {
199415
- this.subscribers[id2][fieldName] = this.get(id2, fieldName).filter(
199421
+ if (subscriberField) {
199422
+ subscriberField.selections = this.get(id2, fieldName).filter(
199416
199423
  ([{ set }]) => !targets.includes(set)
199417
199424
  );
199418
199425
  }
199419
199426
  }
199420
199427
  removeAllSubscribers(id2, targets, visited = []) {
199421
199428
  visited.push(id2);
199422
- for (const field of Object.keys(this.subscribers[id2] || [])) {
199423
- const subscribers = targets || this.subscribers[id2][field].map(([spec]) => spec);
199424
- this.removeSubscribers(id2, field, subscribers);
199425
- const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, field);
199429
+ const subscriber = this.subscribers.get(id2);
199430
+ for (const [key, val] of subscriber?.entries() ?? []) {
199431
+ const subscribers = targets || val.selections.map(([spec]) => spec);
199432
+ this.removeSubscribers(id2, key, subscribers);
199433
+ const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, key);
199426
199434
  if (kind === "scalar") {
199427
199435
  continue;
199428
199436
  }
@@ -265464,11 +265472,10 @@ var InMemorySubscriptions4 = class {
265464
265472
  constructor(cache) {
265465
265473
  this.cache = cache;
265466
265474
  }
265467
- subscribers = {};
265468
- referenceCounts = {};
265475
+ subscribers = /* @__PURE__ */ new Map();
265469
265476
  keyVersions = {};
265470
265477
  activeFields(parent2) {
265471
- return Object.keys(this.subscribers[parent2] || {});
265478
+ return Object.keys(this.subscribers.get(parent2) || {});
265472
265479
  }
265473
265480
  add({
265474
265481
  parent: parent2,
@@ -265542,27 +265549,28 @@ var InMemorySubscriptions4 = class {
265542
265549
  type
265543
265550
  }) {
265544
265551
  const spec = selection[0];
265545
- if (!this.subscribers[id2]) {
265546
- this.subscribers[id2] = {};
265552
+ if (!this.subscribers.has(id2)) {
265553
+ this.subscribers.set(id2, /* @__PURE__ */ new Map());
265547
265554
  }
265548
- if (!this.subscribers[id2][key]) {
265549
- this.subscribers[id2][key] = [];
265555
+ const subscriber = this.subscribers.get(id2);
265556
+ if (!subscriber.has(key)) {
265557
+ subscriber.set(key, {
265558
+ selections: [],
265559
+ referenceCounts: /* @__PURE__ */ new Map()
265560
+ });
265550
265561
  }
265562
+ const subscriberField = subscriber.get(key);
265551
265563
  if (!this.keyVersions[key]) {
265552
265564
  this.keyVersions[key] = /* @__PURE__ */ new Set();
265553
265565
  }
265554
265566
  this.keyVersions[key].add(key);
265555
- if (!this.subscribers[id2][key].map(([{ set }]) => set).includes(spec.set)) {
265556
- this.subscribers[id2][key].push([spec, selection[1]]);
265557
- }
265558
- if (!this.referenceCounts[id2]) {
265559
- this.referenceCounts[id2] = {};
265560
- }
265561
- if (!this.referenceCounts[id2][key]) {
265562
- this.referenceCounts[id2][key] = /* @__PURE__ */ new Map();
265567
+ if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
265568
+ subscriberField.selections.push([spec, selection[1]]);
265563
265569
  }
265564
- const counts = this.referenceCounts[id2][key];
265565
- counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
265570
+ subscriberField.referenceCounts.set(
265571
+ spec.set,
265572
+ (subscriberField.referenceCounts.get(spec.set) || 0) + 1
265573
+ );
265566
265574
  this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
265567
265575
  }
265568
265576
  registerList({
@@ -265649,7 +265657,7 @@ var InMemorySubscriptions4 = class {
265649
265657
  }
265650
265658
  }
265651
265659
  get(id2, field) {
265652
- return this.subscribers[id2]?.[field] || [];
265660
+ return this.subscribers.get(id2)?.get(field)?.selections || [];
265653
265661
  }
265654
265662
  remove(id2, selection, targets, variables, visited = []) {
265655
265663
  visited.push(id2);
@@ -265675,24 +265683,24 @@ var InMemorySubscriptions4 = class {
265675
265683
  }
265676
265684
  }
265677
265685
  reset() {
265678
- const subscribers = Object.entries(this.subscribers).filter(
265679
- ([id2]) => !id2.startsWith(rootID4)
265680
- );
265686
+ const subscribers = [...this.subscribers.entries()].filter(([id2]) => !id2.startsWith(rootID4));
265681
265687
  for (const [id2, _fields] of subscribers) {
265682
- delete this.subscribers[id2];
265688
+ this.subscribers.delete(id2);
265683
265689
  }
265684
265690
  const subscriptionSpecs = subscribers.flatMap(
265685
- ([_id, fields]) => Object.values(fields).flatMap((field) => field.map(([spec]) => spec))
265691
+ ([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
265686
265692
  );
265687
265693
  return subscriptionSpecs;
265688
265694
  }
265689
265695
  removeSubscribers(id2, fieldName, specs) {
265690
265696
  let targets = [];
265697
+ const subscriber = this.subscribers.get(id2);
265698
+ const subscriberField = subscriber?.get(fieldName);
265691
265699
  for (const spec of specs) {
265692
- if (!this.referenceCounts[id2]?.[fieldName]?.has(spec.set)) {
265700
+ const counts = subscriber?.get(fieldName)?.referenceCounts;
265701
+ if (!counts?.has(spec.set)) {
265693
265702
  continue;
265694
265703
  }
265695
- const counts = this.referenceCounts[id2][fieldName];
265696
265704
  const newVal = (counts.get(spec.set) || 0) - 1;
265697
265705
  counts.set(spec.set, newVal);
265698
265706
  if (newVal <= 0) {
@@ -265700,18 +265708,19 @@ var InMemorySubscriptions4 = class {
265700
265708
  counts.delete(spec.set);
265701
265709
  }
265702
265710
  }
265703
- if (this.subscribers[id2]) {
265704
- this.subscribers[id2][fieldName] = this.get(id2, fieldName).filter(
265711
+ if (subscriberField) {
265712
+ subscriberField.selections = this.get(id2, fieldName).filter(
265705
265713
  ([{ set }]) => !targets.includes(set)
265706
265714
  );
265707
265715
  }
265708
265716
  }
265709
265717
  removeAllSubscribers(id2, targets, visited = []) {
265710
265718
  visited.push(id2);
265711
- for (const field of Object.keys(this.subscribers[id2] || [])) {
265712
- const subscribers = targets || this.subscribers[id2][field].map(([spec]) => spec);
265713
- this.removeSubscribers(id2, field, subscribers);
265714
- const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, field);
265719
+ const subscriber = this.subscribers.get(id2);
265720
+ for (const [key, val] of subscriber?.entries() ?? []) {
265721
+ const subscribers = targets || val.selections.map(([spec]) => spec);
265722
+ this.removeSubscribers(id2, key, subscribers);
265723
+ const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, key);
265715
265724
  if (kind === "scalar") {
265716
265725
  continue;
265717
265726
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "houdini-svelte",
3
- "version": "1.2.34",
3
+ "version": "1.2.36",
4
4
  "description": "The svelte plugin for houdini",
5
5
  "keywords": [
6
6
  "typescript",
@@ -32,7 +32,7 @@
32
32
  "rollup": "^3.7.4",
33
33
  "svelte": "^3.57.0",
34
34
  "vite": "^4.1.1",
35
- "houdini": "^1.2.34"
35
+ "houdini": "^1.2.36"
36
36
  },
37
37
  "files": [
38
38
  "build"