houdini-svelte 2.1.10 → 2.1.12
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 +32 -24
- package/build/plugin-esm/index.js +32 -24
- package/build/preprocess-cjs/index.js +29 -23
- package/build/preprocess-esm/index.js +29 -23
- package/build/runtime/client.d.ts +1 -0
- package/build/runtime/stores/index.d.ts +1 -1
- package/build/runtime-cjs/client.d.ts +1 -0
- package/build/runtime-cjs/client.js +22 -5
- package/build/runtime-cjs/stores/base.js +5 -0
- package/build/runtime-cjs/stores/fragment.js +4 -0
- package/build/runtime-cjs/stores/index.d.ts +1 -1
- package/build/runtime-cjs/stores/index.js +1 -1
- package/build/runtime-cjs/stores/mutation.js +2 -0
- package/build/runtime-cjs/stores/query.js +5 -1
- package/build/runtime-cjs/stores/subscription.js +3 -0
- package/build/runtime-esm/client.d.ts +1 -0
- package/build/runtime-esm/client.js +18 -2
- package/build/runtime-esm/stores/base.js +6 -1
- package/build/runtime-esm/stores/fragment.js +5 -1
- package/build/runtime-esm/stores/index.d.ts +1 -1
- package/build/runtime-esm/stores/index.js +1 -1
- package/build/runtime-esm/stores/mutation.js +2 -0
- package/build/runtime-esm/stores/query.js +6 -2
- package/build/runtime-esm/stores/subscription.js +3 -0
- package/build/test-cjs/index.js +32 -24
- package/build/test-esm/index.js +32 -24
- package/package.json +1 -1
|
@@ -151559,7 +151559,7 @@ function ensure_imports({
|
|
|
151559
151559
|
script.body.unshift({
|
|
151560
151560
|
type: "ImportDeclaration",
|
|
151561
151561
|
source: AST16.stringLiteral(sourceModule),
|
|
151562
|
-
importKind
|
|
151562
|
+
importKind: importKind === "type" ? "type" : "value"
|
|
151563
151563
|
});
|
|
151564
151564
|
}
|
|
151565
151565
|
return { ids: [], added: has_import ? 0 : 1 };
|
|
@@ -151573,13 +151573,12 @@ function ensure_imports({
|
|
|
151573
151573
|
)
|
|
151574
151574
|
);
|
|
151575
151575
|
if (toImport.length > 0) {
|
|
151576
|
+
const specifier = (identifier, i22) => importKind !== "module" ? !Array.isArray(importID) ? AST16.importDefaultSpecifier(identifier) : AST16.importSpecifier(identifier, as?.[i22] ? AST16.identifier(as[i22]) : identifier) : AST16.importNamespaceSpecifier(identifier);
|
|
151576
151577
|
script.body.unshift({
|
|
151577
151578
|
type: "ImportDeclaration",
|
|
151578
151579
|
source: AST16.stringLiteral(sourceModule),
|
|
151579
|
-
specifiers: toImport.map(
|
|
151580
|
-
|
|
151581
|
-
),
|
|
151582
|
-
importKind
|
|
151580
|
+
specifiers: toImport.map(specifier),
|
|
151581
|
+
importKind: importKind === "type" ? "type" : "value"
|
|
151583
151582
|
});
|
|
151584
151583
|
}
|
|
151585
151584
|
for (const [i22, target] of (as ?? []).entries()) {
|
|
@@ -152853,6 +152852,7 @@ async function queryStore({ config, pluginRoot }, doc) {
|
|
|
152853
152852
|
const { store_class, statement } = store_import2(config, which);
|
|
152854
152853
|
const storeData = `${statement}
|
|
152855
152854
|
import artifact from '$houdini/artifacts/${artifactName}'
|
|
152855
|
+
import { initClient } from '$houdini/plugins/houdini-svelte/runtime/client'
|
|
152856
152856
|
|
|
152857
152857
|
export class ${storeName} extends ${store_class} {
|
|
152858
152858
|
constructor() {
|
|
@@ -152865,6 +152865,7 @@ export class ${storeName} extends ${store_class} {
|
|
|
152865
152865
|
}
|
|
152866
152866
|
|
|
152867
152867
|
export async function load_${artifactName}(params) {
|
|
152868
|
+
await initClient()
|
|
152868
152869
|
|
|
152869
152870
|
const store = new ${storeName}()
|
|
152870
152871
|
|
|
@@ -153468,27 +153469,34 @@ async function kit_init(page) {
|
|
|
153468
153469
|
script: page.script,
|
|
153469
153470
|
config: page.config,
|
|
153470
153471
|
sourceModule: "$app/stores",
|
|
153471
|
-
|
|
153472
|
-
|
|
153472
|
+
importKind: "module",
|
|
153473
|
+
import: "__houdini__pageStores"
|
|
153474
|
+
}).ids;
|
|
153473
153475
|
page.script.body.push(
|
|
153474
153476
|
AST18.expressionStatement(
|
|
153475
|
-
AST18.callExpression(
|
|
153476
|
-
AST18.
|
|
153477
|
-
|
|
153478
|
-
AST18.
|
|
153479
|
-
|
|
153480
|
-
|
|
153481
|
-
|
|
153482
|
-
|
|
153483
|
-
|
|
153484
|
-
|
|
153485
|
-
|
|
153477
|
+
AST18.callExpression(
|
|
153478
|
+
AST18.memberExpression(
|
|
153479
|
+
AST18.memberExpression(store_id, AST18.identifier("page")),
|
|
153480
|
+
AST18.identifier("subscribe")
|
|
153481
|
+
),
|
|
153482
|
+
[
|
|
153483
|
+
AST18.arrowFunctionExpression(
|
|
153484
|
+
[AST18.identifier("val")],
|
|
153485
|
+
AST18.blockStatement([
|
|
153486
|
+
AST18.expressionStatement(
|
|
153487
|
+
AST18.callExpression(set_session, [
|
|
153488
|
+
AST18.callExpression(extract_session, [
|
|
153489
|
+
AST18.memberExpression(
|
|
153490
|
+
AST18.identifier("val"),
|
|
153491
|
+
AST18.identifier("data")
|
|
153492
|
+
)
|
|
153493
|
+
])
|
|
153486
153494
|
])
|
|
153487
|
-
|
|
153488
|
-
)
|
|
153489
|
-
|
|
153490
|
-
|
|
153491
|
-
|
|
153495
|
+
)
|
|
153496
|
+
])
|
|
153497
|
+
)
|
|
153498
|
+
]
|
|
153499
|
+
)
|
|
153492
153500
|
)
|
|
153493
153501
|
);
|
|
153494
153502
|
}
|
|
@@ -154238,7 +154246,7 @@ export const redirect = svelteKitRedirect
|
|
|
154238
154246
|
path_exports.dirname(networkFilePath),
|
|
154239
154247
|
path_exports.join(config.projectRoot, plugin_config(config).client)
|
|
154240
154248
|
);
|
|
154241
|
-
return content.
|
|
154249
|
+
return content.replaceAll("HOUDINI_CLIENT_PATH", relativePath);
|
|
154242
154250
|
}
|
|
154243
154251
|
},
|
|
154244
154252
|
artifactData,
|
|
@@ -151554,7 +151554,7 @@ function ensure_imports({
|
|
|
151554
151554
|
script.body.unshift({
|
|
151555
151555
|
type: "ImportDeclaration",
|
|
151556
151556
|
source: AST16.stringLiteral(sourceModule),
|
|
151557
|
-
importKind
|
|
151557
|
+
importKind: importKind === "type" ? "type" : "value"
|
|
151558
151558
|
});
|
|
151559
151559
|
}
|
|
151560
151560
|
return { ids: [], added: has_import ? 0 : 1 };
|
|
@@ -151568,13 +151568,12 @@ function ensure_imports({
|
|
|
151568
151568
|
)
|
|
151569
151569
|
);
|
|
151570
151570
|
if (toImport.length > 0) {
|
|
151571
|
+
const specifier = (identifier, i22) => importKind !== "module" ? !Array.isArray(importID) ? AST16.importDefaultSpecifier(identifier) : AST16.importSpecifier(identifier, as?.[i22] ? AST16.identifier(as[i22]) : identifier) : AST16.importNamespaceSpecifier(identifier);
|
|
151571
151572
|
script.body.unshift({
|
|
151572
151573
|
type: "ImportDeclaration",
|
|
151573
151574
|
source: AST16.stringLiteral(sourceModule),
|
|
151574
|
-
specifiers: toImport.map(
|
|
151575
|
-
|
|
151576
|
-
),
|
|
151577
|
-
importKind
|
|
151575
|
+
specifiers: toImport.map(specifier),
|
|
151576
|
+
importKind: importKind === "type" ? "type" : "value"
|
|
151578
151577
|
});
|
|
151579
151578
|
}
|
|
151580
151579
|
for (const [i22, target] of (as ?? []).entries()) {
|
|
@@ -152848,6 +152847,7 @@ async function queryStore({ config, pluginRoot }, doc) {
|
|
|
152848
152847
|
const { store_class, statement } = store_import2(config, which);
|
|
152849
152848
|
const storeData = `${statement}
|
|
152850
152849
|
import artifact from '$houdini/artifacts/${artifactName}'
|
|
152850
|
+
import { initClient } from '$houdini/plugins/houdini-svelte/runtime/client'
|
|
152851
152851
|
|
|
152852
152852
|
export class ${storeName} extends ${store_class} {
|
|
152853
152853
|
constructor() {
|
|
@@ -152860,6 +152860,7 @@ export class ${storeName} extends ${store_class} {
|
|
|
152860
152860
|
}
|
|
152861
152861
|
|
|
152862
152862
|
export async function load_${artifactName}(params) {
|
|
152863
|
+
await initClient()
|
|
152863
152864
|
|
|
152864
152865
|
const store = new ${storeName}()
|
|
152865
152866
|
|
|
@@ -153463,27 +153464,34 @@ async function kit_init(page) {
|
|
|
153463
153464
|
script: page.script,
|
|
153464
153465
|
config: page.config,
|
|
153465
153466
|
sourceModule: "$app/stores",
|
|
153466
|
-
|
|
153467
|
-
|
|
153467
|
+
importKind: "module",
|
|
153468
|
+
import: "__houdini__pageStores"
|
|
153469
|
+
}).ids;
|
|
153468
153470
|
page.script.body.push(
|
|
153469
153471
|
AST18.expressionStatement(
|
|
153470
|
-
AST18.callExpression(
|
|
153471
|
-
AST18.
|
|
153472
|
-
|
|
153473
|
-
AST18.
|
|
153474
|
-
|
|
153475
|
-
|
|
153476
|
-
|
|
153477
|
-
|
|
153478
|
-
|
|
153479
|
-
|
|
153480
|
-
|
|
153472
|
+
AST18.callExpression(
|
|
153473
|
+
AST18.memberExpression(
|
|
153474
|
+
AST18.memberExpression(store_id, AST18.identifier("page")),
|
|
153475
|
+
AST18.identifier("subscribe")
|
|
153476
|
+
),
|
|
153477
|
+
[
|
|
153478
|
+
AST18.arrowFunctionExpression(
|
|
153479
|
+
[AST18.identifier("val")],
|
|
153480
|
+
AST18.blockStatement([
|
|
153481
|
+
AST18.expressionStatement(
|
|
153482
|
+
AST18.callExpression(set_session, [
|
|
153483
|
+
AST18.callExpression(extract_session, [
|
|
153484
|
+
AST18.memberExpression(
|
|
153485
|
+
AST18.identifier("val"),
|
|
153486
|
+
AST18.identifier("data")
|
|
153487
|
+
)
|
|
153488
|
+
])
|
|
153481
153489
|
])
|
|
153482
|
-
|
|
153483
|
-
)
|
|
153484
|
-
|
|
153485
|
-
|
|
153486
|
-
|
|
153490
|
+
)
|
|
153491
|
+
])
|
|
153492
|
+
)
|
|
153493
|
+
]
|
|
153494
|
+
)
|
|
153487
153495
|
)
|
|
153488
153496
|
);
|
|
153489
153497
|
}
|
|
@@ -154233,7 +154241,7 @@ export const redirect = svelteKitRedirect
|
|
|
154233
154241
|
path_exports.dirname(networkFilePath),
|
|
154234
154242
|
path_exports.join(config.projectRoot, plugin_config(config).client)
|
|
154235
154243
|
);
|
|
154236
|
-
return content.
|
|
154244
|
+
return content.replaceAll("HOUDINI_CLIENT_PATH", relativePath);
|
|
154237
154245
|
}
|
|
154238
154246
|
},
|
|
154239
154247
|
artifactData,
|
|
@@ -155824,7 +155824,7 @@ function ensure_imports({
|
|
|
155824
155824
|
script.body.unshift({
|
|
155825
155825
|
type: "ImportDeclaration",
|
|
155826
155826
|
source: AST16.stringLiteral(sourceModule),
|
|
155827
|
-
importKind
|
|
155827
|
+
importKind: importKind === "type" ? "type" : "value"
|
|
155828
155828
|
});
|
|
155829
155829
|
}
|
|
155830
155830
|
return { ids: [], added: has_import ? 0 : 1 };
|
|
@@ -155838,13 +155838,12 @@ function ensure_imports({
|
|
|
155838
155838
|
)
|
|
155839
155839
|
);
|
|
155840
155840
|
if (toImport.length > 0) {
|
|
155841
|
+
const specifier = (identifier, i22) => importKind !== "module" ? !Array.isArray(importID) ? AST16.importDefaultSpecifier(identifier) : AST16.importSpecifier(identifier, as?.[i22] ? AST16.identifier(as[i22]) : identifier) : AST16.importNamespaceSpecifier(identifier);
|
|
155841
155842
|
script.body.unshift({
|
|
155842
155843
|
type: "ImportDeclaration",
|
|
155843
155844
|
source: AST16.stringLiteral(sourceModule),
|
|
155844
|
-
specifiers: toImport.map(
|
|
155845
|
-
|
|
155846
|
-
),
|
|
155847
|
-
importKind
|
|
155845
|
+
specifiers: toImport.map(specifier),
|
|
155846
|
+
importKind: importKind === "type" ? "type" : "value"
|
|
155848
155847
|
});
|
|
155849
155848
|
}
|
|
155850
155849
|
for (const [i22, target] of (as ?? []).entries()) {
|
|
@@ -156400,27 +156399,34 @@ async function kit_init(page) {
|
|
|
156400
156399
|
script: page.script,
|
|
156401
156400
|
config: page.config,
|
|
156402
156401
|
sourceModule: "$app/stores",
|
|
156403
|
-
|
|
156404
|
-
|
|
156402
|
+
importKind: "module",
|
|
156403
|
+
import: "__houdini__pageStores"
|
|
156404
|
+
}).ids;
|
|
156405
156405
|
page.script.body.push(
|
|
156406
156406
|
AST18.expressionStatement(
|
|
156407
|
-
AST18.callExpression(
|
|
156408
|
-
AST18.
|
|
156409
|
-
|
|
156410
|
-
AST18.
|
|
156411
|
-
|
|
156412
|
-
|
|
156413
|
-
|
|
156414
|
-
|
|
156415
|
-
|
|
156416
|
-
|
|
156417
|
-
|
|
156407
|
+
AST18.callExpression(
|
|
156408
|
+
AST18.memberExpression(
|
|
156409
|
+
AST18.memberExpression(store_id, AST18.identifier("page")),
|
|
156410
|
+
AST18.identifier("subscribe")
|
|
156411
|
+
),
|
|
156412
|
+
[
|
|
156413
|
+
AST18.arrowFunctionExpression(
|
|
156414
|
+
[AST18.identifier("val")],
|
|
156415
|
+
AST18.blockStatement([
|
|
156416
|
+
AST18.expressionStatement(
|
|
156417
|
+
AST18.callExpression(set_session, [
|
|
156418
|
+
AST18.callExpression(extract_session, [
|
|
156419
|
+
AST18.memberExpression(
|
|
156420
|
+
AST18.identifier("val"),
|
|
156421
|
+
AST18.identifier("data")
|
|
156422
|
+
)
|
|
156423
|
+
])
|
|
156418
156424
|
])
|
|
156419
|
-
|
|
156420
|
-
)
|
|
156421
|
-
|
|
156422
|
-
|
|
156423
|
-
|
|
156425
|
+
)
|
|
156426
|
+
])
|
|
156427
|
+
)
|
|
156428
|
+
]
|
|
156429
|
+
)
|
|
156424
156430
|
)
|
|
156425
156431
|
);
|
|
156426
156432
|
}
|
|
@@ -155820,7 +155820,7 @@ function ensure_imports({
|
|
|
155820
155820
|
script.body.unshift({
|
|
155821
155821
|
type: "ImportDeclaration",
|
|
155822
155822
|
source: AST16.stringLiteral(sourceModule),
|
|
155823
|
-
importKind
|
|
155823
|
+
importKind: importKind === "type" ? "type" : "value"
|
|
155824
155824
|
});
|
|
155825
155825
|
}
|
|
155826
155826
|
return { ids: [], added: has_import ? 0 : 1 };
|
|
@@ -155834,13 +155834,12 @@ function ensure_imports({
|
|
|
155834
155834
|
)
|
|
155835
155835
|
);
|
|
155836
155836
|
if (toImport.length > 0) {
|
|
155837
|
+
const specifier = (identifier, i22) => importKind !== "module" ? !Array.isArray(importID) ? AST16.importDefaultSpecifier(identifier) : AST16.importSpecifier(identifier, as?.[i22] ? AST16.identifier(as[i22]) : identifier) : AST16.importNamespaceSpecifier(identifier);
|
|
155837
155838
|
script.body.unshift({
|
|
155838
155839
|
type: "ImportDeclaration",
|
|
155839
155840
|
source: AST16.stringLiteral(sourceModule),
|
|
155840
|
-
specifiers: toImport.map(
|
|
155841
|
-
|
|
155842
|
-
),
|
|
155843
|
-
importKind
|
|
155841
|
+
specifiers: toImport.map(specifier),
|
|
155842
|
+
importKind: importKind === "type" ? "type" : "value"
|
|
155844
155843
|
});
|
|
155845
155844
|
}
|
|
155846
155845
|
for (const [i22, target] of (as ?? []).entries()) {
|
|
@@ -156396,27 +156395,34 @@ async function kit_init(page) {
|
|
|
156396
156395
|
script: page.script,
|
|
156397
156396
|
config: page.config,
|
|
156398
156397
|
sourceModule: "$app/stores",
|
|
156399
|
-
|
|
156400
|
-
|
|
156398
|
+
importKind: "module",
|
|
156399
|
+
import: "__houdini__pageStores"
|
|
156400
|
+
}).ids;
|
|
156401
156401
|
page.script.body.push(
|
|
156402
156402
|
AST18.expressionStatement(
|
|
156403
|
-
AST18.callExpression(
|
|
156404
|
-
AST18.
|
|
156405
|
-
|
|
156406
|
-
AST18.
|
|
156407
|
-
|
|
156408
|
-
|
|
156409
|
-
|
|
156410
|
-
|
|
156411
|
-
|
|
156412
|
-
|
|
156413
|
-
|
|
156403
|
+
AST18.callExpression(
|
|
156404
|
+
AST18.memberExpression(
|
|
156405
|
+
AST18.memberExpression(store_id, AST18.identifier("page")),
|
|
156406
|
+
AST18.identifier("subscribe")
|
|
156407
|
+
),
|
|
156408
|
+
[
|
|
156409
|
+
AST18.arrowFunctionExpression(
|
|
156410
|
+
[AST18.identifier("val")],
|
|
156411
|
+
AST18.blockStatement([
|
|
156412
|
+
AST18.expressionStatement(
|
|
156413
|
+
AST18.callExpression(set_session, [
|
|
156414
|
+
AST18.callExpression(extract_session, [
|
|
156415
|
+
AST18.memberExpression(
|
|
156416
|
+
AST18.identifier("val"),
|
|
156417
|
+
AST18.identifier("data")
|
|
156418
|
+
)
|
|
156419
|
+
])
|
|
156414
156420
|
])
|
|
156415
|
-
|
|
156416
|
-
)
|
|
156417
|
-
|
|
156418
|
-
|
|
156419
|
-
|
|
156421
|
+
)
|
|
156422
|
+
])
|
|
156423
|
+
)
|
|
156424
|
+
]
|
|
156425
|
+
)
|
|
156420
156426
|
)
|
|
156421
156427
|
);
|
|
156422
156428
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
export { QueryStore, QueryStoreCursor, QueryStoreOffset } from './query';
|
|
1
2
|
export { FragmentStore, FragmentStoreCursor, FragmentStoreOffset } from './fragment';
|
|
2
3
|
export { SubscriptionStore } from './subscription';
|
|
3
4
|
export { MutationStore, type MutationConfig } from './mutation';
|
|
4
|
-
export { QueryStore, QueryStoreCursor, QueryStoreOffset } from './query';
|
|
@@ -24,17 +24,34 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
25
|
var client_exports = {};
|
|
26
26
|
__export(client_exports, {
|
|
27
|
-
getClient: () => getClient
|
|
27
|
+
getClient: () => getClient,
|
|
28
|
+
initClient: () => initClient
|
|
28
29
|
});
|
|
29
30
|
module.exports = __toCommonJS(client_exports);
|
|
30
|
-
|
|
31
|
+
let client = null;
|
|
32
|
+
async function initClient() {
|
|
33
|
+
if (client) {
|
|
34
|
+
return client;
|
|
35
|
+
}
|
|
36
|
+
client = (await import("HOUDINI_CLIENT_PATH")).default;
|
|
37
|
+
const delay = (ms) => new Promise((res) => setTimeout(res, ms));
|
|
38
|
+
for (let retry = 0; retry < 10; retry++) {
|
|
39
|
+
if (client) {
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
await delay(100);
|
|
43
|
+
client = (await import("HOUDINI_CLIENT_PATH")).default;
|
|
44
|
+
}
|
|
45
|
+
return client;
|
|
46
|
+
}
|
|
31
47
|
function getClient() {
|
|
32
|
-
if (!
|
|
48
|
+
if (!client) {
|
|
33
49
|
throw new Error("client hasn't been initialized");
|
|
34
50
|
}
|
|
35
|
-
return
|
|
51
|
+
return client;
|
|
36
52
|
}
|
|
37
53
|
// Annotate the CommonJS export names for ESM import in node:
|
|
38
54
|
0 && (module.exports = {
|
|
39
|
-
getClient
|
|
55
|
+
getClient,
|
|
56
|
+
initClient
|
|
40
57
|
});
|
|
@@ -73,6 +73,11 @@ class BaseStore {
|
|
|
73
73
|
#subscriberCount = 0;
|
|
74
74
|
setup(init = true) {
|
|
75
75
|
let initPromise = Promise.resolve();
|
|
76
|
+
try {
|
|
77
|
+
(0, import_client2.getClient)();
|
|
78
|
+
} catch {
|
|
79
|
+
initPromise = (0, import_client2.initClient)();
|
|
80
|
+
}
|
|
76
81
|
initPromise.then(() => {
|
|
77
82
|
if (this.#unsubscribe) {
|
|
78
83
|
return;
|
|
@@ -162,6 +162,7 @@ class FragmentStoreCursor extends BasePaginatedFragmentStore {
|
|
|
162
162
|
getVariables,
|
|
163
163
|
artifact: this.paginationArtifact,
|
|
164
164
|
fetchUpdate: async (args, updates) => {
|
|
165
|
+
await (0, import_client.initClient)();
|
|
165
166
|
return observer.send({
|
|
166
167
|
session: await (0, import_session.getSession)(),
|
|
167
168
|
...args,
|
|
@@ -176,6 +177,7 @@ class FragmentStoreCursor extends BasePaginatedFragmentStore {
|
|
|
176
177
|
});
|
|
177
178
|
},
|
|
178
179
|
fetch: async (args) => {
|
|
180
|
+
await (0, import_client.initClient)();
|
|
179
181
|
return await observer.send({
|
|
180
182
|
session: await (0, import_session.getSession)(),
|
|
181
183
|
...args,
|
|
@@ -209,6 +211,7 @@ class FragmentStoreOffset extends BasePaginatedFragmentStore {
|
|
|
209
211
|
getVariables: () => store.variables,
|
|
210
212
|
artifact: this.paginationArtifact,
|
|
211
213
|
fetch: async (args) => {
|
|
214
|
+
await (0, import_client.initClient)();
|
|
212
215
|
return paginationStore.send({
|
|
213
216
|
...args,
|
|
214
217
|
session: await (0, import_session.getSession)(),
|
|
@@ -222,6 +225,7 @@ class FragmentStoreOffset extends BasePaginatedFragmentStore {
|
|
|
222
225
|
});
|
|
223
226
|
},
|
|
224
227
|
fetchUpdate: async (args) => {
|
|
228
|
+
await (0, import_client.initClient)();
|
|
225
229
|
return paginationStore.send({
|
|
226
230
|
session: await (0, import_session.getSession)(),
|
|
227
231
|
...args,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
export { QueryStore, QueryStoreCursor, QueryStoreOffset } from './query';
|
|
1
2
|
export { FragmentStore, FragmentStoreCursor, FragmentStoreOffset } from './fragment';
|
|
2
3
|
export { SubscriptionStore } from './subscription';
|
|
3
4
|
export { MutationStore, type MutationConfig } from './mutation';
|
|
4
|
-
export { QueryStore, QueryStoreCursor, QueryStoreOffset } from './query';
|
|
@@ -28,10 +28,10 @@ __export(stores_exports, {
|
|
|
28
28
|
SubscriptionStore: () => import_subscription.SubscriptionStore
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(stores_exports);
|
|
31
|
+
var import_query = require("./query");
|
|
31
32
|
var import_fragment = require("./fragment");
|
|
32
33
|
var import_subscription = require("./subscription");
|
|
33
34
|
var import_mutation = require("./mutation");
|
|
34
|
-
var import_query = require("./query");
|
|
35
35
|
// Annotate the CommonJS export names for ESM import in node:
|
|
36
36
|
0 && (module.exports = {
|
|
37
37
|
FragmentStore,
|
|
@@ -21,6 +21,7 @@ __export(mutation_exports, {
|
|
|
21
21
|
MutationStore: () => MutationStore
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(mutation_exports);
|
|
24
|
+
var import_client = require("../client");
|
|
24
25
|
var import_base = require("./base");
|
|
25
26
|
var import_query = require("./query");
|
|
26
27
|
class MutationStore extends import_base.BaseStore {
|
|
@@ -32,6 +33,7 @@ class MutationStore extends import_base.BaseStore {
|
|
|
32
33
|
abortController,
|
|
33
34
|
...mutationConfig
|
|
34
35
|
} = {}) {
|
|
36
|
+
await (0, import_client.initClient)();
|
|
35
37
|
const { context } = await (0, import_query.fetchParams)(this.artifact, this.artifact.name, {
|
|
36
38
|
fetch,
|
|
37
39
|
metadata,
|
|
@@ -56,7 +56,7 @@ class QueryStore extends import_base.BaseStore {
|
|
|
56
56
|
this.variables = variables;
|
|
57
57
|
}
|
|
58
58
|
async fetch(args) {
|
|
59
|
-
const client = (0, import_client.
|
|
59
|
+
const client = await (0, import_client.initClient)();
|
|
60
60
|
this.setup(false);
|
|
61
61
|
const { policy, params, context } = await fetchParams(this.artifact, this.storeName, args);
|
|
62
62
|
if (!import_adapter.isBrowser && !(params && "fetch" in params) && (!params || !("event" in params))) {
|
|
@@ -204,6 +204,7 @@ class QueryStoreCursor extends QueryStore {
|
|
|
204
204
|
if (this.#_handlers) {
|
|
205
205
|
return this.#_handlers;
|
|
206
206
|
}
|
|
207
|
+
await (0, import_client.initClient)();
|
|
207
208
|
const paginationObserver = (0, import_client.getClient)().observe({
|
|
208
209
|
artifact: this.artifact
|
|
209
210
|
});
|
|
@@ -214,6 +215,7 @@ class QueryStoreCursor extends QueryStore {
|
|
|
214
215
|
fetch: super.fetch.bind(this),
|
|
215
216
|
getSession: import_session.getSession,
|
|
216
217
|
fetchUpdate: async (args, updates) => {
|
|
218
|
+
await (0, import_client.initClient)();
|
|
217
219
|
return paginationObserver.send({
|
|
218
220
|
...args,
|
|
219
221
|
cacheParams: {
|
|
@@ -281,6 +283,7 @@ class QueryStoreOffset extends QueryStore {
|
|
|
281
283
|
if (this.#_handlers) {
|
|
282
284
|
return this.#_handlers;
|
|
283
285
|
}
|
|
286
|
+
await (0, import_client.initClient)();
|
|
284
287
|
const paginationObserver = (0, import_client.getClient)().observe({
|
|
285
288
|
artifact: this.artifact
|
|
286
289
|
});
|
|
@@ -292,6 +295,7 @@ class QueryStoreOffset extends QueryStore {
|
|
|
292
295
|
getVariables: () => (0, import_store.get)(this.observer).variables,
|
|
293
296
|
getSession: import_session.getSession,
|
|
294
297
|
fetchUpdate: async (args) => {
|
|
298
|
+
await (0, import_client.initClient)();
|
|
295
299
|
return paginationObserver.send({
|
|
296
300
|
...args,
|
|
297
301
|
variables: {
|
|
@@ -23,6 +23,7 @@ __export(subscription_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(subscription_exports);
|
|
24
24
|
var import_types = require("$houdini/runtime/lib/types");
|
|
25
25
|
var import_store = require("svelte/store");
|
|
26
|
+
var import_client = require("../client");
|
|
26
27
|
var import_session = require("../session");
|
|
27
28
|
var import_base = require("./base");
|
|
28
29
|
class SubscriptionStore extends import_base.BaseStore {
|
|
@@ -33,6 +34,7 @@ class SubscriptionStore extends import_base.BaseStore {
|
|
|
33
34
|
this.fetchingStore = (0, import_store.writable)(false);
|
|
34
35
|
}
|
|
35
36
|
async listen(variables, args) {
|
|
37
|
+
await (0, import_client.initClient)();
|
|
36
38
|
this.fetchingStore.set(true);
|
|
37
39
|
this.observer.send({
|
|
38
40
|
variables,
|
|
@@ -41,6 +43,7 @@ class SubscriptionStore extends import_base.BaseStore {
|
|
|
41
43
|
});
|
|
42
44
|
}
|
|
43
45
|
async unlisten() {
|
|
46
|
+
await (0, import_client.initClient)();
|
|
44
47
|
this.fetchingStore.set(false);
|
|
45
48
|
await this.observer.cleanup();
|
|
46
49
|
}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
let client = null;
|
|
2
|
+
async function initClient() {
|
|
3
|
+
if (client) {
|
|
4
|
+
return client;
|
|
5
|
+
}
|
|
6
|
+
client = (await import("HOUDINI_CLIENT_PATH")).default;
|
|
7
|
+
const delay = (ms) => new Promise((res) => setTimeout(res, ms));
|
|
8
|
+
for (let retry = 0; retry < 10; retry++) {
|
|
9
|
+
if (client) {
|
|
10
|
+
break;
|
|
11
|
+
}
|
|
12
|
+
await delay(100);
|
|
13
|
+
client = (await import("HOUDINI_CLIENT_PATH")).default;
|
|
14
|
+
}
|
|
15
|
+
return client;
|
|
16
|
+
}
|
|
2
17
|
function getClient() {
|
|
3
18
|
if (!client) {
|
|
4
19
|
throw new Error("client hasn't been initialized");
|
|
@@ -6,5 +21,6 @@ function getClient() {
|
|
|
6
21
|
return client;
|
|
7
22
|
}
|
|
8
23
|
export {
|
|
9
|
-
getClient
|
|
24
|
+
getClient,
|
|
25
|
+
initClient
|
|
10
26
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DocumentStore } from "$houdini/runtime/client";
|
|
2
2
|
import { get } from "svelte/store";
|
|
3
3
|
import { isBrowser } from "../adapter";
|
|
4
|
-
import { getClient } from "../client";
|
|
4
|
+
import { getClient, initClient } from "../client";
|
|
5
5
|
class BaseStore {
|
|
6
6
|
#params;
|
|
7
7
|
get artifact() {
|
|
@@ -50,6 +50,11 @@ class BaseStore {
|
|
|
50
50
|
#subscriberCount = 0;
|
|
51
51
|
setup(init = true) {
|
|
52
52
|
let initPromise = Promise.resolve();
|
|
53
|
+
try {
|
|
54
|
+
getClient();
|
|
55
|
+
} catch {
|
|
56
|
+
initPromise = initClient();
|
|
57
|
+
}
|
|
53
58
|
initPromise.then(() => {
|
|
54
59
|
if (this.#unsubscribe) {
|
|
55
60
|
return;
|
|
@@ -7,7 +7,7 @@ import { marshalInputs } from "$houdini/runtime/lib/scalars";
|
|
|
7
7
|
import { CompiledFragmentKind, fragmentKey } from "$houdini/runtime/lib/types";
|
|
8
8
|
import { get, derived } from "svelte/store";
|
|
9
9
|
import { isBrowser } from "../adapter";
|
|
10
|
-
import { getClient } from "../client";
|
|
10
|
+
import { getClient, initClient } from "../client";
|
|
11
11
|
import { getSession } from "../session";
|
|
12
12
|
import { BaseStore } from "./base";
|
|
13
13
|
class FragmentStore {
|
|
@@ -131,6 +131,7 @@ class FragmentStoreCursor extends BasePaginatedFragmentStore {
|
|
|
131
131
|
getVariables,
|
|
132
132
|
artifact: this.paginationArtifact,
|
|
133
133
|
fetchUpdate: async (args, updates) => {
|
|
134
|
+
await initClient();
|
|
134
135
|
return observer.send({
|
|
135
136
|
session: await getSession(),
|
|
136
137
|
...args,
|
|
@@ -145,6 +146,7 @@ class FragmentStoreCursor extends BasePaginatedFragmentStore {
|
|
|
145
146
|
});
|
|
146
147
|
},
|
|
147
148
|
fetch: async (args) => {
|
|
149
|
+
await initClient();
|
|
148
150
|
return await observer.send({
|
|
149
151
|
session: await getSession(),
|
|
150
152
|
...args,
|
|
@@ -178,6 +180,7 @@ class FragmentStoreOffset extends BasePaginatedFragmentStore {
|
|
|
178
180
|
getVariables: () => store.variables,
|
|
179
181
|
artifact: this.paginationArtifact,
|
|
180
182
|
fetch: async (args) => {
|
|
183
|
+
await initClient();
|
|
181
184
|
return paginationStore.send({
|
|
182
185
|
...args,
|
|
183
186
|
session: await getSession(),
|
|
@@ -191,6 +194,7 @@ class FragmentStoreOffset extends BasePaginatedFragmentStore {
|
|
|
191
194
|
});
|
|
192
195
|
},
|
|
193
196
|
fetchUpdate: async (args) => {
|
|
197
|
+
await initClient();
|
|
194
198
|
return paginationStore.send({
|
|
195
199
|
session: await getSession(),
|
|
196
200
|
...args,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
export { QueryStore, QueryStoreCursor, QueryStoreOffset } from './query';
|
|
1
2
|
export { FragmentStore, FragmentStoreCursor, FragmentStoreOffset } from './fragment';
|
|
2
3
|
export { SubscriptionStore } from './subscription';
|
|
3
4
|
export { MutationStore, type MutationConfig } from './mutation';
|
|
4
|
-
export { QueryStore, QueryStoreCursor, QueryStoreOffset } from './query';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { QueryStore, QueryStoreCursor, QueryStoreOffset } from "./query";
|
|
1
2
|
import { FragmentStore, FragmentStoreCursor, FragmentStoreOffset } from "./fragment";
|
|
2
3
|
import { SubscriptionStore } from "./subscription";
|
|
3
4
|
import { MutationStore } from "./mutation";
|
|
4
|
-
import { QueryStore, QueryStoreCursor, QueryStoreOffset } from "./query";
|
|
5
5
|
export {
|
|
6
6
|
FragmentStore,
|
|
7
7
|
FragmentStoreCursor,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { initClient } from "../client";
|
|
1
2
|
import { BaseStore } from "./base";
|
|
2
3
|
import { fetchParams } from "./query";
|
|
3
4
|
class MutationStore extends BaseStore {
|
|
@@ -9,6 +10,7 @@ class MutationStore extends BaseStore {
|
|
|
9
10
|
abortController,
|
|
10
11
|
...mutationConfig
|
|
11
12
|
} = {}) {
|
|
13
|
+
await initClient();
|
|
12
14
|
const { context } = await fetchParams(this.artifact, this.artifact.name, {
|
|
13
15
|
fetch,
|
|
14
16
|
metadata,
|
|
@@ -5,7 +5,7 @@ import { cursorHandlers, offsetHandlers } from "$houdini/runtime/lib/pagination"
|
|
|
5
5
|
import { CompiledQueryKind, CachePolicy, ArtifactKind } from "$houdini/runtime/lib/types";
|
|
6
6
|
import { get, derived } from "svelte/store";
|
|
7
7
|
import { clientStarted, isBrowser } from "../adapter";
|
|
8
|
-
import { getClient } from "../client";
|
|
8
|
+
import { getClient, initClient } from "../client";
|
|
9
9
|
import { getSession } from "../session";
|
|
10
10
|
import { BaseStore } from "./base";
|
|
11
11
|
class QueryStore extends BaseStore {
|
|
@@ -24,7 +24,7 @@ class QueryStore extends BaseStore {
|
|
|
24
24
|
this.variables = variables;
|
|
25
25
|
}
|
|
26
26
|
async fetch(args) {
|
|
27
|
-
const client =
|
|
27
|
+
const client = await initClient();
|
|
28
28
|
this.setup(false);
|
|
29
29
|
const { policy, params, context } = await fetchParams(this.artifact, this.storeName, args);
|
|
30
30
|
if (!isBrowser && !(params && "fetch" in params) && (!params || !("event" in params))) {
|
|
@@ -172,6 +172,7 @@ class QueryStoreCursor extends QueryStore {
|
|
|
172
172
|
if (this.#_handlers) {
|
|
173
173
|
return this.#_handlers;
|
|
174
174
|
}
|
|
175
|
+
await initClient();
|
|
175
176
|
const paginationObserver = getClient().observe({
|
|
176
177
|
artifact: this.artifact
|
|
177
178
|
});
|
|
@@ -182,6 +183,7 @@ class QueryStoreCursor extends QueryStore {
|
|
|
182
183
|
fetch: super.fetch.bind(this),
|
|
183
184
|
getSession,
|
|
184
185
|
fetchUpdate: async (args, updates) => {
|
|
186
|
+
await initClient();
|
|
185
187
|
return paginationObserver.send({
|
|
186
188
|
...args,
|
|
187
189
|
cacheParams: {
|
|
@@ -249,6 +251,7 @@ class QueryStoreOffset extends QueryStore {
|
|
|
249
251
|
if (this.#_handlers) {
|
|
250
252
|
return this.#_handlers;
|
|
251
253
|
}
|
|
254
|
+
await initClient();
|
|
252
255
|
const paginationObserver = getClient().observe({
|
|
253
256
|
artifact: this.artifact
|
|
254
257
|
});
|
|
@@ -260,6 +263,7 @@ class QueryStoreOffset extends QueryStore {
|
|
|
260
263
|
getVariables: () => get(this.observer).variables,
|
|
261
264
|
getSession,
|
|
262
265
|
fetchUpdate: async (args) => {
|
|
266
|
+
await initClient();
|
|
263
267
|
return paginationObserver.send({
|
|
264
268
|
...args,
|
|
265
269
|
variables: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CompiledSubscriptionKind } from "$houdini/runtime/lib/types";
|
|
2
2
|
import { derived, writable } from "svelte/store";
|
|
3
|
+
import { initClient } from "../client";
|
|
3
4
|
import { getSession } from "../session";
|
|
4
5
|
import { BaseStore } from "./base";
|
|
5
6
|
class SubscriptionStore extends BaseStore {
|
|
@@ -10,6 +11,7 @@ class SubscriptionStore extends BaseStore {
|
|
|
10
11
|
this.fetchingStore = writable(false);
|
|
11
12
|
}
|
|
12
13
|
async listen(variables, args) {
|
|
14
|
+
await initClient();
|
|
13
15
|
this.fetchingStore.set(true);
|
|
14
16
|
this.observer.send({
|
|
15
17
|
variables,
|
|
@@ -18,6 +20,7 @@ class SubscriptionStore extends BaseStore {
|
|
|
18
20
|
});
|
|
19
21
|
}
|
|
20
22
|
async unlisten() {
|
|
23
|
+
await initClient();
|
|
21
24
|
this.fetchingStore.set(false);
|
|
22
25
|
await this.observer.cleanup();
|
|
23
26
|
}
|
package/build/test-cjs/index.js
CHANGED
|
@@ -281416,7 +281416,7 @@ function ensure_imports({
|
|
|
281416
281416
|
script.body.unshift({
|
|
281417
281417
|
type: "ImportDeclaration",
|
|
281418
281418
|
source: AST162.stringLiteral(sourceModule),
|
|
281419
|
-
importKind
|
|
281419
|
+
importKind: importKind === "type" ? "type" : "value"
|
|
281420
281420
|
});
|
|
281421
281421
|
}
|
|
281422
281422
|
return { ids: [], added: has_import ? 0 : 1 };
|
|
@@ -281430,13 +281430,12 @@ function ensure_imports({
|
|
|
281430
281430
|
)
|
|
281431
281431
|
);
|
|
281432
281432
|
if (toImport.length > 0) {
|
|
281433
|
+
const specifier = (identifier, i22) => importKind !== "module" ? !Array.isArray(importID) ? AST162.importDefaultSpecifier(identifier) : AST162.importSpecifier(identifier, as?.[i22] ? AST162.identifier(as[i22]) : identifier) : AST162.importNamespaceSpecifier(identifier);
|
|
281433
281434
|
script.body.unshift({
|
|
281434
281435
|
type: "ImportDeclaration",
|
|
281435
281436
|
source: AST162.stringLiteral(sourceModule),
|
|
281436
|
-
specifiers: toImport.map(
|
|
281437
|
-
|
|
281438
|
-
),
|
|
281439
|
-
importKind
|
|
281437
|
+
specifiers: toImport.map(specifier),
|
|
281438
|
+
importKind: importKind === "type" ? "type" : "value"
|
|
281440
281439
|
});
|
|
281441
281440
|
}
|
|
281442
281441
|
for (const [i22, target] of (as ?? []).entries()) {
|
|
@@ -282710,6 +282709,7 @@ async function queryStore({ config, pluginRoot }, doc) {
|
|
|
282710
282709
|
const { store_class, statement } = store_import2(config, which);
|
|
282711
282710
|
const storeData = `${statement}
|
|
282712
282711
|
import artifact from '$houdini/artifacts/${artifactName}'
|
|
282712
|
+
import { initClient } from '$houdini/plugins/houdini-svelte/runtime/client'
|
|
282713
282713
|
|
|
282714
282714
|
export class ${storeName} extends ${store_class} {
|
|
282715
282715
|
constructor() {
|
|
@@ -282722,6 +282722,7 @@ export class ${storeName} extends ${store_class} {
|
|
|
282722
282722
|
}
|
|
282723
282723
|
|
|
282724
282724
|
export async function load_${artifactName}(params) {
|
|
282725
|
+
await initClient()
|
|
282725
282726
|
|
|
282726
282727
|
const store = new ${storeName}()
|
|
282727
282728
|
|
|
@@ -283325,27 +283326,34 @@ async function kit_init(page) {
|
|
|
283325
283326
|
script: page.script,
|
|
283326
283327
|
config: page.config,
|
|
283327
283328
|
sourceModule: "$app/stores",
|
|
283328
|
-
|
|
283329
|
-
|
|
283329
|
+
importKind: "module",
|
|
283330
|
+
import: "__houdini__pageStores"
|
|
283331
|
+
}).ids;
|
|
283330
283332
|
page.script.body.push(
|
|
283331
283333
|
AST19.expressionStatement(
|
|
283332
|
-
AST19.callExpression(
|
|
283333
|
-
AST19.
|
|
283334
|
-
|
|
283335
|
-
AST19.
|
|
283336
|
-
|
|
283337
|
-
|
|
283338
|
-
|
|
283339
|
-
|
|
283340
|
-
|
|
283341
|
-
|
|
283342
|
-
|
|
283334
|
+
AST19.callExpression(
|
|
283335
|
+
AST19.memberExpression(
|
|
283336
|
+
AST19.memberExpression(store_id, AST19.identifier("page")),
|
|
283337
|
+
AST19.identifier("subscribe")
|
|
283338
|
+
),
|
|
283339
|
+
[
|
|
283340
|
+
AST19.arrowFunctionExpression(
|
|
283341
|
+
[AST19.identifier("val")],
|
|
283342
|
+
AST19.blockStatement([
|
|
283343
|
+
AST19.expressionStatement(
|
|
283344
|
+
AST19.callExpression(set_session, [
|
|
283345
|
+
AST19.callExpression(extract_session, [
|
|
283346
|
+
AST19.memberExpression(
|
|
283347
|
+
AST19.identifier("val"),
|
|
283348
|
+
AST19.identifier("data")
|
|
283349
|
+
)
|
|
283350
|
+
])
|
|
283343
283351
|
])
|
|
283344
|
-
|
|
283345
|
-
)
|
|
283346
|
-
|
|
283347
|
-
|
|
283348
|
-
|
|
283352
|
+
)
|
|
283353
|
+
])
|
|
283354
|
+
)
|
|
283355
|
+
]
|
|
283356
|
+
)
|
|
283349
283357
|
)
|
|
283350
283358
|
);
|
|
283351
283359
|
}
|
|
@@ -284095,7 +284103,7 @@ export const redirect = svelteKitRedirect
|
|
|
284095
284103
|
path_exports.dirname(networkFilePath),
|
|
284096
284104
|
path_exports.join(config.projectRoot, plugin_config(config).client)
|
|
284097
284105
|
);
|
|
284098
|
-
return content.
|
|
284106
|
+
return content.replaceAll("HOUDINI_CLIENT_PATH", relativePath);
|
|
284099
284107
|
}
|
|
284100
284108
|
},
|
|
284101
284109
|
artifactData,
|
package/build/test-esm/index.js
CHANGED
|
@@ -281405,7 +281405,7 @@ function ensure_imports({
|
|
|
281405
281405
|
script.body.unshift({
|
|
281406
281406
|
type: "ImportDeclaration",
|
|
281407
281407
|
source: AST162.stringLiteral(sourceModule),
|
|
281408
|
-
importKind
|
|
281408
|
+
importKind: importKind === "type" ? "type" : "value"
|
|
281409
281409
|
});
|
|
281410
281410
|
}
|
|
281411
281411
|
return { ids: [], added: has_import ? 0 : 1 };
|
|
@@ -281419,13 +281419,12 @@ function ensure_imports({
|
|
|
281419
281419
|
)
|
|
281420
281420
|
);
|
|
281421
281421
|
if (toImport.length > 0) {
|
|
281422
|
+
const specifier = (identifier, i22) => importKind !== "module" ? !Array.isArray(importID) ? AST162.importDefaultSpecifier(identifier) : AST162.importSpecifier(identifier, as?.[i22] ? AST162.identifier(as[i22]) : identifier) : AST162.importNamespaceSpecifier(identifier);
|
|
281422
281423
|
script.body.unshift({
|
|
281423
281424
|
type: "ImportDeclaration",
|
|
281424
281425
|
source: AST162.stringLiteral(sourceModule),
|
|
281425
|
-
specifiers: toImport.map(
|
|
281426
|
-
|
|
281427
|
-
),
|
|
281428
|
-
importKind
|
|
281426
|
+
specifiers: toImport.map(specifier),
|
|
281427
|
+
importKind: importKind === "type" ? "type" : "value"
|
|
281429
281428
|
});
|
|
281430
281429
|
}
|
|
281431
281430
|
for (const [i22, target] of (as ?? []).entries()) {
|
|
@@ -282699,6 +282698,7 @@ async function queryStore({ config, pluginRoot }, doc) {
|
|
|
282699
282698
|
const { store_class, statement } = store_import2(config, which);
|
|
282700
282699
|
const storeData = `${statement}
|
|
282701
282700
|
import artifact from '$houdini/artifacts/${artifactName}'
|
|
282701
|
+
import { initClient } from '$houdini/plugins/houdini-svelte/runtime/client'
|
|
282702
282702
|
|
|
282703
282703
|
export class ${storeName} extends ${store_class} {
|
|
282704
282704
|
constructor() {
|
|
@@ -282711,6 +282711,7 @@ export class ${storeName} extends ${store_class} {
|
|
|
282711
282711
|
}
|
|
282712
282712
|
|
|
282713
282713
|
export async function load_${artifactName}(params) {
|
|
282714
|
+
await initClient()
|
|
282714
282715
|
|
|
282715
282716
|
const store = new ${storeName}()
|
|
282716
282717
|
|
|
@@ -283314,27 +283315,34 @@ async function kit_init(page) {
|
|
|
283314
283315
|
script: page.script,
|
|
283315
283316
|
config: page.config,
|
|
283316
283317
|
sourceModule: "$app/stores",
|
|
283317
|
-
|
|
283318
|
-
|
|
283318
|
+
importKind: "module",
|
|
283319
|
+
import: "__houdini__pageStores"
|
|
283320
|
+
}).ids;
|
|
283319
283321
|
page.script.body.push(
|
|
283320
283322
|
AST19.expressionStatement(
|
|
283321
|
-
AST19.callExpression(
|
|
283322
|
-
AST19.
|
|
283323
|
-
|
|
283324
|
-
AST19.
|
|
283325
|
-
|
|
283326
|
-
|
|
283327
|
-
|
|
283328
|
-
|
|
283329
|
-
|
|
283330
|
-
|
|
283331
|
-
|
|
283323
|
+
AST19.callExpression(
|
|
283324
|
+
AST19.memberExpression(
|
|
283325
|
+
AST19.memberExpression(store_id, AST19.identifier("page")),
|
|
283326
|
+
AST19.identifier("subscribe")
|
|
283327
|
+
),
|
|
283328
|
+
[
|
|
283329
|
+
AST19.arrowFunctionExpression(
|
|
283330
|
+
[AST19.identifier("val")],
|
|
283331
|
+
AST19.blockStatement([
|
|
283332
|
+
AST19.expressionStatement(
|
|
283333
|
+
AST19.callExpression(set_session, [
|
|
283334
|
+
AST19.callExpression(extract_session, [
|
|
283335
|
+
AST19.memberExpression(
|
|
283336
|
+
AST19.identifier("val"),
|
|
283337
|
+
AST19.identifier("data")
|
|
283338
|
+
)
|
|
283339
|
+
])
|
|
283332
283340
|
])
|
|
283333
|
-
|
|
283334
|
-
)
|
|
283335
|
-
|
|
283336
|
-
|
|
283337
|
-
|
|
283341
|
+
)
|
|
283342
|
+
])
|
|
283343
|
+
)
|
|
283344
|
+
]
|
|
283345
|
+
)
|
|
283338
283346
|
)
|
|
283339
283347
|
);
|
|
283340
283348
|
}
|
|
@@ -284084,7 +284092,7 @@ export const redirect = svelteKitRedirect
|
|
|
284084
284092
|
path_exports.dirname(networkFilePath),
|
|
284085
284093
|
path_exports.join(config.projectRoot, plugin_config(config).client)
|
|
284086
284094
|
);
|
|
284087
|
-
return content.
|
|
284095
|
+
return content.replaceAll("HOUDINI_CLIENT_PATH", relativePath);
|
|
284088
284096
|
}
|
|
284089
284097
|
},
|
|
284090
284098
|
artifactData,
|