houdini-svelte 2.2.0-next.3 → 2.2.0-next.5
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 +72 -58
- package/build/plugin-esm/index.js +72 -58
- package/build/preprocess-cjs/index.js +72 -58
- package/build/preprocess-esm/index.js +72 -58
- package/build/test-cjs/index.js +144 -116
- package/build/test-esm/index.js +144 -116
- package/package.json +2 -2
package/build/test-esm/index.js
CHANGED
|
@@ -87140,20 +87140,21 @@ var CacheInternal = class {
|
|
|
87140
87140
|
} else if (Array.isArray(value) && // make typescript happy
|
|
87141
87141
|
(typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
|
|
87142
87142
|
let oldIDs = [...previousValue || []];
|
|
87143
|
-
|
|
87144
|
-
|
|
87145
|
-
|
|
87146
|
-
|
|
87147
|
-
|
|
87148
|
-
|
|
87149
|
-
|
|
87150
|
-
|
|
87151
|
-
|
|
87152
|
-
|
|
87153
|
-
|
|
87154
|
-
|
|
87155
|
-
|
|
87156
|
-
|
|
87143
|
+
if (updates?.includes("append") || updates?.includes("prepend")) {
|
|
87144
|
+
oldIDs = oldIDs.filter((id) => {
|
|
87145
|
+
for (const layer2 of this.storage.data) {
|
|
87146
|
+
for (const operation of Object.values(layer2.operations)) {
|
|
87147
|
+
if (operation.fields?.[key])
|
|
87148
|
+
for (const listOperation of operation.fields[key]) {
|
|
87149
|
+
if ("id" in listOperation && listOperation.id === id) {
|
|
87150
|
+
return false;
|
|
87151
|
+
}
|
|
87152
|
+
}
|
|
87153
|
+
}
|
|
87154
|
+
}
|
|
87155
|
+
return true;
|
|
87156
|
+
});
|
|
87157
|
+
}
|
|
87157
87158
|
let linkedIDs = [];
|
|
87158
87159
|
const { newIDs, nestedIDs } = this.extractNestedListIDs({
|
|
87159
87160
|
value,
|
|
@@ -87172,39 +87173,45 @@ var CacheInternal = class {
|
|
|
87172
87173
|
layer.writeLink(parent2, key, linkedIDs);
|
|
87173
87174
|
};
|
|
87174
87175
|
if (applyUpdates && updates) {
|
|
87175
|
-
|
|
87176
|
-
const
|
|
87177
|
-
for (const id of
|
|
87176
|
+
const filterIDs = (keep, insert) => {
|
|
87177
|
+
const existingIDs = /* @__PURE__ */ new Set();
|
|
87178
|
+
for (const id of keep) {
|
|
87178
87179
|
if (!id) {
|
|
87179
87180
|
continue;
|
|
87180
87181
|
}
|
|
87181
87182
|
const { value: node } = this.storage.get(id, "node");
|
|
87182
|
-
if (
|
|
87183
|
+
if (!node) {
|
|
87183
87184
|
continue;
|
|
87184
87185
|
}
|
|
87185
|
-
|
|
87186
|
+
const nodeID = this.storage.get(node, "id");
|
|
87187
|
+
if (!nodeID) {
|
|
87186
87188
|
continue;
|
|
87187
87189
|
}
|
|
87188
|
-
|
|
87190
|
+
existingIDs.add(nodeID.value);
|
|
87189
87191
|
}
|
|
87190
|
-
|
|
87192
|
+
return insert.filter((id) => {
|
|
87191
87193
|
if (!id) {
|
|
87192
87194
|
return true;
|
|
87193
87195
|
}
|
|
87194
|
-
const { value:
|
|
87195
|
-
|
|
87196
|
-
|
|
87197
|
-
return false;
|
|
87196
|
+
const { value: node } = this.storage.get(id, "node");
|
|
87197
|
+
if (!node) {
|
|
87198
|
+
return true;
|
|
87198
87199
|
}
|
|
87199
|
-
|
|
87200
|
+
const nodeID = this.storage.get(node, "id");
|
|
87201
|
+
if (!nodeID) {
|
|
87202
|
+
return true;
|
|
87203
|
+
}
|
|
87204
|
+
return !existingIDs.has(nodeID.value);
|
|
87200
87205
|
});
|
|
87201
|
-
}
|
|
87206
|
+
};
|
|
87202
87207
|
for (const update of applyUpdates) {
|
|
87203
87208
|
if (update !== "replace" && !updates.includes(update)) {
|
|
87204
87209
|
continue;
|
|
87205
87210
|
}
|
|
87206
87211
|
if (update === "prepend") {
|
|
87207
|
-
linkedIDs = newIDs.concat(
|
|
87212
|
+
linkedIDs = newIDs.concat(
|
|
87213
|
+
filterIDs(newIDs, oldIDs)
|
|
87214
|
+
);
|
|
87208
87215
|
if (layer?.optimistic) {
|
|
87209
87216
|
action = () => {
|
|
87210
87217
|
for (const id of newIDs) {
|
|
@@ -87215,7 +87222,7 @@ var CacheInternal = class {
|
|
|
87215
87222
|
};
|
|
87216
87223
|
}
|
|
87217
87224
|
} else if (update === "append") {
|
|
87218
|
-
linkedIDs = oldIDs.concat(newIDs);
|
|
87225
|
+
linkedIDs = filterIDs(newIDs, oldIDs).concat(newIDs);
|
|
87219
87226
|
if (layer?.optimistic) {
|
|
87220
87227
|
action = () => {
|
|
87221
87228
|
for (const id of newIDs) {
|
|
@@ -152660,20 +152667,21 @@ var CacheInternal2 = class {
|
|
|
152660
152667
|
} else if (Array.isArray(value) && // make typescript happy
|
|
152661
152668
|
(typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
|
|
152662
152669
|
let oldIDs = [...previousValue || []];
|
|
152663
|
-
|
|
152664
|
-
|
|
152665
|
-
|
|
152666
|
-
|
|
152667
|
-
|
|
152668
|
-
|
|
152669
|
-
|
|
152670
|
-
|
|
152671
|
-
|
|
152672
|
-
|
|
152673
|
-
|
|
152674
|
-
|
|
152675
|
-
|
|
152676
|
-
|
|
152670
|
+
if (updates?.includes("append") || updates?.includes("prepend")) {
|
|
152671
|
+
oldIDs = oldIDs.filter((id) => {
|
|
152672
|
+
for (const layer2 of this.storage.data) {
|
|
152673
|
+
for (const operation of Object.values(layer2.operations)) {
|
|
152674
|
+
if (operation.fields?.[key])
|
|
152675
|
+
for (const listOperation of operation.fields[key]) {
|
|
152676
|
+
if ("id" in listOperation && listOperation.id === id) {
|
|
152677
|
+
return false;
|
|
152678
|
+
}
|
|
152679
|
+
}
|
|
152680
|
+
}
|
|
152681
|
+
}
|
|
152682
|
+
return true;
|
|
152683
|
+
});
|
|
152684
|
+
}
|
|
152677
152685
|
let linkedIDs = [];
|
|
152678
152686
|
const { newIDs, nestedIDs } = this.extractNestedListIDs({
|
|
152679
152687
|
value,
|
|
@@ -152692,39 +152700,45 @@ var CacheInternal2 = class {
|
|
|
152692
152700
|
layer.writeLink(parent2, key, linkedIDs);
|
|
152693
152701
|
};
|
|
152694
152702
|
if (applyUpdates && updates) {
|
|
152695
|
-
|
|
152696
|
-
const
|
|
152697
|
-
for (const id of
|
|
152703
|
+
const filterIDs = (keep, insert) => {
|
|
152704
|
+
const existingIDs = /* @__PURE__ */ new Set();
|
|
152705
|
+
for (const id of keep) {
|
|
152698
152706
|
if (!id) {
|
|
152699
152707
|
continue;
|
|
152700
152708
|
}
|
|
152701
152709
|
const { value: node } = this.storage.get(id, "node");
|
|
152702
|
-
if (
|
|
152710
|
+
if (!node) {
|
|
152703
152711
|
continue;
|
|
152704
152712
|
}
|
|
152705
|
-
|
|
152713
|
+
const nodeID = this.storage.get(node, "id");
|
|
152714
|
+
if (!nodeID) {
|
|
152706
152715
|
continue;
|
|
152707
152716
|
}
|
|
152708
|
-
|
|
152717
|
+
existingIDs.add(nodeID.value);
|
|
152709
152718
|
}
|
|
152710
|
-
|
|
152719
|
+
return insert.filter((id) => {
|
|
152711
152720
|
if (!id) {
|
|
152712
152721
|
return true;
|
|
152713
152722
|
}
|
|
152714
|
-
const { value:
|
|
152715
|
-
|
|
152716
|
-
|
|
152717
|
-
return false;
|
|
152723
|
+
const { value: node } = this.storage.get(id, "node");
|
|
152724
|
+
if (!node) {
|
|
152725
|
+
return true;
|
|
152718
152726
|
}
|
|
152719
|
-
|
|
152727
|
+
const nodeID = this.storage.get(node, "id");
|
|
152728
|
+
if (!nodeID) {
|
|
152729
|
+
return true;
|
|
152730
|
+
}
|
|
152731
|
+
return !existingIDs.has(nodeID.value);
|
|
152720
152732
|
});
|
|
152721
|
-
}
|
|
152733
|
+
};
|
|
152722
152734
|
for (const update of applyUpdates) {
|
|
152723
152735
|
if (update !== "replace" && !updates.includes(update)) {
|
|
152724
152736
|
continue;
|
|
152725
152737
|
}
|
|
152726
152738
|
if (update === "prepend") {
|
|
152727
|
-
linkedIDs = newIDs.concat(
|
|
152739
|
+
linkedIDs = newIDs.concat(
|
|
152740
|
+
filterIDs(newIDs, oldIDs)
|
|
152741
|
+
);
|
|
152728
152742
|
if (layer?.optimistic) {
|
|
152729
152743
|
action = () => {
|
|
152730
152744
|
for (const id of newIDs) {
|
|
@@ -152735,7 +152749,7 @@ var CacheInternal2 = class {
|
|
|
152735
152749
|
};
|
|
152736
152750
|
}
|
|
152737
152751
|
} else if (update === "append") {
|
|
152738
|
-
linkedIDs = oldIDs.concat(newIDs);
|
|
152752
|
+
linkedIDs = filterIDs(newIDs, oldIDs).concat(newIDs);
|
|
152739
152753
|
if (layer?.optimistic) {
|
|
152740
152754
|
action = () => {
|
|
152741
152755
|
for (const id of newIDs) {
|
|
@@ -225779,20 +225793,21 @@ var CacheInternal3 = class {
|
|
|
225779
225793
|
} else if (Array.isArray(value) && // make typescript happy
|
|
225780
225794
|
(typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
|
|
225781
225795
|
let oldIDs = [...previousValue || []];
|
|
225782
|
-
|
|
225783
|
-
|
|
225784
|
-
|
|
225785
|
-
|
|
225786
|
-
|
|
225787
|
-
|
|
225788
|
-
|
|
225789
|
-
|
|
225790
|
-
|
|
225791
|
-
|
|
225792
|
-
|
|
225793
|
-
|
|
225794
|
-
|
|
225795
|
-
|
|
225796
|
+
if (updates?.includes("append") || updates?.includes("prepend")) {
|
|
225797
|
+
oldIDs = oldIDs.filter((id) => {
|
|
225798
|
+
for (const layer2 of this.storage.data) {
|
|
225799
|
+
for (const operation of Object.values(layer2.operations)) {
|
|
225800
|
+
if (operation.fields?.[key])
|
|
225801
|
+
for (const listOperation of operation.fields[key]) {
|
|
225802
|
+
if ("id" in listOperation && listOperation.id === id) {
|
|
225803
|
+
return false;
|
|
225804
|
+
}
|
|
225805
|
+
}
|
|
225806
|
+
}
|
|
225807
|
+
}
|
|
225808
|
+
return true;
|
|
225809
|
+
});
|
|
225810
|
+
}
|
|
225796
225811
|
let linkedIDs = [];
|
|
225797
225812
|
const { newIDs, nestedIDs } = this.extractNestedListIDs({
|
|
225798
225813
|
value,
|
|
@@ -225811,39 +225826,45 @@ var CacheInternal3 = class {
|
|
|
225811
225826
|
layer.writeLink(parent2, key, linkedIDs);
|
|
225812
225827
|
};
|
|
225813
225828
|
if (applyUpdates && updates) {
|
|
225814
|
-
|
|
225815
|
-
const
|
|
225816
|
-
for (const id of
|
|
225829
|
+
const filterIDs = (keep, insert) => {
|
|
225830
|
+
const existingIDs = /* @__PURE__ */ new Set();
|
|
225831
|
+
for (const id of keep) {
|
|
225817
225832
|
if (!id) {
|
|
225818
225833
|
continue;
|
|
225819
225834
|
}
|
|
225820
225835
|
const { value: node } = this.storage.get(id, "node");
|
|
225821
|
-
if (
|
|
225836
|
+
if (!node) {
|
|
225822
225837
|
continue;
|
|
225823
225838
|
}
|
|
225824
|
-
|
|
225839
|
+
const nodeID = this.storage.get(node, "id");
|
|
225840
|
+
if (!nodeID) {
|
|
225825
225841
|
continue;
|
|
225826
225842
|
}
|
|
225827
|
-
|
|
225843
|
+
existingIDs.add(nodeID.value);
|
|
225828
225844
|
}
|
|
225829
|
-
|
|
225845
|
+
return insert.filter((id) => {
|
|
225830
225846
|
if (!id) {
|
|
225831
225847
|
return true;
|
|
225832
225848
|
}
|
|
225833
|
-
const { value:
|
|
225834
|
-
|
|
225835
|
-
|
|
225836
|
-
return false;
|
|
225849
|
+
const { value: node } = this.storage.get(id, "node");
|
|
225850
|
+
if (!node) {
|
|
225851
|
+
return true;
|
|
225837
225852
|
}
|
|
225838
|
-
|
|
225853
|
+
const nodeID = this.storage.get(node, "id");
|
|
225854
|
+
if (!nodeID) {
|
|
225855
|
+
return true;
|
|
225856
|
+
}
|
|
225857
|
+
return !existingIDs.has(nodeID.value);
|
|
225839
225858
|
});
|
|
225840
|
-
}
|
|
225859
|
+
};
|
|
225841
225860
|
for (const update of applyUpdates) {
|
|
225842
225861
|
if (update !== "replace" && !updates.includes(update)) {
|
|
225843
225862
|
continue;
|
|
225844
225863
|
}
|
|
225845
225864
|
if (update === "prepend") {
|
|
225846
|
-
linkedIDs = newIDs.concat(
|
|
225865
|
+
linkedIDs = newIDs.concat(
|
|
225866
|
+
filterIDs(newIDs, oldIDs)
|
|
225867
|
+
);
|
|
225847
225868
|
if (layer?.optimistic) {
|
|
225848
225869
|
action = () => {
|
|
225849
225870
|
for (const id of newIDs) {
|
|
@@ -225854,7 +225875,7 @@ var CacheInternal3 = class {
|
|
|
225854
225875
|
};
|
|
225855
225876
|
}
|
|
225856
225877
|
} else if (update === "append") {
|
|
225857
|
-
linkedIDs = oldIDs.concat(newIDs);
|
|
225878
|
+
linkedIDs = filterIDs(newIDs, oldIDs).concat(newIDs);
|
|
225858
225879
|
if (layer?.optimistic) {
|
|
225859
225880
|
action = () => {
|
|
225860
225881
|
for (const id of newIDs) {
|
|
@@ -298576,20 +298597,21 @@ var CacheInternal4 = class {
|
|
|
298576
298597
|
} else if (Array.isArray(value) && // make typescript happy
|
|
298577
298598
|
(typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
|
|
298578
298599
|
let oldIDs = [...previousValue || []];
|
|
298579
|
-
|
|
298580
|
-
|
|
298581
|
-
|
|
298582
|
-
|
|
298583
|
-
|
|
298584
|
-
|
|
298585
|
-
|
|
298586
|
-
|
|
298587
|
-
|
|
298588
|
-
|
|
298589
|
-
|
|
298590
|
-
|
|
298591
|
-
|
|
298592
|
-
|
|
298600
|
+
if (updates?.includes("append") || updates?.includes("prepend")) {
|
|
298601
|
+
oldIDs = oldIDs.filter((id) => {
|
|
298602
|
+
for (const layer2 of this.storage.data) {
|
|
298603
|
+
for (const operation of Object.values(layer2.operations)) {
|
|
298604
|
+
if (operation.fields?.[key])
|
|
298605
|
+
for (const listOperation of operation.fields[key]) {
|
|
298606
|
+
if ("id" in listOperation && listOperation.id === id) {
|
|
298607
|
+
return false;
|
|
298608
|
+
}
|
|
298609
|
+
}
|
|
298610
|
+
}
|
|
298611
|
+
}
|
|
298612
|
+
return true;
|
|
298613
|
+
});
|
|
298614
|
+
}
|
|
298593
298615
|
let linkedIDs = [];
|
|
298594
298616
|
const { newIDs, nestedIDs } = this.extractNestedListIDs({
|
|
298595
298617
|
value,
|
|
@@ -298608,39 +298630,45 @@ var CacheInternal4 = class {
|
|
|
298608
298630
|
layer.writeLink(parent2, key, linkedIDs);
|
|
298609
298631
|
};
|
|
298610
298632
|
if (applyUpdates && updates) {
|
|
298611
|
-
|
|
298612
|
-
const
|
|
298613
|
-
for (const id of
|
|
298633
|
+
const filterIDs = (keep, insert) => {
|
|
298634
|
+
const existingIDs = /* @__PURE__ */ new Set();
|
|
298635
|
+
for (const id of keep) {
|
|
298614
298636
|
if (!id) {
|
|
298615
298637
|
continue;
|
|
298616
298638
|
}
|
|
298617
298639
|
const { value: node } = this.storage.get(id, "node");
|
|
298618
|
-
if (
|
|
298640
|
+
if (!node) {
|
|
298619
298641
|
continue;
|
|
298620
298642
|
}
|
|
298621
|
-
|
|
298643
|
+
const nodeID = this.storage.get(node, "id");
|
|
298644
|
+
if (!nodeID) {
|
|
298622
298645
|
continue;
|
|
298623
298646
|
}
|
|
298624
|
-
|
|
298647
|
+
existingIDs.add(nodeID.value);
|
|
298625
298648
|
}
|
|
298626
|
-
|
|
298649
|
+
return insert.filter((id) => {
|
|
298627
298650
|
if (!id) {
|
|
298628
298651
|
return true;
|
|
298629
298652
|
}
|
|
298630
|
-
const { value:
|
|
298631
|
-
|
|
298632
|
-
|
|
298633
|
-
return false;
|
|
298653
|
+
const { value: node } = this.storage.get(id, "node");
|
|
298654
|
+
if (!node) {
|
|
298655
|
+
return true;
|
|
298634
298656
|
}
|
|
298635
|
-
|
|
298657
|
+
const nodeID = this.storage.get(node, "id");
|
|
298658
|
+
if (!nodeID) {
|
|
298659
|
+
return true;
|
|
298660
|
+
}
|
|
298661
|
+
return !existingIDs.has(nodeID.value);
|
|
298636
298662
|
});
|
|
298637
|
-
}
|
|
298663
|
+
};
|
|
298638
298664
|
for (const update of applyUpdates) {
|
|
298639
298665
|
if (update !== "replace" && !updates.includes(update)) {
|
|
298640
298666
|
continue;
|
|
298641
298667
|
}
|
|
298642
298668
|
if (update === "prepend") {
|
|
298643
|
-
linkedIDs = newIDs.concat(
|
|
298669
|
+
linkedIDs = newIDs.concat(
|
|
298670
|
+
filterIDs(newIDs, oldIDs)
|
|
298671
|
+
);
|
|
298644
298672
|
if (layer?.optimistic) {
|
|
298645
298673
|
action = () => {
|
|
298646
298674
|
for (const id of newIDs) {
|
|
@@ -298651,7 +298679,7 @@ var CacheInternal4 = class {
|
|
|
298651
298679
|
};
|
|
298652
298680
|
}
|
|
298653
298681
|
} else if (update === "append") {
|
|
298654
|
-
linkedIDs = oldIDs.concat(newIDs);
|
|
298682
|
+
linkedIDs = filterIDs(newIDs, oldIDs).concat(newIDs);
|
|
298655
298683
|
if (layer?.optimistic) {
|
|
298656
298684
|
action = () => {
|
|
298657
298685
|
for (const id of newIDs) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "houdini-svelte",
|
|
3
|
-
"version": "2.2.0-next.
|
|
3
|
+
"version": "2.2.0-next.5",
|
|
4
4
|
"description": "The svelte plugin for houdini",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"graphql": "^16.10.0",
|
|
31
31
|
"recast": "^0.23.1",
|
|
32
32
|
"rollup": "^4.39.0",
|
|
33
|
-
"houdini": "^2.0.0-next.
|
|
33
|
+
"houdini": "^2.0.0-next.3"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@sveltejs/kit": "^2.9.0",
|