crelte 0.5.11 → 0.5.13
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/dist/blocks/Blocks.d.ts +1 -1
- package/dist/blocks/Blocks.d.ts.map +1 -1
- package/dist/bodyClass/BodyClass.d.ts +56 -0
- package/dist/bodyClass/BodyClass.d.ts.map +1 -0
- package/dist/bodyClass/BodyClass.js +70 -0
- package/dist/bodyClass/ClientBodyClass.d.ts +17 -0
- package/dist/bodyClass/ClientBodyClass.d.ts.map +1 -0
- package/dist/bodyClass/ClientBodyClass.js +71 -0
- package/dist/bodyClass/ServerBodyClass.d.ts +18 -0
- package/dist/bodyClass/ServerBodyClass.d.ts.map +1 -0
- package/dist/bodyClass/ServerBodyClass.js +61 -0
- package/dist/bodyClass/index.d.ts +2 -0
- package/dist/bodyClass/index.d.ts.map +1 -0
- package/dist/bodyClass/index.js +1 -0
- package/dist/bodyClass/utils.d.ts +39 -0
- package/dist/bodyClass/utils.d.ts.map +1 -0
- package/dist/bodyClass/utils.js +84 -0
- package/dist/cookies/ClientCookies.d.ts +8 -3
- package/dist/cookies/ClientCookies.d.ts.map +1 -1
- package/dist/cookies/ClientCookies.js +31 -7
- package/dist/cookies/Cookies.d.ts +42 -0
- package/dist/cookies/Cookies.d.ts.map +1 -0
- package/dist/cookies/Cookies.js +44 -0
- package/dist/cookies/ServerCookies.d.ts +3 -2
- package/dist/cookies/ServerCookies.d.ts.map +1 -1
- package/dist/cookies/ServerCookies.js +6 -4
- package/dist/cookies/index.d.ts +1 -25
- package/dist/cookies/index.d.ts.map +1 -1
- package/dist/cookies/index.js +1 -1
- package/dist/crelte.d.ts +7 -1
- package/dist/crelte.d.ts.map +1 -1
- package/dist/crelte.js +4 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/init/client.d.ts.map +1 -1
- package/dist/init/client.js +23 -14
- package/dist/init/server.d.ts.map +1 -1
- package/dist/init/server.js +12 -3
- package/dist/init/shared.d.ts +1 -0
- package/dist/init/shared.d.ts.map +1 -1
- package/dist/init/shared.js +19 -5
- package/dist/loadData/Globals.d.ts.map +1 -1
- package/dist/loadData/entry.d.ts +11 -2
- package/dist/loadData/entry.d.ts.map +1 -1
- package/dist/loadData/entry.js +11 -2
- package/dist/node/index.js +1 -1
- package/dist/plugins/Events.d.ts +6 -1
- package/dist/plugins/Events.d.ts.map +1 -1
- package/dist/plugins/Plugins.d.ts +36 -1
- package/dist/plugins/Plugins.d.ts.map +1 -1
- package/dist/plugins/Plugins.js +32 -0
- package/dist/queries/index.d.ts +1 -1
- package/dist/queries/index.d.ts.map +1 -1
- package/dist/routing/route/Request.d.ts +1 -1
- package/dist/routing/route/Request.d.ts.map +1 -1
- package/dist/routing/route/Request.js +7 -3
- package/dist/routing/router/ClientRouter.d.ts.map +1 -1
- package/dist/routing/router/ClientRouter.js +18 -11
- package/dist/routing/router/Router.d.ts.map +1 -1
- package/dist/routing/router/Router.js +8 -12
- package/dist/server/CrelteServer.d.ts +1 -0
- package/dist/server/CrelteServer.d.ts.map +1 -1
- package/dist/server/CrelteServer.js +5 -2
- package/dist/server/queries/QueryGqlRoute.d.ts.map +1 -1
- package/dist/server/queries/QueryGqlRoute.js +3 -3
- package/dist/server/queries/routes.d.ts +1 -1
- package/dist/server/queries/routes.d.ts.map +1 -1
- package/dist/std/stores/StagedWritable.d.ts +48 -0
- package/dist/std/stores/StagedWritable.d.ts.map +1 -0
- package/dist/std/stores/StagedWritable.js +84 -0
- package/dist/std/stores/index.d.ts +2 -1
- package/dist/std/stores/index.d.ts.map +1 -1
- package/dist/std/stores/index.js +2 -1
- package/dist/std/sync/Barrier.js +1 -1
- package/dist/utils.d.ts +9 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +11 -0
- package/package.json +5 -1
- package/src/blocks/Blocks.ts +1 -1
- package/src/bodyClass/BodyClass.ts +94 -0
- package/src/bodyClass/ClientBodyClass.ts +79 -0
- package/src/bodyClass/ServerBodyClass.ts +86 -0
- package/src/bodyClass/index.ts +1 -0
- package/src/bodyClass/utils.ts +118 -0
- package/src/cookies/ClientCookies.ts +41 -10
- package/src/cookies/Cookies.ts +70 -0
- package/src/cookies/ServerCookies.ts +9 -6
- package/src/cookies/index.ts +5 -29
- package/src/crelte.ts +12 -0
- package/src/index.ts +15 -1
- package/src/init/client.ts +26 -14
- package/src/init/server.ts +12 -3
- package/src/init/shared.ts +21 -6
- package/src/loadData/Globals.ts +1 -1
- package/src/loadData/entry.ts +12 -2
- package/src/node/index.ts +1 -1
- package/src/plugins/Events.ts +12 -1
- package/src/plugins/Plugins.ts +66 -1
- package/src/queries/index.ts +5 -1
- package/src/routing/route/Request.ts +11 -4
- package/src/routing/router/ClientRouter.ts +23 -14
- package/src/routing/router/Router.ts +8 -10
- package/src/server/CrelteServer.ts +4 -2
- package/src/server/queries/QueryGqlRoute.ts +3 -2
- package/src/server/queries/routes.ts +1 -0
- package/src/std/stores/StagedWritable.ts +96 -0
- package/src/std/stores/index.ts +2 -1
- package/src/std/sync/Barrier.ts +1 -1
- package/src/utils.ts +15 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerCookies.d.ts","sourceRoot":"","sources":["../../src/cookies/ServerCookies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ServerCookies.d.ts","sourceRoot":"","sources":["../../src/cookies/ServerCookies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAgB,KAAK,SAAS,EAAqB,MAAM,YAAY,CAAC;AAE7E;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,eAAe;IAC5D,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;gBAEvB,OAAO,EAAE,OAAO;IAM5B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAShC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI;IAIzD,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,IAAI;IAIhD,SAAS,IAAI,aAAa;IAI1B,gBAAgB,CAAC,OAAO,EAAE,OAAO;CAKjC"}
|
|
@@ -10,12 +10,11 @@ export default class ServerCookies {
|
|
|
10
10
|
this.requestCookies = parseCookies(headers.get('Cookie') ?? '');
|
|
11
11
|
this.setCookies = new Map();
|
|
12
12
|
}
|
|
13
|
-
///
|
|
13
|
+
/// Returns the value of the cookie with the given name, or null if it doesn't exist.
|
|
14
14
|
get(name) {
|
|
15
15
|
const setCookie = this.setCookies.get(name);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return setCookie.value;
|
|
16
|
+
if (setCookie) {
|
|
17
|
+
return (setCookie.maxAge ?? 1) > 0 ? setCookie.value : null;
|
|
19
18
|
}
|
|
20
19
|
return this.requestCookies.get(name) ?? null;
|
|
21
20
|
}
|
|
@@ -25,6 +24,9 @@ export default class ServerCookies {
|
|
|
25
24
|
remove(name, opts) {
|
|
26
25
|
this.set(name, '', { ...opts, maxAge: 0 });
|
|
27
26
|
}
|
|
27
|
+
toRequest() {
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
28
30
|
_populateHeaders(headers) {
|
|
29
31
|
for (const setCookie of this.setCookies.values()) {
|
|
30
32
|
headers.append('Set-Cookie', setCookieToString(setCookie));
|
package/dist/cookies/index.d.ts
CHANGED
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
export type SetOptions
|
|
2
|
-
maxAge?: number;
|
|
3
|
-
path?: string;
|
|
4
|
-
domain?: string;
|
|
5
|
-
secure?: boolean;
|
|
6
|
-
httpOnly?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export type RemoveOptions = Omit<SetOptions, 'maxAge'>;
|
|
9
|
-
export interface Cookies {
|
|
10
|
-
/**
|
|
11
|
-
* returns the value of the cookie
|
|
12
|
-
*/
|
|
13
|
-
get(name: string): string | null;
|
|
14
|
-
/**
|
|
15
|
-
* sets the value of the cookie
|
|
16
|
-
*
|
|
17
|
-
* #### Note
|
|
18
|
-
* path defaults to '/'
|
|
19
|
-
*/
|
|
20
|
-
set(name: string, value: string, opts?: SetOptions): void;
|
|
21
|
-
/**
|
|
22
|
-
* removes the cookie
|
|
23
|
-
*/
|
|
24
|
-
remove(name: string, opts?: RemoveOptions): void;
|
|
25
|
-
}
|
|
1
|
+
export { default as Cookies, type SetOptions, type RemoveOptions, } from './Cookies.js';
|
|
26
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cookies/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cookies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,OAAO,IAAI,OAAO,EAClB,KAAK,UAAU,EACf,KAAK,aAAa,GAClB,MAAM,cAAc,CAAC"}
|
package/dist/cookies/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { default as Cookies, } from './Cookies.js';
|
package/dist/crelte.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import Site from './routing/Site.js';
|
|
|
8
8
|
import Queries, { Query, QueryOptions } from './queries/Queries.js';
|
|
9
9
|
import { Readable } from './std/stores/index.js';
|
|
10
10
|
import { Entry } from './loadData/index.js';
|
|
11
|
+
import { BodyClass } from './bodyClass/index.js';
|
|
11
12
|
/** The type for the app.config object */
|
|
12
13
|
export type Config = {
|
|
13
14
|
/**
|
|
@@ -85,6 +86,10 @@ export type Crelte = {
|
|
|
85
86
|
* Get the Cookies instance
|
|
86
87
|
*/
|
|
87
88
|
cookies: Cookies;
|
|
89
|
+
/**
|
|
90
|
+
* Get the BodyClass instance
|
|
91
|
+
*/
|
|
92
|
+
bodyClass: BodyClass;
|
|
88
93
|
/**
|
|
89
94
|
* Get a Plugin by name
|
|
90
95
|
*/
|
|
@@ -209,7 +214,7 @@ export type CrelteRequest = Crelte & {
|
|
|
209
214
|
*/
|
|
210
215
|
getGlobalAsync<T = any>(name: string): T | Promise<T | null> | null;
|
|
211
216
|
};
|
|
212
|
-
export declare function newCrelte({ config, ssrCache, plugins, events, globals, router, queries, cookies, }: {
|
|
217
|
+
export declare function newCrelte({ config, ssrCache, plugins, events, globals, router, queries, cookies, bodyClass, }: {
|
|
213
218
|
config: Required<Config>;
|
|
214
219
|
ssrCache: SsrCache;
|
|
215
220
|
plugins: Plugins;
|
|
@@ -218,6 +223,7 @@ export declare function newCrelte({ config, ssrCache, plugins, events, globals,
|
|
|
218
223
|
router: Router;
|
|
219
224
|
queries: Queries;
|
|
220
225
|
cookies: Cookies;
|
|
226
|
+
bodyClass: BodyClass;
|
|
221
227
|
}): Crelte;
|
|
222
228
|
export declare function crelteToRequest(crelte: Crelte, req?: Route | Request): CrelteRequest;
|
|
223
229
|
//# sourceMappingURL=crelte.d.ts.map
|
package/dist/crelte.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crelte.d.ts","sourceRoot":"","sources":["../src/crelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,QAAQ,MAA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AQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;CACrB,GAAG,MAAM,CA4BT;AAED,wBAAgB,eAAe,CAC9B,MAAM,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,KAAK,GAAG,OAAO,GACnB,aAAa,CAkBf"}
|
package/dist/crelte.js
CHANGED
|
@@ -10,7 +10,7 @@ export function configWithDefaults(config = {}) {
|
|
|
10
10
|
debugTiming: config.debugTiming ?? false,
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
export function newCrelte({ config, ssrCache, plugins, events, globals, router, queries, cookies, }) {
|
|
13
|
+
export function newCrelte({ config, ssrCache, plugins, events, globals, router, queries, cookies, bodyClass, }) {
|
|
14
14
|
return {
|
|
15
15
|
config,
|
|
16
16
|
ssrCache,
|
|
@@ -20,6 +20,9 @@ export function newCrelte({ config, ssrCache, plugins, events, globals, router,
|
|
|
20
20
|
router,
|
|
21
21
|
queries,
|
|
22
22
|
cookies,
|
|
23
|
+
bodyClass,
|
|
24
|
+
// when adding a new helper function make sure to add it to
|
|
25
|
+
// onNewCrelteRequest if needed
|
|
23
26
|
getPlugin: name => plugins.get(name),
|
|
24
27
|
getEnv: key => ssrCache.get(key),
|
|
25
28
|
frontendUrl: path => urlWithPath(ssrCache.get('FRONTEND_URL'), path),
|
package/dist/index.d.ts
CHANGED
|
@@ -5,10 +5,15 @@ import { type Crelte, type CrelteRequest, type CrelteWithRoute, type Config } fr
|
|
|
5
5
|
import type { Cookies } from './cookies/index.js';
|
|
6
6
|
import { Entry, LoadData, LoadDataArray, LoadDataFn, LoadDataObj } from './loadData/index.js';
|
|
7
7
|
import Queries from './queries/Queries.js';
|
|
8
|
-
import { Readable } from './std/stores/index.js';
|
|
8
|
+
import { Readable, Writable } from './std/stores/index.js';
|
|
9
|
+
import { BodyClass } from './bodyClass/index.js';
|
|
9
10
|
export { type Crelte, type CrelteWithRoute, type CrelteRequest, type Config, type LoadData, type LoadDataFn, type LoadDataObj, type LoadDataArray, };
|
|
10
11
|
/** The type for the app.init function */
|
|
11
12
|
export type Init = (crelte: Crelte) => void;
|
|
13
|
+
/** The Props that are passed to the app */
|
|
14
|
+
export type AppProps = {
|
|
15
|
+
route: Writable<Route>;
|
|
16
|
+
};
|
|
12
17
|
/**
|
|
13
18
|
* Get Crelte from the current context
|
|
14
19
|
*
|
|
@@ -98,6 +103,13 @@ export declare function getGlobal<T = any>(name: string): Readable<T> | null;
|
|
|
98
103
|
* This only works during component initialisation.
|
|
99
104
|
*/
|
|
100
105
|
export declare function getCookies(): Cookies;
|
|
106
|
+
/**
|
|
107
|
+
* returns the body class instance
|
|
108
|
+
*
|
|
109
|
+
* #### Note
|
|
110
|
+
* This only works during component initialisation.
|
|
111
|
+
*/
|
|
112
|
+
export declare function getBodyClass(): BodyClass;
|
|
101
113
|
/**
|
|
102
114
|
* Listen for route changes
|
|
103
115
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EACN,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACN,KAAK,EACL,QAAQ,EACR,aAAa,EACb,UAA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AKG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAExC;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,QAIjD;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,aAAa,KAAK,IAAI,QAIxD"}
|
package/dist/index.js
CHANGED
|
@@ -114,6 +114,15 @@ export function getGlobal(name) {
|
|
|
114
114
|
export function getCookies() {
|
|
115
115
|
return innerGetCrelte().cookies;
|
|
116
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* returns the body class instance
|
|
119
|
+
*
|
|
120
|
+
* #### Note
|
|
121
|
+
* This only works during component initialisation.
|
|
122
|
+
*/
|
|
123
|
+
export function getBodyClass() {
|
|
124
|
+
return innerGetCrelte().bodyClass;
|
|
125
|
+
}
|
|
117
126
|
/**
|
|
118
127
|
* Listen for route changes
|
|
119
128
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/init/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/init/client.ts"],"names":[],"mappings":"AA0BA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB,4BAA4B;IAC5B,GAAG,EAAE,GAAG,CAAC;IACT,8BAA8B;IAC9B,SAAS,EAAE,GAAG,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,QAAQ,iBAqKxC"}
|
package/dist/init/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadFn, newQueries, onNewCrelteRequest, pluginsBeforeRender, pluginsBeforeRequest, setupPlugins, } from './shared.js';
|
|
1
|
+
import { loadFn, newQueries, onNewCrelteRequest, pluginsAfterRender, pluginsBeforeRender, pluginsBeforeRequest, setupPlugins, } from './shared.js';
|
|
2
2
|
import { tick } from 'svelte';
|
|
3
3
|
import { svelteMount } from './svelteComponents.js';
|
|
4
4
|
import ClientCookies from '../cookies/ClientCookies.js';
|
|
@@ -11,6 +11,9 @@ import Plugins from '../plugins/Plugins.js';
|
|
|
11
11
|
import Events from '../plugins/Events.js';
|
|
12
12
|
import Globals from '../loadData/Globals.js';
|
|
13
13
|
import { Writable } from '../std/stores/index.js';
|
|
14
|
+
import ClientBodyClass from '../bodyClass/ClientBodyClass.js';
|
|
15
|
+
import { BodyClass } from '../bodyClass/index.js';
|
|
16
|
+
import { Cookies } from '../cookies/index.js';
|
|
14
17
|
/**
|
|
15
18
|
* The main function to start the client side rendering
|
|
16
19
|
*
|
|
@@ -49,7 +52,6 @@ export async function main(data) {
|
|
|
49
52
|
preloadOnMouseOver: config.preloadOnMouseOver ?? false,
|
|
50
53
|
});
|
|
51
54
|
const queries = newQueries(ssrCache, router.route.readonly(), config);
|
|
52
|
-
const cookies = new ClientCookies();
|
|
53
55
|
const crelte = newCrelte({
|
|
54
56
|
config,
|
|
55
57
|
ssrCache,
|
|
@@ -58,7 +60,8 @@ export async function main(data) {
|
|
|
58
60
|
globals: new Globals(),
|
|
59
61
|
router: new Router(router),
|
|
60
62
|
queries,
|
|
61
|
-
cookies,
|
|
63
|
+
cookies: new Cookies(new ClientCookies()),
|
|
64
|
+
bodyClass: new BodyClass(ClientBodyClass.fromSsrCache(ssrCache)),
|
|
62
65
|
});
|
|
63
66
|
const app = new InternalApp(data.app);
|
|
64
67
|
// setup plugins
|
|
@@ -68,21 +71,21 @@ export async function main(data) {
|
|
|
68
71
|
router.onBeforeRequest = pluginsBeforeRequest;
|
|
69
72
|
router.loadRunner.loadFn = (cr, opts) => loadFn(cr, app, opts);
|
|
70
73
|
// render Space
|
|
71
|
-
let
|
|
72
|
-
let routeProp;
|
|
74
|
+
let routeProp = null;
|
|
73
75
|
const renderApp = (route) => {
|
|
74
|
-
if (
|
|
76
|
+
if (routeProp) {
|
|
75
77
|
routeProp.set(route);
|
|
76
78
|
return;
|
|
77
79
|
}
|
|
78
80
|
routeProp = new Writable(route);
|
|
79
|
-
|
|
81
|
+
svelteMount(data.app.default, {
|
|
80
82
|
target: document.body,
|
|
81
83
|
props: { route: routeProp },
|
|
82
84
|
context: new Map([['crelte', crelte]]),
|
|
83
85
|
intro: config.playIntro,
|
|
84
86
|
});
|
|
85
87
|
};
|
|
88
|
+
const appMounted = () => !!routeProp;
|
|
86
89
|
router.onError = (e, req) => {
|
|
87
90
|
console.error('routing failed:', e, 'reloading trying to fix it');
|
|
88
91
|
// since onError is called only on subsequent requests we should never
|
|
@@ -90,9 +93,9 @@ export async function main(data) {
|
|
|
90
93
|
window.location.href = req.url.href;
|
|
91
94
|
};
|
|
92
95
|
router.onRender = async (cr, readyForRoute, domUpdated) => {
|
|
93
|
-
if (
|
|
96
|
+
if (appMounted() && cr.req.disableLoadData) {
|
|
94
97
|
// if the app is already rendered and entry did not change
|
|
95
|
-
// we just wan't to run domUpdated because we don't
|
|
98
|
+
// we just wan't to run domUpdated because we don't want to update anything
|
|
96
99
|
const route = readyForRoute();
|
|
97
100
|
cr.router.z_requestCompleted();
|
|
98
101
|
// globals should not be run because they will be empty
|
|
@@ -101,27 +104,33 @@ export async function main(data) {
|
|
|
101
104
|
// todo should we wait a tick here?
|
|
102
105
|
await tick();
|
|
103
106
|
domUpdated(cr, route);
|
|
107
|
+
pluginsAfterRender(cr, route);
|
|
104
108
|
return route;
|
|
105
109
|
}
|
|
106
110
|
const startTime = config.debugTiming ? Date.now() : null;
|
|
107
111
|
let render = async () => {
|
|
108
112
|
const route = readyForRoute();
|
|
109
113
|
cr.router.z_requestCompleted();
|
|
110
|
-
|
|
114
|
+
// this is only important on the first render
|
|
115
|
+
// else we will catch an earlier branch in onRender
|
|
116
|
+
if (route.entryChanged) {
|
|
111
117
|
cr.globals.z_syncToStores();
|
|
112
|
-
|
|
113
|
-
|
|
118
|
+
pluginsBeforeRender(cr, route);
|
|
119
|
+
cr.cookies.z_render();
|
|
120
|
+
cr.bodyClass.z_render();
|
|
121
|
+
}
|
|
114
122
|
renderApp(route);
|
|
115
123
|
await tick();
|
|
116
124
|
if (startTime) {
|
|
117
125
|
console.log('dom update took ' + (Date.now() - startTime) + 'ms');
|
|
118
126
|
}
|
|
119
127
|
domUpdated(cr, route);
|
|
128
|
+
pluginsAfterRender(cr, route);
|
|
120
129
|
return route;
|
|
121
130
|
};
|
|
122
131
|
// render with view Transition if enabled and not in hydration
|
|
123
132
|
if (config.viewTransition &&
|
|
124
|
-
|
|
133
|
+
appMounted() &&
|
|
125
134
|
document.startViewTransition) {
|
|
126
135
|
const prevRender = render;
|
|
127
136
|
render = async () => new Promise(resolve => {
|
|
@@ -156,8 +165,8 @@ function handleLoadError(e) {
|
|
|
156
165
|
const userLang = navigator.language || navigator.userLanguage;
|
|
157
166
|
// Messages in different languages
|
|
158
167
|
const messages = {
|
|
159
|
-
en: 'An error has occurred. Please reload the page or try again later.',
|
|
160
168
|
de: 'Leider ist ein Fehler aufgetreten. Laden Sie die Seite neu, oder versuchen Sie es später noch mal.',
|
|
169
|
+
en: 'An error has occurred. Please reload the page or try again later.',
|
|
161
170
|
fr: 'Une erreur s’est produite. Veuillez recharger la page ou réessayer plus tard.',
|
|
162
171
|
it: 'Si è verificato un errore. Ricarica la pagina o riprova più tardi.',
|
|
163
172
|
nl: 'Er is een fout opgetreden. Herlaad de pagina of probeer het later opnieuw.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/init/server.ts"],"names":[],"mappings":"AAoBA,OAAO,EACN,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/init/server.ts"],"names":[],"mappings":"AAoBA,OAAO,EACN,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE9E,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB,4BAA4B;IAC5B,GAAG,EAAE,GAAG,CAAC;IAET,0CAA0C;IAC1C,UAAU,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CAuHlE;AAED,MAAM,MAAM,KAAK,GAAG;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAE3B,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,GAAG,CAAC;IAEf,UAAU,EAAE,kBAAkB,CAAC;CAC/B,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,SAAS,CAC9B,IAAI,EAAE,aAAa,GACjB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAgC5C"}
|
package/dist/init/server.js
CHANGED
|
@@ -11,6 +11,9 @@ import Events from '../plugins/Events.js';
|
|
|
11
11
|
import Globals from '../loadData/Globals.js';
|
|
12
12
|
import { Router } from '../routing/index.js';
|
|
13
13
|
import { Writable } from '../std/stores/index.js';
|
|
14
|
+
import ServerBodyClass from '../bodyClass/ServerBodyClass.js';
|
|
15
|
+
import BodyClass from '../bodyClass/BodyClass.js';
|
|
16
|
+
import { Cookies } from '../cookies/index.js';
|
|
14
17
|
/**
|
|
15
18
|
* The main function to start the server side rendering
|
|
16
19
|
*
|
|
@@ -43,6 +46,7 @@ export async function main(data) {
|
|
|
43
46
|
ssrCache.set('CRAFT_WEB_URL', data.serverData.craftWeb);
|
|
44
47
|
ssrCache.set('FRONTEND_URL', data.serverData.frontend);
|
|
45
48
|
const cookies = new ServerCookies(data.serverData.headers);
|
|
49
|
+
const bodyClass = new ServerBodyClass();
|
|
46
50
|
ssrCache.set('crelteSites', data.serverData.sites);
|
|
47
51
|
const router = new ServerRouter(data.serverData.sites, data.serverData.headers.get('Accept-Language') ?? '', { debugTiming: config.debugTiming ?? false });
|
|
48
52
|
const queries = newQueries(ssrCache, router.route.readonly(), config);
|
|
@@ -54,7 +58,8 @@ export async function main(data) {
|
|
|
54
58
|
globals: new Globals(),
|
|
55
59
|
router: new Router(router),
|
|
56
60
|
queries,
|
|
57
|
-
cookies,
|
|
61
|
+
cookies: new Cookies(cookies),
|
|
62
|
+
bodyClass: new BodyClass(bodyClass),
|
|
58
63
|
});
|
|
59
64
|
const app = new InternalApp(data.app);
|
|
60
65
|
// setup plugins
|
|
@@ -68,6 +73,8 @@ export async function main(data) {
|
|
|
68
73
|
cr.router.z_requestCompleted();
|
|
69
74
|
cr.globals.z_syncToStores();
|
|
70
75
|
pluginsBeforeRender(cr, route);
|
|
76
|
+
cr.cookies.z_render();
|
|
77
|
+
cr.bodyClass.z_render();
|
|
71
78
|
return route;
|
|
72
79
|
};
|
|
73
80
|
// throws if there was an error
|
|
@@ -75,7 +82,7 @@ export async function main(data) {
|
|
|
75
82
|
// if redirect
|
|
76
83
|
if (!route) {
|
|
77
84
|
const headers = new Headers();
|
|
78
|
-
|
|
85
|
+
cookies._populateHeaders(headers);
|
|
79
86
|
return {
|
|
80
87
|
status: req.statusCode ?? 302,
|
|
81
88
|
location: req.url.toString(),
|
|
@@ -94,16 +101,18 @@ export async function main(data) {
|
|
|
94
101
|
props: { route: routeProp },
|
|
95
102
|
context,
|
|
96
103
|
});
|
|
104
|
+
bodyClass.z_populateSsrCache(ssrCache);
|
|
97
105
|
head += ssrComponents.toHead(data.serverData.ssrManifest);
|
|
98
106
|
head += crelte.ssrCache.z_exportToHead();
|
|
99
107
|
let htmlTemplate = data.serverData.htmlTemplate;
|
|
100
108
|
htmlTemplate = htmlTemplate.replace('<!--page-lang-->', route.site.language);
|
|
109
|
+
htmlTemplate = bodyClass.z_processHtmlTemplate(htmlTemplate);
|
|
101
110
|
const finalHtml = htmlTemplate
|
|
102
111
|
.replace('</head>', head + '\n\t</head>')
|
|
103
112
|
.replace('<!--ssr-body-->', html);
|
|
104
113
|
const entry = route.entry;
|
|
105
114
|
const headers = new Headers();
|
|
106
|
-
|
|
115
|
+
cookies._populateHeaders(headers);
|
|
107
116
|
return {
|
|
108
117
|
status: req.statusCode ??
|
|
109
118
|
(entry.sectionHandle === 'error'
|
package/dist/init/shared.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Readable } from '../std/stores/index.js';
|
|
|
9
9
|
export declare function setupPlugins(crelte: Crelte, plugins: PluginCreator[]): void;
|
|
10
10
|
export declare function pluginsBeforeRequest(cr: CrelteRequest): Promise<void> | void;
|
|
11
11
|
export declare function pluginsBeforeRender(cr: CrelteRequest, route: Route): void;
|
|
12
|
+
export declare function pluginsAfterRender(cr: CrelteRequest, route: Route): void;
|
|
12
13
|
export declare function newQueries(ssrCache: SsrCache, route: Readable<Route | null>, config: Required<Config>): Queries;
|
|
13
14
|
export declare function onNewCrelteRequest(crelte: Crelte, req: Request): CrelteRequest;
|
|
14
15
|
export declare function loadFn(cr: CrelteRequest, app: InternalApp, loadOpts?: LoadOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/init/shared.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,WAA+B,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAC1C,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AAK,EAAE,KAAK,GAAG,IAAI,CAExE;AAED,wBAAgB,UAAU,CACzB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,EAC7B,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,WAcxB;AAED,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,OAAO,GACV,aAAa,CAiBf;AAsBD,wBAAsB,MAAM,CAC3B,EAAE,EAAE,aAAa,EACjB,GAAG,EAAE,WAAW,EAChB,QAAQ,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,IAAI,CAAC,CAwHf"}
|
package/dist/init/shared.js
CHANGED
|
@@ -18,6 +18,10 @@ export function pluginsBeforeRequest(cr) {
|
|
|
18
18
|
}
|
|
19
19
|
export function pluginsBeforeRender(cr, route) {
|
|
20
20
|
cr.events.trigger('beforeRender', cr, route);
|
|
21
|
+
cr.plugins.z_render(cr, route);
|
|
22
|
+
}
|
|
23
|
+
export function pluginsAfterRender(cr, route) {
|
|
24
|
+
cr.events.trigger('afterRender', cr, route);
|
|
21
25
|
}
|
|
22
26
|
export function newQueries(ssrCache, route, config) {
|
|
23
27
|
return Queries.new(ssrCache.get('ENDPOINT_URL'),
|
|
@@ -37,11 +41,17 @@ export function onNewCrelteRequest(crelte, req) {
|
|
|
37
41
|
...crelte,
|
|
38
42
|
router: crelte.router.z_toRequest(req),
|
|
39
43
|
queries: crelte.queries.z_toRequest(req),
|
|
44
|
+
plugins: crelte.plugins.z_toRequest(req),
|
|
40
45
|
globals: crelte.globals.z_toRequest(),
|
|
46
|
+
cookies: crelte.cookies.z_toRequest(),
|
|
47
|
+
bodyClass: crelte.bodyClass.z_toRequest(),
|
|
41
48
|
};
|
|
49
|
+
// make sure helper funcitons link to the correct instances
|
|
50
|
+
nCrelte.getPlugin = name => nCrelte.plugins.get(name);
|
|
51
|
+
nCrelte.getGlobalStore = name => nCrelte.globals.getStore(name);
|
|
42
52
|
return crelteToRequest(nCrelte, req);
|
|
43
53
|
}
|
|
44
|
-
async function
|
|
54
|
+
async function eventsLoadEntry(cr) {
|
|
45
55
|
const listeners = cr.events.getListeners('loadEntry');
|
|
46
56
|
for (const loadEntry of listeners) {
|
|
47
57
|
const entry = await loadEntry(cr);
|
|
@@ -79,7 +89,7 @@ export async function loadFn(cr, app, loadOpts) {
|
|
|
79
89
|
// checked to be empty before doing it
|
|
80
90
|
const entryProm = (async () => {
|
|
81
91
|
// first let's try to call the plugin loadEntry
|
|
82
|
-
let entry = await
|
|
92
|
+
let entry = await eventsLoadEntry(cr);
|
|
83
93
|
if (isCanceled())
|
|
84
94
|
return [];
|
|
85
95
|
// if no plugin provides an entry we load it from the app
|
|
@@ -106,18 +116,20 @@ export async function loadFn(cr, app, loadOpts) {
|
|
|
106
116
|
cr.req.template = template;
|
|
107
117
|
return [entry, template];
|
|
108
118
|
})();
|
|
109
|
-
const
|
|
119
|
+
const eventsLoadGlobalData = cr.events.trigger('loadGlobalData', cr);
|
|
120
|
+
const pluginsLoadGlobalData = cr.plugins.z_loadGlobalData(cr);
|
|
110
121
|
// loading progress is at 20%
|
|
111
122
|
loadOpts?.setProgress(0.2);
|
|
112
123
|
const loadGlobalDataProm = Promise.all([
|
|
113
124
|
globalProm,
|
|
114
125
|
entryProm,
|
|
126
|
+
...eventsLoadGlobalData,
|
|
115
127
|
...pluginsLoadGlobalData,
|
|
116
128
|
]);
|
|
117
129
|
// if globals take longer than 2 seconds to load in dev mode
|
|
118
130
|
// we force resolve them to prevent deadlocks
|
|
119
131
|
if (import.meta.env.DEV &&
|
|
120
|
-
!(await Promise.
|
|
132
|
+
!(await Promise.race([loadGlobalDataProm, timeout(2000)]))) {
|
|
121
133
|
console.error('DEV: globals took longer than 2 seconds to load. ' +
|
|
122
134
|
'Resolving globals now to fix potential deadlocks');
|
|
123
135
|
cr.globals.z_globalsLoaded();
|
|
@@ -128,7 +140,6 @@ export async function loadFn(cr, app, loadOpts) {
|
|
|
128
140
|
cr.globals.z_globalsLoaded();
|
|
129
141
|
// loading progress is at 60%
|
|
130
142
|
loadOpts?.setProgress(0.6);
|
|
131
|
-
const pluginsLoadData = cr.events.trigger('loadData', cr, entry);
|
|
132
143
|
let loadDataProm = null;
|
|
133
144
|
if (template.loadData) {
|
|
134
145
|
loadDataProm = callLoadData(template.loadData, cr, entry);
|
|
@@ -137,9 +148,12 @@ export async function loadFn(cr, app, loadOpts) {
|
|
|
137
148
|
if (app.loadEntryData) {
|
|
138
149
|
entryDataProm = callLoadData(app.loadEntryData, cr, entry);
|
|
139
150
|
}
|
|
151
|
+
const eventsLoadData = cr.events.trigger('loadData', cr, entry);
|
|
152
|
+
const pluginsLoadData = cr.plugins.z_loadData(cr);
|
|
140
153
|
const [templateData, entryData] = await Promise.all([
|
|
141
154
|
loadDataProm,
|
|
142
155
|
entryDataProm,
|
|
156
|
+
...eventsLoadData,
|
|
143
157
|
...pluginsLoadData,
|
|
144
158
|
]);
|
|
145
159
|
cr.req.loadedData = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Globals.d.ts","sourceRoot":"","sources":["../../src/loadData/Globals.ts"],"names":[],"mappings":"AASA,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AACjD,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AAEjD,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;AAEzD;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,OAAO,OAAO;IAK3B,OAAO,CAAC,OAAO,CAAyC;IAIxD,OAAO,CAAC,OAAO,CAA0B;IAGzC,OAAO,CAAC,MAAM,CAA6B;gBAE/B,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IAM/C;;;;;;OAMG;IACH,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,IAA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,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI;IAkB7D;;OAEG;IACH,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IA4B5B;;;OAGG;IACH,WAAW,IAAI,OAAO;IAQtB;;;OAGG;IACH,eAAe;IAYf;;;;OAIG;IACH,cAAc;CAyBd"}
|
package/dist/loadData/entry.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CrelteRequest } from '../index.js';
|
|
2
|
-
import { Query } from '../queries/Queries.js';
|
|
2
|
+
import { Query, QueryOptions } from '../queries/Queries.js';
|
|
3
3
|
export type Entry = {
|
|
4
4
|
sectionHandle: string;
|
|
5
5
|
typeHandle: string;
|
|
@@ -11,7 +11,16 @@ export type EntryQueryVars = {
|
|
|
11
11
|
[key: string]: any;
|
|
12
12
|
};
|
|
13
13
|
export declare function entryQueryVars(cr: CrelteRequest): EntryQueryVars;
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* ## Example
|
|
16
|
+
* `App.svelte`
|
|
17
|
+
* ```ts
|
|
18
|
+
* import entryQuery from '@/queries/entry.graphql';
|
|
19
|
+
*
|
|
20
|
+
* export const loadEntry => cr => queryEntry(cr, entryQuery, entryQueryVars(cr));
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function queryEntry(cr: CrelteRequest, entryQuery: Query, vars: EntryQueryVars, opts?: QueryOptions): Promise<Entry>;
|
|
15
24
|
export declare const ENTRY_ERROR_404: Entry;
|
|
16
25
|
/**
|
|
17
26
|
* Get the entry from the page
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../src/loadData/entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../src/loadData/entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,KAAK,GAAG;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IAGf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACnB,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAAE,EAAE,aAAa,GAAG,cAAc,CAchE;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC/B,EAAE,EAAE,aAAa,EACjB,UAAU,EAAE,KAAK,EACjB,IAAI,EAAE,cAAc,EACpB,IAAI,CAAC,EAAE,YAAY,GACjB,OAAO,CAAC,KAAK,CAAC,CAGhB;AAED,eAAO,MAAM,eAAe,EAAE,KAG7B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,GAAG,GAAG,KAAK,GAAG,IAAI,CAUpD"}
|
package/dist/loadData/entry.js
CHANGED
|
@@ -11,8 +11,17 @@ export function entryQueryVars(cr) {
|
|
|
11
11
|
siteId: cr.site.id,
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* ## Example
|
|
16
|
+
* `App.svelte`
|
|
17
|
+
* ```ts
|
|
18
|
+
* import entryQuery from '@/queries/entry.graphql';
|
|
19
|
+
*
|
|
20
|
+
* export const loadEntry => cr => queryEntry(cr, entryQuery, entryQueryVars(cr));
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export async function queryEntry(cr, entryQuery, vars, opts) {
|
|
24
|
+
const page = await cr.query(entryQuery, vars, opts);
|
|
16
25
|
return extractEntry(page) ?? ENTRY_ERROR_404;
|
|
17
26
|
}
|
|
18
27
|
export const ENTRY_ERROR_404 = {
|
package/dist/node/index.js
CHANGED
|
@@ -115,7 +115,7 @@ export default async function createServer(serverMod, buildTime) {
|
|
|
115
115
|
catch (e) {
|
|
116
116
|
basicError(res, e);
|
|
117
117
|
}
|
|
118
|
-
}).listen(8080);
|
|
118
|
+
}).listen(process.env.PORT ?? 8080);
|
|
119
119
|
}
|
|
120
120
|
function basicError(res, err) {
|
|
121
121
|
console.error('Internal Server Error:', err);
|
package/dist/plugins/Events.d.ts
CHANGED
|
@@ -27,6 +27,9 @@ export default class Events {
|
|
|
27
27
|
* Will be executed in preload as well.
|
|
28
28
|
*
|
|
29
29
|
* @returns a function to remove the listener
|
|
30
|
+
*
|
|
31
|
+
* #### afterRender
|
|
32
|
+
* Note this will also be executed when disableLoadData is true
|
|
30
33
|
*/
|
|
31
34
|
on(ev: 'beforeRequest', fn: (cr: CrelteRequest) => Promise<void> | void): () => void;
|
|
32
35
|
on(ev: 'loadGlobalData', fn: (cr: CrelteRequest) => Promise<any> | any): () => void;
|
|
@@ -34,7 +37,8 @@ export default class Events {
|
|
|
34
37
|
on(ev: 'beforeQueryEntry', fn: (cr: CrelteRequest, vars: EntryQueryVars) => Promise<void> | void): () => void;
|
|
35
38
|
on(ev: 'afterLoadEntry', fn: (cr: CrelteRequest) => Promise<any> | any): () => void;
|
|
36
39
|
on(ev: 'loadData', fn: (cr: CrelteRequest, entry: Entry) => Promise<any> | any): () => void;
|
|
37
|
-
on(ev: 'beforeRender', fn: (cr: CrelteRequest) => void): () => void;
|
|
40
|
+
on(ev: 'beforeRender', fn: (cr: CrelteRequest, route: Route) => void): () => void;
|
|
41
|
+
on(ev: 'afterRender', fn: (cr: CrelteRequest, route: Route) => void): () => void;
|
|
38
42
|
/**
|
|
39
43
|
* Remove a listener
|
|
40
44
|
*/
|
|
@@ -52,6 +56,7 @@ export default class Events {
|
|
|
52
56
|
trigger(ev: 'afterLoadEntry', cr: CrelteRequest): (Promise<any> | any)[];
|
|
53
57
|
trigger(ev: 'loadData', cr: CrelteRequest, entry: Entry): (Promise<any> | any)[];
|
|
54
58
|
trigger(ev: 'beforeRender', cr: CrelteRequest, route: Route): void[];
|
|
59
|
+
trigger(ev: 'afterRender', cr: CrelteRequest, route: Route): void[];
|
|
55
60
|
/**
|
|
56
61
|
* Get all listeners for an event
|
|
57
62
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Events.d.ts","sourceRoot":"","sources":["../../src/plugins/Events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,MAAM,CAAC,OAAO,OAAO,MAAM;IAC1B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;;IAM7B
|
|
1
|
+
{"version":3,"file":"Events.d.ts","sourceRoot":"","sources":["../../src/plugins/Events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,MAAM,CAAC,OAAO,OAAO,MAAM;IAC1B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;;IAM7B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IAEH,EAAE,CACD,EAAE,EAAE,eAAe,EACnB,EAAE,EAAE,CAAC,EAAE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