houdini 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.
- package/build/cmd-cjs/index.js +44 -38
- package/build/cmd-esm/index.js +44 -38
- package/build/codegen-cjs/index.js +42 -36
- package/build/codegen-esm/index.js +42 -36
- package/build/lib-cjs/index.js +33 -32
- package/build/lib-esm/index.js +33 -32
- package/build/runtime/cache/subscription.d.ts +0 -1
- package/build/runtime-cjs/cache/subscription.d.ts +0 -1
- package/build/runtime-cjs/cache/subscription.js +32 -31
- package/build/runtime-esm/cache/subscription.d.ts +0 -1
- package/build/runtime-esm/cache/subscription.js +32 -31
- package/build/test-cjs/index.js +42 -36
- package/build/test-esm/index.js +42 -36
- package/build/vite-cjs/index.js +42 -36
- package/build/vite-esm/index.js +42 -36
- package/package.json +1 -1
|
@@ -7,11 +7,10 @@ class InMemorySubscriptions {
|
|
|
7
7
|
constructor(cache) {
|
|
8
8
|
this.cache = cache;
|
|
9
9
|
}
|
|
10
|
-
subscribers =
|
|
11
|
-
referenceCounts = {};
|
|
10
|
+
subscribers = /* @__PURE__ */ new Map();
|
|
12
11
|
keyVersions = {};
|
|
13
12
|
activeFields(parent) {
|
|
14
|
-
return Object.keys(this.subscribers
|
|
13
|
+
return Object.keys(this.subscribers.get(parent) || {});
|
|
15
14
|
}
|
|
16
15
|
add({
|
|
17
16
|
parent,
|
|
@@ -85,27 +84,28 @@ class InMemorySubscriptions {
|
|
|
85
84
|
type
|
|
86
85
|
}) {
|
|
87
86
|
const spec = selection[0];
|
|
88
|
-
if (!this.subscribers
|
|
89
|
-
this.subscribers
|
|
87
|
+
if (!this.subscribers.has(id)) {
|
|
88
|
+
this.subscribers.set(id, /* @__PURE__ */ new Map());
|
|
90
89
|
}
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
const subscriber = this.subscribers.get(id);
|
|
91
|
+
if (!subscriber.has(key)) {
|
|
92
|
+
subscriber.set(key, {
|
|
93
|
+
selections: [],
|
|
94
|
+
referenceCounts: /* @__PURE__ */ new Map()
|
|
95
|
+
});
|
|
93
96
|
}
|
|
97
|
+
const subscriberField = subscriber.get(key);
|
|
94
98
|
if (!this.keyVersions[key]) {
|
|
95
99
|
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
96
100
|
}
|
|
97
101
|
this.keyVersions[key].add(key);
|
|
98
|
-
if (!
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
if (!this.referenceCounts[id]) {
|
|
102
|
-
this.referenceCounts[id] = {};
|
|
103
|
-
}
|
|
104
|
-
if (!this.referenceCounts[id][key]) {
|
|
105
|
-
this.referenceCounts[id][key] = /* @__PURE__ */ new Map();
|
|
102
|
+
if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
|
|
103
|
+
subscriberField.selections.push([spec, selection[1]]);
|
|
106
104
|
}
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
subscriberField.referenceCounts.set(
|
|
106
|
+
spec.set,
|
|
107
|
+
(subscriberField.referenceCounts.get(spec.set) || 0) + 1
|
|
108
|
+
);
|
|
109
109
|
this.cache._internal_unstable.lifetimes.resetLifetime(id, key);
|
|
110
110
|
}
|
|
111
111
|
registerList({
|
|
@@ -192,7 +192,7 @@ class InMemorySubscriptions {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
get(id, field) {
|
|
195
|
-
return this.subscribers
|
|
195
|
+
return this.subscribers.get(id)?.get(field)?.selections || [];
|
|
196
196
|
}
|
|
197
197
|
remove(id, selection, targets, variables, visited = []) {
|
|
198
198
|
visited.push(id);
|
|
@@ -218,24 +218,24 @@ class InMemorySubscriptions {
|
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
reset() {
|
|
221
|
-
const subscribers =
|
|
222
|
-
([id]) => !id.startsWith(rootID)
|
|
223
|
-
);
|
|
221
|
+
const subscribers = [...this.subscribers.entries()].filter(([id]) => !id.startsWith(rootID));
|
|
224
222
|
for (const [id, _fields] of subscribers) {
|
|
225
|
-
|
|
223
|
+
this.subscribers.delete(id);
|
|
226
224
|
}
|
|
227
225
|
const subscriptionSpecs = subscribers.flatMap(
|
|
228
|
-
([_id, fields]) =>
|
|
226
|
+
([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
|
|
229
227
|
);
|
|
230
228
|
return subscriptionSpecs;
|
|
231
229
|
}
|
|
232
230
|
removeSubscribers(id, fieldName, specs) {
|
|
233
231
|
let targets = [];
|
|
232
|
+
const subscriber = this.subscribers.get(id);
|
|
233
|
+
const subscriberField = subscriber?.get(fieldName);
|
|
234
234
|
for (const spec of specs) {
|
|
235
|
-
|
|
235
|
+
const counts = subscriber?.get(fieldName)?.referenceCounts;
|
|
236
|
+
if (!counts?.has(spec.set)) {
|
|
236
237
|
continue;
|
|
237
238
|
}
|
|
238
|
-
const counts = this.referenceCounts[id][fieldName];
|
|
239
239
|
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
240
240
|
counts.set(spec.set, newVal);
|
|
241
241
|
if (newVal <= 0) {
|
|
@@ -243,18 +243,19 @@ class InMemorySubscriptions {
|
|
|
243
243
|
counts.delete(spec.set);
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
if (
|
|
247
|
-
|
|
246
|
+
if (subscriberField) {
|
|
247
|
+
subscriberField.selections = this.get(id, fieldName).filter(
|
|
248
248
|
([{ set }]) => !targets.includes(set)
|
|
249
249
|
);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
removeAllSubscribers(id, targets, visited = []) {
|
|
253
253
|
visited.push(id);
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
254
|
+
const subscriber = this.subscribers.get(id);
|
|
255
|
+
for (const [key, val] of subscriber?.entries() ?? []) {
|
|
256
|
+
const subscribers = targets || val.selections.map(([spec]) => spec);
|
|
257
|
+
this.removeSubscribers(id, key, subscribers);
|
|
258
|
+
const { value, kind } = this.cache._internal_unstable.storage.get(id, key);
|
|
258
259
|
if (kind === "scalar") {
|
|
259
260
|
continue;
|
|
260
261
|
}
|
package/build/test-cjs/index.js
CHANGED
|
@@ -55872,11 +55872,10 @@ var InMemorySubscriptions = class {
|
|
|
55872
55872
|
constructor(cache) {
|
|
55873
55873
|
this.cache = cache;
|
|
55874
55874
|
}
|
|
55875
|
-
subscribers =
|
|
55876
|
-
referenceCounts = {};
|
|
55875
|
+
subscribers = /* @__PURE__ */ new Map();
|
|
55877
55876
|
keyVersions = {};
|
|
55878
55877
|
activeFields(parent2) {
|
|
55879
|
-
return Object.keys(this.subscribers
|
|
55878
|
+
return Object.keys(this.subscribers.get(parent2) || {});
|
|
55880
55879
|
}
|
|
55881
55880
|
add({
|
|
55882
55881
|
parent: parent2,
|
|
@@ -55950,27 +55949,28 @@ var InMemorySubscriptions = class {
|
|
|
55950
55949
|
type
|
|
55951
55950
|
}) {
|
|
55952
55951
|
const spec = selection[0];
|
|
55953
|
-
if (!this.subscribers
|
|
55954
|
-
this.subscribers
|
|
55955
|
-
}
|
|
55956
|
-
|
|
55957
|
-
|
|
55952
|
+
if (!this.subscribers.has(id)) {
|
|
55953
|
+
this.subscribers.set(id, /* @__PURE__ */ new Map());
|
|
55954
|
+
}
|
|
55955
|
+
const subscriber = this.subscribers.get(id);
|
|
55956
|
+
if (!subscriber.has(key)) {
|
|
55957
|
+
subscriber.set(key, {
|
|
55958
|
+
selections: [],
|
|
55959
|
+
referenceCounts: /* @__PURE__ */ new Map()
|
|
55960
|
+
});
|
|
55958
55961
|
}
|
|
55962
|
+
const subscriberField = subscriber.get(key);
|
|
55959
55963
|
if (!this.keyVersions[key]) {
|
|
55960
55964
|
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
55961
55965
|
}
|
|
55962
55966
|
this.keyVersions[key].add(key);
|
|
55963
|
-
if (!
|
|
55964
|
-
|
|
55965
|
-
}
|
|
55966
|
-
if (!this.referenceCounts[id]) {
|
|
55967
|
-
this.referenceCounts[id] = {};
|
|
55967
|
+
if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
|
|
55968
|
+
subscriberField.selections.push([spec, selection[1]]);
|
|
55968
55969
|
}
|
|
55969
|
-
|
|
55970
|
-
|
|
55971
|
-
|
|
55972
|
-
|
|
55973
|
-
counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
|
|
55970
|
+
subscriberField.referenceCounts.set(
|
|
55971
|
+
spec.set,
|
|
55972
|
+
(subscriberField.referenceCounts.get(spec.set) || 0) + 1
|
|
55973
|
+
);
|
|
55974
55974
|
this.cache._internal_unstable.lifetimes.resetLifetime(id, key);
|
|
55975
55975
|
}
|
|
55976
55976
|
registerList({
|
|
@@ -56057,7 +56057,7 @@ var InMemorySubscriptions = class {
|
|
|
56057
56057
|
}
|
|
56058
56058
|
}
|
|
56059
56059
|
get(id, field) {
|
|
56060
|
-
return this.subscribers
|
|
56060
|
+
return this.subscribers.get(id)?.get(field)?.selections || [];
|
|
56061
56061
|
}
|
|
56062
56062
|
remove(id, selection, targets, variables, visited = []) {
|
|
56063
56063
|
visited.push(id);
|
|
@@ -56083,24 +56083,24 @@ var InMemorySubscriptions = class {
|
|
|
56083
56083
|
}
|
|
56084
56084
|
}
|
|
56085
56085
|
reset() {
|
|
56086
|
-
const subscribers =
|
|
56087
|
-
([id]) => !id.startsWith(rootID)
|
|
56088
|
-
);
|
|
56086
|
+
const subscribers = [...this.subscribers.entries()].filter(([id]) => !id.startsWith(rootID));
|
|
56089
56087
|
for (const [id, _fields] of subscribers) {
|
|
56090
|
-
|
|
56088
|
+
this.subscribers.delete(id);
|
|
56091
56089
|
}
|
|
56092
56090
|
const subscriptionSpecs = subscribers.flatMap(
|
|
56093
|
-
([_id, fields]) =>
|
|
56091
|
+
([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
|
|
56094
56092
|
);
|
|
56095
56093
|
return subscriptionSpecs;
|
|
56096
56094
|
}
|
|
56097
56095
|
removeSubscribers(id, fieldName, specs) {
|
|
56098
56096
|
let targets = [];
|
|
56097
|
+
const subscriber = this.subscribers.get(id);
|
|
56098
|
+
const subscriberField = subscriber?.get(fieldName);
|
|
56099
56099
|
for (const spec of specs) {
|
|
56100
|
-
|
|
56100
|
+
const counts = subscriber?.get(fieldName)?.referenceCounts;
|
|
56101
|
+
if (!counts?.has(spec.set)) {
|
|
56101
56102
|
continue;
|
|
56102
56103
|
}
|
|
56103
|
-
const counts = this.referenceCounts[id][fieldName];
|
|
56104
56104
|
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
56105
56105
|
counts.set(spec.set, newVal);
|
|
56106
56106
|
if (newVal <= 0) {
|
|
@@ -56108,18 +56108,19 @@ var InMemorySubscriptions = class {
|
|
|
56108
56108
|
counts.delete(spec.set);
|
|
56109
56109
|
}
|
|
56110
56110
|
}
|
|
56111
|
-
if (
|
|
56112
|
-
|
|
56111
|
+
if (subscriberField) {
|
|
56112
|
+
subscriberField.selections = this.get(id, fieldName).filter(
|
|
56113
56113
|
([{ set }]) => !targets.includes(set)
|
|
56114
56114
|
);
|
|
56115
56115
|
}
|
|
56116
56116
|
}
|
|
56117
56117
|
removeAllSubscribers(id, targets, visited = []) {
|
|
56118
56118
|
visited.push(id);
|
|
56119
|
-
|
|
56120
|
-
|
|
56121
|
-
|
|
56122
|
-
|
|
56119
|
+
const subscriber = this.subscribers.get(id);
|
|
56120
|
+
for (const [key, val] of subscriber?.entries() ?? []) {
|
|
56121
|
+
const subscribers = targets || val.selections.map(([spec]) => spec);
|
|
56122
|
+
this.removeSubscribers(id, key, subscribers);
|
|
56123
|
+
const { value, kind } = this.cache._internal_unstable.storage.get(id, key);
|
|
56123
56124
|
if (kind === "scalar") {
|
|
56124
56125
|
continue;
|
|
56125
56126
|
}
|
|
@@ -58268,7 +58269,7 @@ var FieldCollection = class {
|
|
|
58268
58269
|
return Object.keys(this.fields).length + Object.keys(this.inlineFragments).length + Object.keys(this.fragmentSpreads).length;
|
|
58269
58270
|
}
|
|
58270
58271
|
add({ selection, external }) {
|
|
58271
|
-
let include = this.config.defaultFragmentMasking === "disable";
|
|
58272
|
+
let include = this.applyFragments || this.config.defaultFragmentMasking === "disable";
|
|
58272
58273
|
const maskEnableDirective = selection.directives?.find(
|
|
58273
58274
|
({ name }) => name.value === this.config.maskEnableDirective
|
|
58274
58275
|
);
|
|
@@ -60602,7 +60603,12 @@ function prepareSelection({
|
|
|
60602
60603
|
object.fragments = {
|
|
60603
60604
|
...object.fragments,
|
|
60604
60605
|
[fragment2]: {
|
|
60605
|
-
arguments: args ?? {}
|
|
60606
|
+
arguments: args && Object.keys(args ?? {}).length > 0 ? args : Object.fromEntries(
|
|
60607
|
+
withArguments(config, field).map((arg) => [
|
|
60608
|
+
arg.name.value,
|
|
60609
|
+
arg.value
|
|
60610
|
+
])
|
|
60611
|
+
)
|
|
60606
60612
|
}
|
|
60607
60613
|
};
|
|
60608
60614
|
if (globalLoading || field.directives?.find((d) => d.name.value === config.loadingDirective)) {
|
|
@@ -60929,7 +60935,7 @@ function artifactGenerator(stats) {
|
|
|
60929
60935
|
document: doc,
|
|
60930
60936
|
rootType,
|
|
60931
60937
|
globalLoading,
|
|
60932
|
-
includeFragments:
|
|
60938
|
+
includeFragments: true,
|
|
60933
60939
|
hasComponents: () => {
|
|
60934
60940
|
hasComponents = true;
|
|
60935
60941
|
},
|
|
@@ -60938,7 +60944,7 @@ function artifactGenerator(stats) {
|
|
|
60938
60944
|
filepath: doc.filename,
|
|
60939
60945
|
selections: selectionSet.selections,
|
|
60940
60946
|
fragmentDefinitions,
|
|
60941
|
-
applyFragments:
|
|
60947
|
+
applyFragments: true
|
|
60942
60948
|
}),
|
|
60943
60949
|
operations: operationsByPath(
|
|
60944
60950
|
config,
|
package/build/test-esm/index.js
CHANGED
|
@@ -55869,11 +55869,10 @@ var InMemorySubscriptions = class {
|
|
|
55869
55869
|
constructor(cache) {
|
|
55870
55870
|
this.cache = cache;
|
|
55871
55871
|
}
|
|
55872
|
-
subscribers =
|
|
55873
|
-
referenceCounts = {};
|
|
55872
|
+
subscribers = /* @__PURE__ */ new Map();
|
|
55874
55873
|
keyVersions = {};
|
|
55875
55874
|
activeFields(parent2) {
|
|
55876
|
-
return Object.keys(this.subscribers
|
|
55875
|
+
return Object.keys(this.subscribers.get(parent2) || {});
|
|
55877
55876
|
}
|
|
55878
55877
|
add({
|
|
55879
55878
|
parent: parent2,
|
|
@@ -55947,27 +55946,28 @@ var InMemorySubscriptions = class {
|
|
|
55947
55946
|
type
|
|
55948
55947
|
}) {
|
|
55949
55948
|
const spec = selection[0];
|
|
55950
|
-
if (!this.subscribers
|
|
55951
|
-
this.subscribers
|
|
55952
|
-
}
|
|
55953
|
-
|
|
55954
|
-
|
|
55949
|
+
if (!this.subscribers.has(id)) {
|
|
55950
|
+
this.subscribers.set(id, /* @__PURE__ */ new Map());
|
|
55951
|
+
}
|
|
55952
|
+
const subscriber = this.subscribers.get(id);
|
|
55953
|
+
if (!subscriber.has(key)) {
|
|
55954
|
+
subscriber.set(key, {
|
|
55955
|
+
selections: [],
|
|
55956
|
+
referenceCounts: /* @__PURE__ */ new Map()
|
|
55957
|
+
});
|
|
55955
55958
|
}
|
|
55959
|
+
const subscriberField = subscriber.get(key);
|
|
55956
55960
|
if (!this.keyVersions[key]) {
|
|
55957
55961
|
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
55958
55962
|
}
|
|
55959
55963
|
this.keyVersions[key].add(key);
|
|
55960
|
-
if (!
|
|
55961
|
-
|
|
55962
|
-
}
|
|
55963
|
-
if (!this.referenceCounts[id]) {
|
|
55964
|
-
this.referenceCounts[id] = {};
|
|
55964
|
+
if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
|
|
55965
|
+
subscriberField.selections.push([spec, selection[1]]);
|
|
55965
55966
|
}
|
|
55966
|
-
|
|
55967
|
-
|
|
55968
|
-
|
|
55969
|
-
|
|
55970
|
-
counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
|
|
55967
|
+
subscriberField.referenceCounts.set(
|
|
55968
|
+
spec.set,
|
|
55969
|
+
(subscriberField.referenceCounts.get(spec.set) || 0) + 1
|
|
55970
|
+
);
|
|
55971
55971
|
this.cache._internal_unstable.lifetimes.resetLifetime(id, key);
|
|
55972
55972
|
}
|
|
55973
55973
|
registerList({
|
|
@@ -56054,7 +56054,7 @@ var InMemorySubscriptions = class {
|
|
|
56054
56054
|
}
|
|
56055
56055
|
}
|
|
56056
56056
|
get(id, field) {
|
|
56057
|
-
return this.subscribers
|
|
56057
|
+
return this.subscribers.get(id)?.get(field)?.selections || [];
|
|
56058
56058
|
}
|
|
56059
56059
|
remove(id, selection, targets, variables, visited = []) {
|
|
56060
56060
|
visited.push(id);
|
|
@@ -56080,24 +56080,24 @@ var InMemorySubscriptions = class {
|
|
|
56080
56080
|
}
|
|
56081
56081
|
}
|
|
56082
56082
|
reset() {
|
|
56083
|
-
const subscribers =
|
|
56084
|
-
([id]) => !id.startsWith(rootID)
|
|
56085
|
-
);
|
|
56083
|
+
const subscribers = [...this.subscribers.entries()].filter(([id]) => !id.startsWith(rootID));
|
|
56086
56084
|
for (const [id, _fields] of subscribers) {
|
|
56087
|
-
|
|
56085
|
+
this.subscribers.delete(id);
|
|
56088
56086
|
}
|
|
56089
56087
|
const subscriptionSpecs = subscribers.flatMap(
|
|
56090
|
-
([_id, fields]) =>
|
|
56088
|
+
([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
|
|
56091
56089
|
);
|
|
56092
56090
|
return subscriptionSpecs;
|
|
56093
56091
|
}
|
|
56094
56092
|
removeSubscribers(id, fieldName, specs) {
|
|
56095
56093
|
let targets = [];
|
|
56094
|
+
const subscriber = this.subscribers.get(id);
|
|
56095
|
+
const subscriberField = subscriber?.get(fieldName);
|
|
56096
56096
|
for (const spec of specs) {
|
|
56097
|
-
|
|
56097
|
+
const counts = subscriber?.get(fieldName)?.referenceCounts;
|
|
56098
|
+
if (!counts?.has(spec.set)) {
|
|
56098
56099
|
continue;
|
|
56099
56100
|
}
|
|
56100
|
-
const counts = this.referenceCounts[id][fieldName];
|
|
56101
56101
|
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
56102
56102
|
counts.set(spec.set, newVal);
|
|
56103
56103
|
if (newVal <= 0) {
|
|
@@ -56105,18 +56105,19 @@ var InMemorySubscriptions = class {
|
|
|
56105
56105
|
counts.delete(spec.set);
|
|
56106
56106
|
}
|
|
56107
56107
|
}
|
|
56108
|
-
if (
|
|
56109
|
-
|
|
56108
|
+
if (subscriberField) {
|
|
56109
|
+
subscriberField.selections = this.get(id, fieldName).filter(
|
|
56110
56110
|
([{ set }]) => !targets.includes(set)
|
|
56111
56111
|
);
|
|
56112
56112
|
}
|
|
56113
56113
|
}
|
|
56114
56114
|
removeAllSubscribers(id, targets, visited = []) {
|
|
56115
56115
|
visited.push(id);
|
|
56116
|
-
|
|
56117
|
-
|
|
56118
|
-
|
|
56119
|
-
|
|
56116
|
+
const subscriber = this.subscribers.get(id);
|
|
56117
|
+
for (const [key, val] of subscriber?.entries() ?? []) {
|
|
56118
|
+
const subscribers = targets || val.selections.map(([spec]) => spec);
|
|
56119
|
+
this.removeSubscribers(id, key, subscribers);
|
|
56120
|
+
const { value, kind } = this.cache._internal_unstable.storage.get(id, key);
|
|
56120
56121
|
if (kind === "scalar") {
|
|
56121
56122
|
continue;
|
|
56122
56123
|
}
|
|
@@ -58264,7 +58265,7 @@ var FieldCollection = class {
|
|
|
58264
58265
|
return Object.keys(this.fields).length + Object.keys(this.inlineFragments).length + Object.keys(this.fragmentSpreads).length;
|
|
58265
58266
|
}
|
|
58266
58267
|
add({ selection, external }) {
|
|
58267
|
-
let include = this.config.defaultFragmentMasking === "disable";
|
|
58268
|
+
let include = this.applyFragments || this.config.defaultFragmentMasking === "disable";
|
|
58268
58269
|
const maskEnableDirective = selection.directives?.find(
|
|
58269
58270
|
({ name }) => name.value === this.config.maskEnableDirective
|
|
58270
58271
|
);
|
|
@@ -60598,7 +60599,12 @@ function prepareSelection({
|
|
|
60598
60599
|
object.fragments = {
|
|
60599
60600
|
...object.fragments,
|
|
60600
60601
|
[fragment2]: {
|
|
60601
|
-
arguments: args ?? {}
|
|
60602
|
+
arguments: args && Object.keys(args ?? {}).length > 0 ? args : Object.fromEntries(
|
|
60603
|
+
withArguments(config, field).map((arg) => [
|
|
60604
|
+
arg.name.value,
|
|
60605
|
+
arg.value
|
|
60606
|
+
])
|
|
60607
|
+
)
|
|
60602
60608
|
}
|
|
60603
60609
|
};
|
|
60604
60610
|
if (globalLoading || field.directives?.find((d) => d.name.value === config.loadingDirective)) {
|
|
@@ -60925,7 +60931,7 @@ function artifactGenerator(stats) {
|
|
|
60925
60931
|
document: doc,
|
|
60926
60932
|
rootType,
|
|
60927
60933
|
globalLoading,
|
|
60928
|
-
includeFragments:
|
|
60934
|
+
includeFragments: true,
|
|
60929
60935
|
hasComponents: () => {
|
|
60930
60936
|
hasComponents = true;
|
|
60931
60937
|
},
|
|
@@ -60934,7 +60940,7 @@ function artifactGenerator(stats) {
|
|
|
60934
60940
|
filepath: doc.filename,
|
|
60935
60941
|
selections: selectionSet.selections,
|
|
60936
60942
|
fragmentDefinitions,
|
|
60937
|
-
applyFragments:
|
|
60943
|
+
applyFragments: true
|
|
60938
60944
|
}),
|
|
60939
60945
|
operations: operationsByPath(
|
|
60940
60946
|
config,
|
package/build/vite-cjs/index.js
CHANGED
|
@@ -67628,11 +67628,10 @@ var InMemorySubscriptions = class {
|
|
|
67628
67628
|
constructor(cache) {
|
|
67629
67629
|
this.cache = cache;
|
|
67630
67630
|
}
|
|
67631
|
-
subscribers =
|
|
67632
|
-
referenceCounts = {};
|
|
67631
|
+
subscribers = /* @__PURE__ */ new Map();
|
|
67633
67632
|
keyVersions = {};
|
|
67634
67633
|
activeFields(parent2) {
|
|
67635
|
-
return Object.keys(this.subscribers
|
|
67634
|
+
return Object.keys(this.subscribers.get(parent2) || {});
|
|
67636
67635
|
}
|
|
67637
67636
|
add({
|
|
67638
67637
|
parent: parent2,
|
|
@@ -67706,27 +67705,28 @@ var InMemorySubscriptions = class {
|
|
|
67706
67705
|
type
|
|
67707
67706
|
}) {
|
|
67708
67707
|
const spec = selection[0];
|
|
67709
|
-
if (!this.subscribers
|
|
67710
|
-
this.subscribers
|
|
67711
|
-
}
|
|
67712
|
-
|
|
67713
|
-
|
|
67708
|
+
if (!this.subscribers.has(id)) {
|
|
67709
|
+
this.subscribers.set(id, /* @__PURE__ */ new Map());
|
|
67710
|
+
}
|
|
67711
|
+
const subscriber = this.subscribers.get(id);
|
|
67712
|
+
if (!subscriber.has(key)) {
|
|
67713
|
+
subscriber.set(key, {
|
|
67714
|
+
selections: [],
|
|
67715
|
+
referenceCounts: /* @__PURE__ */ new Map()
|
|
67716
|
+
});
|
|
67714
67717
|
}
|
|
67718
|
+
const subscriberField = subscriber.get(key);
|
|
67715
67719
|
if (!this.keyVersions[key]) {
|
|
67716
67720
|
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
67717
67721
|
}
|
|
67718
67722
|
this.keyVersions[key].add(key);
|
|
67719
|
-
if (!
|
|
67720
|
-
|
|
67721
|
-
}
|
|
67722
|
-
if (!this.referenceCounts[id]) {
|
|
67723
|
-
this.referenceCounts[id] = {};
|
|
67723
|
+
if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
|
|
67724
|
+
subscriberField.selections.push([spec, selection[1]]);
|
|
67724
67725
|
}
|
|
67725
|
-
|
|
67726
|
-
|
|
67727
|
-
|
|
67728
|
-
|
|
67729
|
-
counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
|
|
67726
|
+
subscriberField.referenceCounts.set(
|
|
67727
|
+
spec.set,
|
|
67728
|
+
(subscriberField.referenceCounts.get(spec.set) || 0) + 1
|
|
67729
|
+
);
|
|
67730
67730
|
this.cache._internal_unstable.lifetimes.resetLifetime(id, key);
|
|
67731
67731
|
}
|
|
67732
67732
|
registerList({
|
|
@@ -67813,7 +67813,7 @@ var InMemorySubscriptions = class {
|
|
|
67813
67813
|
}
|
|
67814
67814
|
}
|
|
67815
67815
|
get(id, field) {
|
|
67816
|
-
return this.subscribers
|
|
67816
|
+
return this.subscribers.get(id)?.get(field)?.selections || [];
|
|
67817
67817
|
}
|
|
67818
67818
|
remove(id, selection, targets, variables, visited = []) {
|
|
67819
67819
|
visited.push(id);
|
|
@@ -67839,24 +67839,24 @@ var InMemorySubscriptions = class {
|
|
|
67839
67839
|
}
|
|
67840
67840
|
}
|
|
67841
67841
|
reset() {
|
|
67842
|
-
const subscribers =
|
|
67843
|
-
([id]) => !id.startsWith(rootID)
|
|
67844
|
-
);
|
|
67842
|
+
const subscribers = [...this.subscribers.entries()].filter(([id]) => !id.startsWith(rootID));
|
|
67845
67843
|
for (const [id, _fields] of subscribers) {
|
|
67846
|
-
|
|
67844
|
+
this.subscribers.delete(id);
|
|
67847
67845
|
}
|
|
67848
67846
|
const subscriptionSpecs = subscribers.flatMap(
|
|
67849
|
-
([_id, fields]) =>
|
|
67847
|
+
([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
|
|
67850
67848
|
);
|
|
67851
67849
|
return subscriptionSpecs;
|
|
67852
67850
|
}
|
|
67853
67851
|
removeSubscribers(id, fieldName, specs) {
|
|
67854
67852
|
let targets = [];
|
|
67853
|
+
const subscriber = this.subscribers.get(id);
|
|
67854
|
+
const subscriberField = subscriber?.get(fieldName);
|
|
67855
67855
|
for (const spec of specs) {
|
|
67856
|
-
|
|
67856
|
+
const counts = subscriber?.get(fieldName)?.referenceCounts;
|
|
67857
|
+
if (!counts?.has(spec.set)) {
|
|
67857
67858
|
continue;
|
|
67858
67859
|
}
|
|
67859
|
-
const counts = this.referenceCounts[id][fieldName];
|
|
67860
67860
|
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
67861
67861
|
counts.set(spec.set, newVal);
|
|
67862
67862
|
if (newVal <= 0) {
|
|
@@ -67864,18 +67864,19 @@ var InMemorySubscriptions = class {
|
|
|
67864
67864
|
counts.delete(spec.set);
|
|
67865
67865
|
}
|
|
67866
67866
|
}
|
|
67867
|
-
if (
|
|
67868
|
-
|
|
67867
|
+
if (subscriberField) {
|
|
67868
|
+
subscriberField.selections = this.get(id, fieldName).filter(
|
|
67869
67869
|
([{ set }]) => !targets.includes(set)
|
|
67870
67870
|
);
|
|
67871
67871
|
}
|
|
67872
67872
|
}
|
|
67873
67873
|
removeAllSubscribers(id, targets, visited = []) {
|
|
67874
67874
|
visited.push(id);
|
|
67875
|
-
|
|
67876
|
-
|
|
67877
|
-
|
|
67878
|
-
|
|
67875
|
+
const subscriber = this.subscribers.get(id);
|
|
67876
|
+
for (const [key, val] of subscriber?.entries() ?? []) {
|
|
67877
|
+
const subscribers = targets || val.selections.map(([spec]) => spec);
|
|
67878
|
+
this.removeSubscribers(id, key, subscribers);
|
|
67879
|
+
const { value, kind } = this.cache._internal_unstable.storage.get(id, key);
|
|
67879
67880
|
if (kind === "scalar") {
|
|
67880
67881
|
continue;
|
|
67881
67882
|
}
|
|
@@ -70959,7 +70960,7 @@ var FieldCollection = class {
|
|
|
70959
70960
|
return Object.keys(this.fields).length + Object.keys(this.inlineFragments).length + Object.keys(this.fragmentSpreads).length;
|
|
70960
70961
|
}
|
|
70961
70962
|
add({ selection, external }) {
|
|
70962
|
-
let include = this.config.defaultFragmentMasking === "disable";
|
|
70963
|
+
let include = this.applyFragments || this.config.defaultFragmentMasking === "disable";
|
|
70963
70964
|
const maskEnableDirective = selection.directives?.find(
|
|
70964
70965
|
({ name }) => name.value === this.config.maskEnableDirective
|
|
70965
70966
|
);
|
|
@@ -73293,7 +73294,12 @@ function prepareSelection({
|
|
|
73293
73294
|
object.fragments = {
|
|
73294
73295
|
...object.fragments,
|
|
73295
73296
|
[fragment2]: {
|
|
73296
|
-
arguments: args ?? {}
|
|
73297
|
+
arguments: args && Object.keys(args ?? {}).length > 0 ? args : Object.fromEntries(
|
|
73298
|
+
withArguments(config2, field).map((arg) => [
|
|
73299
|
+
arg.name.value,
|
|
73300
|
+
arg.value
|
|
73301
|
+
])
|
|
73302
|
+
)
|
|
73297
73303
|
}
|
|
73298
73304
|
};
|
|
73299
73305
|
if (globalLoading || field.directives?.find((d) => d.name.value === config2.loadingDirective)) {
|
|
@@ -73620,7 +73626,7 @@ function artifactGenerator(stats) {
|
|
|
73620
73626
|
document: doc,
|
|
73621
73627
|
rootType,
|
|
73622
73628
|
globalLoading,
|
|
73623
|
-
includeFragments:
|
|
73629
|
+
includeFragments: true,
|
|
73624
73630
|
hasComponents: () => {
|
|
73625
73631
|
hasComponents = true;
|
|
73626
73632
|
},
|
|
@@ -73629,7 +73635,7 @@ function artifactGenerator(stats) {
|
|
|
73629
73635
|
filepath: doc.filename,
|
|
73630
73636
|
selections: selectionSet.selections,
|
|
73631
73637
|
fragmentDefinitions,
|
|
73632
|
-
applyFragments:
|
|
73638
|
+
applyFragments: true
|
|
73633
73639
|
}),
|
|
73634
73640
|
operations: operationsByPath(
|
|
73635
73641
|
config2,
|