vike 0.4.228-commit-84954ae → 0.4.228-commit-1bb55f1
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/cjs/__internal/index.js +1 -1
- package/dist/cjs/client/client-routing-runtime/globalContext.js +4 -4
- package/dist/cjs/client/server-routing-runtime/globalContext.js +4 -4
- package/dist/cjs/client/shared/{createGetGlobalContext.js → createGetGlobalContextClient.js} +31 -4
- package/dist/cjs/client/shared/utils.js +1 -0
- package/dist/cjs/node/plugin/plugins/commonConfig.js +5 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolvePointerImport.js +1 -1
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transpileAndExecuteFile.js +0 -1
- package/dist/cjs/node/prerender/runPrerender.js +1 -1
- package/dist/cjs/node/runtime/globalContext.js +17 -6
- package/dist/cjs/node/runtime/index-deprecated.js +9 -38
- package/dist/cjs/node/runtime/index.js +56 -2
- package/dist/cjs/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.js +1 -1
- package/dist/cjs/node/runtime/renderPage.js +1 -1
- package/dist/cjs/shared/assertPageContextProvidedByUser.js +1 -1
- package/dist/cjs/shared/createGlobalContextShared.js +9 -0
- package/dist/cjs/shared/createPageContextShared.js +1 -1
- package/dist/cjs/shared/route/loadPageRoutes.js +1 -1
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/objectAssign.js +1 -1
- package/dist/cjs/utils/requireResolve.js +85 -63
- package/dist/esm/__internal/index.js +2 -2
- package/dist/esm/client/client-routing-runtime/createPageContext.d.ts +5 -2
- package/dist/esm/client/client-routing-runtime/createPageContext.js +2 -2
- package/dist/esm/client/client-routing-runtime/globalContext.d.ts +8 -4
- package/dist/esm/client/client-routing-runtime/globalContext.js +3 -3
- package/dist/esm/client/index.d.ts +1 -0
- package/dist/esm/client/index.js +4 -0
- package/dist/esm/client/node.js +1 -3
- package/dist/esm/client/server-routing-runtime/createPageContextClientSide.d.ts +4 -1
- package/dist/esm/client/server-routing-runtime/createPageContextClientSide.js +2 -2
- package/dist/esm/client/server-routing-runtime/globalContext.d.ts +7 -3
- package/dist/esm/client/server-routing-runtime/globalContext.js +3 -3
- package/dist/esm/client/shared/createGetGlobalContextClient.d.ts +23 -0
- package/dist/esm/client/shared/createGetGlobalContextClient.js +58 -0
- package/dist/esm/client/shared/utils.d.ts +1 -0
- package/dist/esm/client/shared/utils.js +1 -0
- package/dist/esm/node/plugin/plugins/commonConfig.js +5 -2
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolvePointerImport.js +1 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transpileAndExecuteFile.js +0 -1
- package/dist/esm/node/prerender/runPrerender.d.ts +18 -4
- package/dist/esm/node/prerender/runPrerender.js +2 -2
- package/dist/esm/node/runtime/globalContext.d.ts +39 -8
- package/dist/esm/node/runtime/globalContext.js +18 -7
- package/dist/esm/node/runtime/html/injectAssets/getViteDevScript.d.ts +2 -2
- package/dist/esm/node/runtime/html/injectAssets.d.ts +2 -2
- package/dist/esm/node/runtime/index-deprecated.d.ts +1 -16
- package/dist/esm/node/runtime/index-deprecated.js +9 -36
- package/dist/esm/node/runtime/index.d.ts +23 -1
- package/dist/esm/node/runtime/index.js +38 -3
- package/dist/esm/node/runtime/renderPage/analyzePage.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.d.ts +10 -3
- package/dist/esm/node/runtime/renderPage/getPageAssets.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/handleErrorWithoutErrorPage.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/loadUserFilesServerSide.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/log404/index.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.js +1 -1
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.d.ts +16 -2
- package/dist/esm/node/runtime/renderPage.d.ts +10 -3
- package/dist/esm/node/runtime/renderPage.js +2 -2
- package/dist/esm/shared/assertPageContextProvidedByUser.js +1 -1
- package/dist/esm/shared/createGlobalContextShared.d.ts +15 -1
- package/dist/esm/shared/createGlobalContextShared.js +8 -0
- package/dist/esm/shared/createPageContextShared.d.ts +1 -1
- package/dist/esm/shared/createPageContextShared.js +1 -1
- package/dist/esm/shared/route/loadPageRoutes.js +1 -1
- package/dist/esm/shared/types.d.ts +36 -13
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/objectAssign.js +1 -1
- package/dist/esm/utils/requireResolve.d.ts +2 -2
- package/dist/esm/utils/requireResolve.js +85 -63
- package/package.json +12 -11
- package/dist/cjs/node/runtime/index-common.js +0 -27
- package/dist/esm/client/shared/createGetGlobalContext.d.ts +0 -11
- package/dist/esm/client/shared/createGetGlobalContext.js +0 -29
- package/dist/esm/node/runtime/index-common.d.ts +0 -8
- package/dist/esm/node/runtime/index-common.js +0 -10
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { createPageContextServerSide };
|
|
2
2
|
export { createPageContextServerSideWithoutGlobalContext };
|
|
3
3
|
export type { PageContextCreatedServerSide };
|
|
4
|
-
import type {
|
|
4
|
+
import type { GlobalContextServerInternal, GlobalContextServer } from '../globalContext.js';
|
|
5
5
|
import type { PageContextInit } from '../renderPage.js';
|
|
6
6
|
type PageContextCreatedServerSide = Awaited<ReturnType<typeof createPageContextServerSide>>;
|
|
7
|
-
declare function createPageContextServerSide(pageContextInit: PageContextInit, globalContext:
|
|
7
|
+
declare function createPageContextServerSide(pageContextInit: PageContextInit, globalContext: GlobalContextServerInternal, globalObject_public: GlobalContextServer, { isPrerendering, ssr: { urlHandler, isClientSideNavigation } }: {
|
|
8
8
|
isPrerendering: false;
|
|
9
9
|
ssr: {
|
|
10
10
|
urlHandler: null | ((url: string) => string);
|
|
@@ -22,6 +22,7 @@ declare function createPageContextServerSide(pageContextInit: PageContextInit, g
|
|
|
22
22
|
} & {
|
|
23
23
|
globalContext: GlobalContextServer;
|
|
24
24
|
_globalContext: {
|
|
25
|
+
isGlobalContext: true;
|
|
25
26
|
_virtualFileExports: unknown;
|
|
26
27
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
27
28
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -47,8 +48,10 @@ declare function createPageContextServerSide(pageContextInit: PageContextInit, g
|
|
|
47
48
|
};
|
|
48
49
|
baseServer: string;
|
|
49
50
|
baseAssets: string;
|
|
51
|
+
isClientSide: false;
|
|
50
52
|
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
51
53
|
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
54
|
+
isGlobalContext: true;
|
|
52
55
|
_virtualFileExports: unknown;
|
|
53
56
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
54
57
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -75,8 +78,10 @@ declare function createPageContextServerSide(pageContextInit: PageContextInit, g
|
|
|
75
78
|
_usesClientRouter: boolean;
|
|
76
79
|
baseServer: string;
|
|
77
80
|
baseAssets: string;
|
|
81
|
+
isClientSide: false;
|
|
78
82
|
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
79
83
|
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
84
|
+
isGlobalContext: true;
|
|
80
85
|
_virtualFileExports: unknown;
|
|
81
86
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
82
87
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -103,8 +108,10 @@ declare function createPageContextServerSide(pageContextInit: PageContextInit, g
|
|
|
103
108
|
_usesClientRouter: boolean;
|
|
104
109
|
baseServer: string;
|
|
105
110
|
baseAssets: string;
|
|
111
|
+
isClientSide: false;
|
|
106
112
|
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
107
113
|
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
114
|
+
isGlobalContext: true;
|
|
108
115
|
_virtualFileExports: unknown;
|
|
109
116
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
110
117
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -137,7 +144,7 @@ declare function createPageContextServerSide(pageContextInit: PageContextInit, g
|
|
|
137
144
|
_source: import("../../../shared/page-configs/getPageConfigUserFriendly.js").Source;
|
|
138
145
|
_sources: import("../../../shared/page-configs/getPageConfigUserFriendly.js").Sources;
|
|
139
146
|
_from: import("../../../shared/page-configs/getPageConfigUserFriendly.js").From;
|
|
140
|
-
|
|
147
|
+
isPageContext: true;
|
|
141
148
|
}>;
|
|
142
149
|
declare function createPageContextServerSideWithoutGlobalContext(pageContextInit: PageContextInit): {
|
|
143
150
|
isClientSide: boolean;
|
|
@@ -5,7 +5,7 @@ export type { GetPageAssets };
|
|
|
5
5
|
export type { PageContextGetPageAssets };
|
|
6
6
|
import { type MediaType } from './inferMediaType.js';
|
|
7
7
|
import type { ClientDependency } from '../../../shared/getPageFiles/analyzePageClientSide/ClientDependency.js';
|
|
8
|
-
import type {
|
|
8
|
+
import type { GlobalContextServerInternal } from '../globalContext.js';
|
|
9
9
|
import type { ResolveClientEntriesDev } from '../../plugin/shared/resolveClientEntriesDev.js';
|
|
10
10
|
type PageAsset = {
|
|
11
11
|
src: string;
|
|
@@ -18,7 +18,7 @@ type PageContextGetPageAssets = {
|
|
|
18
18
|
_baseServer: string;
|
|
19
19
|
_baseAssets: string | null;
|
|
20
20
|
_includeAssetsImportedByServer: boolean;
|
|
21
|
-
_globalContext:
|
|
21
|
+
_globalContext: GlobalContextServerInternal;
|
|
22
22
|
};
|
|
23
23
|
declare function getPageAssets(pageContext: PageContextGetPageAssets, clientDependencies: ClientDependency[], clientEntries: string[]): Promise<PageAsset[]>;
|
|
24
24
|
declare function setResolveClientEntriesDev(resolveClientEntriesDev: ResolveClientEntriesDev): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { handleErrorWithoutErrorPage };
|
|
2
|
-
import type {
|
|
2
|
+
import type { GlobalContextServerInternal } from '../globalContext.js';
|
|
3
3
|
import type { PageContextAfterRender } from './renderPageAlreadyRouted.js';
|
|
4
4
|
import type { PageConfigRuntime } from '../../../shared/page-configs/PageConfig.js';
|
|
5
5
|
import type { PageFile } from '../../../shared/getPageFiles.js';
|
|
@@ -10,6 +10,6 @@ declare function handleErrorWithoutErrorPage<PageContext extends {
|
|
|
10
10
|
pageId: null;
|
|
11
11
|
_pageFilesAll: PageFile[];
|
|
12
12
|
_pageConfigs: PageConfigRuntime[];
|
|
13
|
-
_globalContext:
|
|
13
|
+
_globalContext: GlobalContextServerInternal;
|
|
14
14
|
urlOriginal: string;
|
|
15
15
|
}>(pageContext: PageContext): Promise<PageContext & PageContextAfterRender>;
|
|
@@ -6,12 +6,12 @@ import { PromiseType } from '../utils.js';
|
|
|
6
6
|
import { PageContextGetPageAssets, type PageAsset } from './getPageAssets.js';
|
|
7
7
|
import { type PageContextDebugRouteMatches } from './debugPageFiles.js';
|
|
8
8
|
import type { PageConfigRuntime } from '../../../shared/page-configs/PageConfig.js';
|
|
9
|
-
import type {
|
|
9
|
+
import type { GlobalContextServerInternal } from '../globalContext.js';
|
|
10
10
|
type PageContext_loadUserFilesServerSide = PageContextGetPageAssets & PageContextDebugRouteMatches & {
|
|
11
11
|
urlOriginal: string;
|
|
12
12
|
_pageFilesAll: PageFile[];
|
|
13
13
|
_pageConfigs: PageConfigRuntime[];
|
|
14
|
-
_globalContext:
|
|
14
|
+
_globalContext: GlobalContextServerInternal;
|
|
15
15
|
};
|
|
16
16
|
type PageFiles = PromiseType<ReturnType<typeof loadUserFilesServerSide>>;
|
|
17
17
|
declare function loadUserFilesServerSide(pageContext: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { log404 };
|
|
2
2
|
export { getRoutesInfo };
|
|
3
3
|
import type { PageRoutes } from '../../../../shared/route/index.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { GlobalContextServerInternal } from '../../globalContext.js';
|
|
5
5
|
declare function log404(pageContext: {
|
|
6
6
|
urlPathname: string;
|
|
7
7
|
errorWhileRendering: null | Error;
|
|
8
8
|
isClientSideNavigation: boolean;
|
|
9
9
|
_pageRoutes: PageRoutes;
|
|
10
|
-
_globalContext:
|
|
10
|
+
_globalContext: GlobalContextServerInternal;
|
|
11
11
|
}): Promise<void>;
|
|
12
12
|
declare function getRoutesInfo(pageRoutes: PageRoutes): string | null;
|
package/dist/esm/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { PageContextUrlInternal } from '../../../shared/getPageContextUrlCompute
|
|
|
4
4
|
import type { PageConfigRuntime } from '../../../shared/page-configs/PageConfig.js';
|
|
5
5
|
import type { PageConfigUserFriendlyOld } from '../../../shared/page-configs/getPageConfigUserFriendly.js';
|
|
6
6
|
import { PageContextBuiltInServerInternal } from '../../../shared/types.js';
|
|
7
|
-
import type {
|
|
7
|
+
import type { GlobalContextServerInternal, GlobalContextServer } from '../globalContext.js';
|
|
8
8
|
type PageContextForUserConsumptionServerSide = PageContextBuiltInServerInternal & PageConfigUserFriendlyOld & {
|
|
9
9
|
urlOriginal: string;
|
|
10
10
|
/** @deprecated */
|
|
@@ -18,7 +18,7 @@ type PageContextForUserConsumptionServerSide = PageContextBuiltInServerInternal
|
|
|
18
18
|
is404: null | boolean;
|
|
19
19
|
isClientSideNavigation: boolean;
|
|
20
20
|
pageProps?: Record<string, unknown>;
|
|
21
|
-
_globalContext:
|
|
21
|
+
_globalContext: GlobalContextServerInternal;
|
|
22
22
|
globalContext: GlobalContextServer;
|
|
23
23
|
} & Record<string, unknown>;
|
|
24
24
|
declare function preparePageContextForUserConsumptionServerSide(pageContext: PageContextForUserConsumptionServerSide): void;
|
|
@@ -7,7 +7,7 @@ function preparePageContextForUserConsumptionServerSide(pageContext) {
|
|
|
7
7
|
assert(isPlainObject(pageContext.routeParams));
|
|
8
8
|
assert('Page' in pageContext);
|
|
9
9
|
assert(typeof pageContext.isClientSideNavigation === 'boolean');
|
|
10
|
-
assert(pageContext.
|
|
10
|
+
assert(pageContext.isPageContext);
|
|
11
11
|
assert(pageContext.isClientSide === false);
|
|
12
12
|
assert(typeof pageContext.isPrerendering === 'boolean');
|
|
13
13
|
preparePageContextForUserConsumption(pageContext);
|
|
@@ -37,6 +37,7 @@ declare function prerenderPage(pageContext: PageContextCreatedServerSide & PageF
|
|
|
37
37
|
} & {
|
|
38
38
|
globalContext: import("../globalContext.js").GlobalContextServer;
|
|
39
39
|
_globalContext: {
|
|
40
|
+
isGlobalContext: true;
|
|
40
41
|
_virtualFileExports: unknown;
|
|
41
42
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
42
43
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -62,8 +63,10 @@ declare function prerenderPage(pageContext: PageContextCreatedServerSide & PageF
|
|
|
62
63
|
};
|
|
63
64
|
baseServer: string;
|
|
64
65
|
baseAssets: string;
|
|
66
|
+
isClientSide: false;
|
|
65
67
|
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
66
68
|
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
69
|
+
isGlobalContext: true;
|
|
67
70
|
_virtualFileExports: unknown;
|
|
68
71
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
69
72
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -90,8 +93,10 @@ declare function prerenderPage(pageContext: PageContextCreatedServerSide & PageF
|
|
|
90
93
|
_usesClientRouter: boolean;
|
|
91
94
|
baseServer: string;
|
|
92
95
|
baseAssets: string;
|
|
96
|
+
isClientSide: false;
|
|
93
97
|
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
94
98
|
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
99
|
+
isGlobalContext: true;
|
|
95
100
|
_virtualFileExports: unknown;
|
|
96
101
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
97
102
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -118,8 +123,10 @@ declare function prerenderPage(pageContext: PageContextCreatedServerSide & PageF
|
|
|
118
123
|
_usesClientRouter: boolean;
|
|
119
124
|
baseServer: string;
|
|
120
125
|
baseAssets: string;
|
|
126
|
+
isClientSide: false;
|
|
121
127
|
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
122
128
|
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
129
|
+
isGlobalContext: true;
|
|
123
130
|
_virtualFileExports: unknown;
|
|
124
131
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
125
132
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -152,7 +159,7 @@ declare function prerenderPage(pageContext: PageContextCreatedServerSide & PageF
|
|
|
152
159
|
_source: import("../../../shared/page-configs/getPageConfigUserFriendly.js").Source;
|
|
153
160
|
_sources: import("../../../shared/page-configs/getPageConfigUserFriendly.js").Sources;
|
|
154
161
|
_from: import("../../../shared/page-configs/getPageConfigUserFriendly.js").From;
|
|
155
|
-
|
|
162
|
+
isPageContext: true;
|
|
156
163
|
} & import("../../../shared/getPageFiles.js").PageConfigUserFriendlyOld & {
|
|
157
164
|
Page: unknown;
|
|
158
165
|
_isHtmlOnly: boolean;
|
|
@@ -184,6 +191,7 @@ declare function prerenderPage(pageContext: PageContextCreatedServerSide & PageF
|
|
|
184
191
|
} & {
|
|
185
192
|
globalContext: import("../globalContext.js").GlobalContextServer;
|
|
186
193
|
_globalContext: {
|
|
194
|
+
isGlobalContext: true;
|
|
187
195
|
_virtualFileExports: unknown;
|
|
188
196
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
189
197
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -209,8 +217,10 @@ declare function prerenderPage(pageContext: PageContextCreatedServerSide & PageF
|
|
|
209
217
|
};
|
|
210
218
|
baseServer: string;
|
|
211
219
|
baseAssets: string;
|
|
220
|
+
isClientSide: false;
|
|
212
221
|
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
213
222
|
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
223
|
+
isGlobalContext: true;
|
|
214
224
|
_virtualFileExports: unknown;
|
|
215
225
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
216
226
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -237,8 +247,10 @@ declare function prerenderPage(pageContext: PageContextCreatedServerSide & PageF
|
|
|
237
247
|
_usesClientRouter: boolean;
|
|
238
248
|
baseServer: string;
|
|
239
249
|
baseAssets: string;
|
|
250
|
+
isClientSide: false;
|
|
240
251
|
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
241
252
|
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
253
|
+
isGlobalContext: true;
|
|
242
254
|
_virtualFileExports: unknown;
|
|
243
255
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
244
256
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -265,8 +277,10 @@ declare function prerenderPage(pageContext: PageContextCreatedServerSide & PageF
|
|
|
265
277
|
_usesClientRouter: boolean;
|
|
266
278
|
baseServer: string;
|
|
267
279
|
baseAssets: string;
|
|
280
|
+
isClientSide: false;
|
|
268
281
|
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
269
282
|
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
283
|
+
isGlobalContext: true;
|
|
270
284
|
_virtualFileExports: unknown;
|
|
271
285
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
272
286
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -299,7 +313,7 @@ declare function prerenderPage(pageContext: PageContextCreatedServerSide & PageF
|
|
|
299
313
|
_source: import("../../../shared/page-configs/getPageConfigUserFriendly.js").Source;
|
|
300
314
|
_sources: import("../../../shared/page-configs/getPageConfigUserFriendly.js").Sources;
|
|
301
315
|
_from: import("../../../shared/page-configs/getPageConfigUserFriendly.js").From;
|
|
302
|
-
|
|
316
|
+
isPageContext: true;
|
|
303
317
|
} & import("../../../shared/getPageFiles.js").PageConfigUserFriendlyOld & {
|
|
304
318
|
Page: unknown;
|
|
305
319
|
_isHtmlOnly: boolean;
|
|
@@ -2,7 +2,7 @@ export { renderPage };
|
|
|
2
2
|
export { renderPage_addAsyncHookwrapper };
|
|
3
3
|
export type { PageContextInit };
|
|
4
4
|
export type { PageContextBegin };
|
|
5
|
-
import { type GlobalContextServer, type
|
|
5
|
+
import { type GlobalContextServer, type GlobalContextServerInternal } from './globalContext.js';
|
|
6
6
|
import { type HttpResponse } from './renderPage/createHttpResponse.js';
|
|
7
7
|
import type { PageContextServer } from '../../types/index.js';
|
|
8
8
|
import type { PageContextBuiltInServerInternal } from '../../shared/types.js';
|
|
@@ -18,7 +18,7 @@ declare let asyncHookWrapper: <PageContext>(_httpRequestId: number, ret: () => P
|
|
|
18
18
|
pageContextReturn: Awaited<PageContext>;
|
|
19
19
|
}>;
|
|
20
20
|
declare function renderPage_addAsyncHookwrapper(wrapper: typeof asyncHookWrapper): void;
|
|
21
|
-
declare function getPageContextBegin(pageContextInit: PageContextInit, globalContext:
|
|
21
|
+
declare function getPageContextBegin(pageContextInit: PageContextInit, globalContext: GlobalContextServerInternal, globalContext_public: GlobalContextServer, httpRequestId: number): Promise<{
|
|
22
22
|
isClientSide: boolean;
|
|
23
23
|
isPrerendering: boolean;
|
|
24
24
|
} & Pick<PageContextBuiltInServerInternal, "urlOriginal" | "headersOriginal"> & {
|
|
@@ -27,6 +27,7 @@ declare function getPageContextBegin(pageContextInit: PageContextInit, globalCon
|
|
|
27
27
|
} & {
|
|
28
28
|
globalContext: GlobalContextServer;
|
|
29
29
|
_globalContext: {
|
|
30
|
+
isGlobalContext: true;
|
|
30
31
|
_virtualFileExports: unknown;
|
|
31
32
|
_pageFilesAll: import("../../shared/getPageFiles.js").PageFile[];
|
|
32
33
|
_pageConfigs: import("../../__internal/index.js").PageConfig[];
|
|
@@ -52,8 +53,10 @@ declare function getPageContextBegin(pageContextInit: PageContextInit, globalCon
|
|
|
52
53
|
};
|
|
53
54
|
baseServer: string;
|
|
54
55
|
baseAssets: string;
|
|
56
|
+
isClientSide: false;
|
|
55
57
|
_pageRoutes: import("../../shared/route/loadPageRoutes.js").PageRoutes;
|
|
56
58
|
_onBeforeRouteHook: import("../../shared/hooks/getHook.js").Hook | null;
|
|
59
|
+
isGlobalContext: true;
|
|
57
60
|
_virtualFileExports: unknown;
|
|
58
61
|
_pageFilesAll: import("../../shared/getPageFiles.js").PageFile[];
|
|
59
62
|
_pageConfigs: import("../../__internal/index.js").PageConfig[];
|
|
@@ -80,8 +83,10 @@ declare function getPageContextBegin(pageContextInit: PageContextInit, globalCon
|
|
|
80
83
|
_usesClientRouter: boolean;
|
|
81
84
|
baseServer: string;
|
|
82
85
|
baseAssets: string;
|
|
86
|
+
isClientSide: false;
|
|
83
87
|
_pageRoutes: import("../../shared/route/loadPageRoutes.js").PageRoutes;
|
|
84
88
|
_onBeforeRouteHook: import("../../shared/hooks/getHook.js").Hook | null;
|
|
89
|
+
isGlobalContext: true;
|
|
85
90
|
_virtualFileExports: unknown;
|
|
86
91
|
_pageFilesAll: import("../../shared/getPageFiles.js").PageFile[];
|
|
87
92
|
_pageConfigs: import("../../__internal/index.js").PageConfig[];
|
|
@@ -108,8 +113,10 @@ declare function getPageContextBegin(pageContextInit: PageContextInit, globalCon
|
|
|
108
113
|
_usesClientRouter: boolean;
|
|
109
114
|
baseServer: string;
|
|
110
115
|
baseAssets: string;
|
|
116
|
+
isClientSide: false;
|
|
111
117
|
_pageRoutes: import("../../shared/route/loadPageRoutes.js").PageRoutes;
|
|
112
118
|
_onBeforeRouteHook: import("../../shared/hooks/getHook.js").Hook | null;
|
|
119
|
+
isGlobalContext: true;
|
|
113
120
|
_virtualFileExports: unknown;
|
|
114
121
|
_pageFilesAll: import("../../shared/getPageFiles.js").PageFile[];
|
|
115
122
|
_pageConfigs: import("../../__internal/index.js").PageConfig[];
|
|
@@ -142,7 +149,7 @@ declare function getPageContextBegin(pageContextInit: PageContextInit, globalCon
|
|
|
142
149
|
_source: import("../../shared/page-configs/getPageConfigUserFriendly.js").Source;
|
|
143
150
|
_sources: import("../../shared/page-configs/getPageConfigUserFriendly.js").Sources;
|
|
144
151
|
_from: import("../../shared/page-configs/getPageConfigUserFriendly.js").From;
|
|
145
|
-
|
|
152
|
+
isPageContext: true;
|
|
146
153
|
} & {
|
|
147
154
|
_httpRequestId: number;
|
|
148
155
|
}>;
|
|
@@ -5,7 +5,7 @@ import { createPageContextServerSide, createPageContextServerSideWithoutGlobalCo
|
|
|
5
5
|
import { route } from '../../shared/route/index.js';
|
|
6
6
|
import { assert, hasProp, objectAssign, isUrl, parseUrl, onSetupRuntime, assertWarning, getGlobalObject, checkType, assertUsage, normalizeUrlPathname, removeBaseServer, modifyUrlPathname, prependBase, removeUrlOrigin, setUrlOrigin, isUri, getUrlPretty } from './utils.js';
|
|
7
7
|
import { assertNoInfiniteAbortLoop, getPageContextFromAllRewrites, isAbortError, logAbortErrorHandled } from '../../shared/route/abort.js';
|
|
8
|
-
import {
|
|
8
|
+
import { getGlobalContextServerInternal, initGlobalContext_renderPage } from './globalContext.js';
|
|
9
9
|
import { handlePageContextRequestUrl } from './renderPage/handlePageContextRequestUrl.js';
|
|
10
10
|
import { createHttpResponseFavicon404, createHttpResponseRedirect, createHttpResponsePageContextJson, createHttpResponseError, createHttpResponseErrorWithoutGlobalContext, createHttpResponseBaseIsMissing } from './renderPage/createHttpResponse.js';
|
|
11
11
|
import { logRuntimeError, logRuntimeInfo } from './renderPage/loggerRuntime.js';
|
|
@@ -76,7 +76,7 @@ async function renderPagePrepare(pageContextInit, httpRequestId) {
|
|
|
76
76
|
else {
|
|
77
77
|
// `globalContext` now contains the entire Vike config and getVikeConfig() isn't called anymore for this request.
|
|
78
78
|
}
|
|
79
|
-
const { globalContext, globalContext_public } = await
|
|
79
|
+
const { globalContext, globalContext_public } = await getGlobalContextServerInternal();
|
|
80
80
|
const pageContextBegin = await getPageContextBegin(pageContextInit, globalContext, globalContext_public, httpRequestId);
|
|
81
81
|
// Check Base URL
|
|
82
82
|
{
|
|
@@ -7,7 +7,7 @@ function assertPageContextProvidedByUser(pageContextProvidedByUser, { hookName,
|
|
|
7
7
|
assert(!hookName.endsWith(')'));
|
|
8
8
|
const errPrefix = `The ${pc.cyan('pageContext')} object provided by the ${hookName}() hook defined by ${hookFilePath}`;
|
|
9
9
|
assertUsage(isObject(pageContextProvidedByUser), `${errPrefix} should be an object (but it's ${pc.cyan(`typeof pageContext === ${JSON.stringify(typeof pageContextProvidedByUser)}`)} instead)`);
|
|
10
|
-
assertUsage(!('
|
|
10
|
+
assertUsage(!('isPageContext' in pageContextProvidedByUser), `${errPrefix} shouldn't be the whole ${pc.cyan('pageContext')} object, see https://vike.dev/pageContext-manipulation#do-not-return-entire-pagecontext`);
|
|
11
11
|
// In principle, it's possible to use onBeforeRoute()` to override and define the whole routing.
|
|
12
12
|
// Is that a good idea to allow users to do this? Beyond deep integration with Vue Router or React Router, is there a use case for this?
|
|
13
13
|
assertWarning(!('pageId' in pageContextProvidedByUser), `${errPrefix} sets ${pc.cyan('pageContext.pageId')} which means that Vike's routing is overriden. This is an experimental feature: make sure to contact a vike maintainer before using this.`, { onlyOnce: true });
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
export { createGlobalContextShared };
|
|
2
|
+
export { getGlobalContextSyncErrMsg };
|
|
2
3
|
export type { GlobalContextShared };
|
|
3
4
|
export type { GlobalContextSharedPublic };
|
|
5
|
+
declare const getGlobalContextSyncErrMsg = "The global context isn't set yet, call getGlobalContextSync() later or use getGlobalContext() instead.";
|
|
4
6
|
declare function createGlobalContextShared<GlobalContextAddendum extends object>(virtualFileExports: unknown, globalObject: {
|
|
5
7
|
globalContext?: Record<string, unknown>;
|
|
6
8
|
}, addGlobalContext?: (globalContext: GlobalContextShared) => Promise<GlobalContextAddendum>): Promise<{
|
|
9
|
+
/**
|
|
10
|
+
* Useful for distinguishing `globalContext` from other objects and narrowing down TypeScript unions.
|
|
11
|
+
*
|
|
12
|
+
* https://vike.dev/globalContext#typescript
|
|
13
|
+
*/
|
|
14
|
+
isGlobalContext: true;
|
|
7
15
|
_virtualFileExports: unknown;
|
|
8
16
|
_pageFilesAll: import("./getPageFiles.js").PageFile[];
|
|
9
17
|
_pageConfigs: import("./page-configs/PageConfig.js").PageConfigRuntime[];
|
|
@@ -12,9 +20,15 @@ declare function createGlobalContextShared<GlobalContextAddendum extends object>
|
|
|
12
20
|
config: import("./page-configs/Config/PageContextConfig.js").ConfigResolved;
|
|
13
21
|
pages: import("./page-configs/getPageConfigUserFriendly.js").PageConfigsUserFriendly;
|
|
14
22
|
} & Awaited<GlobalContextAddendum>>;
|
|
15
|
-
type GlobalContextSharedPublic = Pick<GlobalContextShared, 'config' | 'pages'>;
|
|
23
|
+
type GlobalContextSharedPublic = Pick<GlobalContextShared, 'config' | 'pages' | 'isGlobalContext'>;
|
|
16
24
|
type GlobalContextShared = ReturnType<typeof createGlobalContextBase>;
|
|
17
25
|
declare function createGlobalContextBase(virtualFileExports: unknown): {
|
|
26
|
+
/**
|
|
27
|
+
* Useful for distinguishing `globalContext` from other objects and narrowing down TypeScript unions.
|
|
28
|
+
*
|
|
29
|
+
* https://vike.dev/globalContext#typescript
|
|
30
|
+
*/
|
|
31
|
+
isGlobalContext: true;
|
|
18
32
|
_virtualFileExports: unknown;
|
|
19
33
|
_pageFilesAll: import("./getPageFiles.js").PageFile[];
|
|
20
34
|
_pageConfigs: import("./page-configs/PageConfig.js").PageConfigRuntime[];
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { createGlobalContextShared };
|
|
2
|
+
export { getGlobalContextSyncErrMsg };
|
|
3
|
+
const getGlobalContextSyncErrMsg = "The global context isn't set yet, call getGlobalContextSync() later or use getGlobalContext() instead.";
|
|
2
4
|
import { getPageConfigsRuntime } from './getPageConfigsRuntime.js';
|
|
3
5
|
import { executeHookGenericGlobalCumulative } from './hooks/executeHookGeneric.js';
|
|
4
6
|
import { objectAssign } from './utils.js';
|
|
@@ -31,6 +33,12 @@ async function createGlobalContextShared(virtualFileExports, globalObject, addGl
|
|
|
31
33
|
function createGlobalContextBase(virtualFileExports) {
|
|
32
34
|
const { pageFilesAll, allPageIds, pageConfigs, pageConfigGlobal, globalConfig, pageConfigsUserFriendly } = getPageConfigsRuntime(virtualFileExports);
|
|
33
35
|
const globalContext = {
|
|
36
|
+
/**
|
|
37
|
+
* Useful for distinguishing `globalContext` from other objects and narrowing down TypeScript unions.
|
|
38
|
+
*
|
|
39
|
+
* https://vike.dev/globalContext#typescript
|
|
40
|
+
*/
|
|
41
|
+
isGlobalContext: true,
|
|
34
42
|
_virtualFileExports: virtualFileExports,
|
|
35
43
|
_pageFilesAll: pageFilesAll,
|
|
36
44
|
_pageConfigs: pageConfigs,
|
|
@@ -5,5 +5,5 @@ declare function createPageContextShared<T extends object>(pageContextCreated: T
|
|
|
5
5
|
_source: import("./page-configs/getPageConfigUserFriendly.js").Source;
|
|
6
6
|
_sources: import("./page-configs/getPageConfigUserFriendly.js").Sources;
|
|
7
7
|
_from: import("./page-configs/getPageConfigUserFriendly.js").From;
|
|
8
|
-
|
|
8
|
+
isPageContext: true;
|
|
9
9
|
}>;
|
|
@@ -7,7 +7,7 @@ async function createPageContextShared(pageContextCreated, pageConfigGlobal) {
|
|
|
7
7
|
pageConfigGlobalValues: pageConfigGlobal.configValues
|
|
8
8
|
});
|
|
9
9
|
objectAssign(pageContextCreated, {
|
|
10
|
-
|
|
10
|
+
isPageContext: true,
|
|
11
11
|
...pageConfigGlobalUserFriendly
|
|
12
12
|
}, true);
|
|
13
13
|
await executeHookGenericGlobalCumulative('onCreatePageContext', pageConfigGlobal, pageContextCreated, pageContextCreated);
|
|
@@ -8,7 +8,7 @@ import { getDefinedAtString } from '../page-configs/getConfigDefinedAt.js';
|
|
|
8
8
|
import { warnDeprecatedAllowKey } from './resolveRouteFunction.js';
|
|
9
9
|
import { getHookFromPageConfigGlobal, getHookTimeoutDefault } from '../hooks/getHook.js';
|
|
10
10
|
async function loadPageRoutes(
|
|
11
|
-
// Remove all arguments and use
|
|
11
|
+
// Remove all arguments and use GlobalContextServerInternal instead?
|
|
12
12
|
pageFilesAll, pageConfigs, pageConfigGlobal, allPageIds) {
|
|
13
13
|
// TODO/next-major: remove & make this function sync
|
|
14
14
|
await Promise.all(pageFilesAll.filter((p) => p.fileType === '.page.route').map((p) => p.loadFile?.()));
|
|
@@ -26,24 +26,34 @@ type GlobalContext = GlobalContextServer | GlobalContextClient;
|
|
|
26
26
|
type PageContextWithServerRouting<Data = unknown> = PageContextClientWithServerRouting<Data> | PageContextServer<Data>;
|
|
27
27
|
type PageContextClientWithServerRouting<Data = unknown> = PageContextBuiltInClientWithServerRouting<Data> & Vike.PageContext & Vike.PageContextClient;
|
|
28
28
|
type PageContextBuiltInCommon<Data> = {
|
|
29
|
+
/**
|
|
30
|
+
* Useful for distinguishing `pageContext` from other objects and narrowing down TypeScript unions.
|
|
31
|
+
*
|
|
32
|
+
* https://vike.dev/pageContext#typescript
|
|
33
|
+
*/
|
|
34
|
+
isPageContext: true;
|
|
29
35
|
/** The `export { Page }` of your `.page.js` file.
|
|
30
36
|
*
|
|
31
37
|
* https://vike.dev/Page
|
|
38
|
+
* https://vike.dev/pageContext#Page
|
|
32
39
|
*/
|
|
33
40
|
Page: Config['Page'];
|
|
34
41
|
/** Route Parameters, e.g. `pageContext.routeParams.productId` for a Route String `/product/@productId`.
|
|
35
42
|
*
|
|
36
43
|
* https://vike.dev/route-string
|
|
44
|
+
* https://vike.dev/pageContext#routeParams
|
|
37
45
|
*/
|
|
38
46
|
routeParams: Record<string, string>;
|
|
39
47
|
/** The page's data which was fetched using the data() hook.
|
|
40
48
|
*
|
|
41
49
|
* https://vike.dev/data
|
|
50
|
+
* https://vike.dev/pageContext#data
|
|
42
51
|
*/
|
|
43
52
|
data: Data;
|
|
44
53
|
/** The page's configuration values.
|
|
45
54
|
*
|
|
46
55
|
* https://vike.dev/config
|
|
56
|
+
* https://vike.dev/pageContext#config
|
|
47
57
|
*/
|
|
48
58
|
config: PageContextConfig;
|
|
49
59
|
/** The page's configuration, including the configs origin and overriden configs.
|
|
@@ -72,9 +82,8 @@ type PageContextBuiltInCommon<Data> = {
|
|
|
72
82
|
*
|
|
73
83
|
* As a string object normalized by Vike.
|
|
74
84
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* - `pageContext.headersOriginal`
|
|
85
|
+
* https://vike.dev/headers
|
|
86
|
+
* https://vike.dev/pageContext#headers
|
|
78
87
|
*/
|
|
79
88
|
headers: Record<string, string> | null;
|
|
80
89
|
/**
|
|
@@ -82,9 +91,8 @@ type PageContextBuiltInCommon<Data> = {
|
|
|
82
91
|
*
|
|
83
92
|
* The original object provided by the server.
|
|
84
93
|
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* - `pageContext.headers`
|
|
94
|
+
* https://vike.dev/headers
|
|
95
|
+
* https://vike.dev/pageContext#headersOriginal
|
|
88
96
|
*/
|
|
89
97
|
headersOriginal?: unknown;
|
|
90
98
|
/** If an error occurs, whether the error is a `404 Page Not Found`.
|
|
@@ -95,25 +103,28 @@ type PageContextBuiltInCommon<Data> = {
|
|
|
95
103
|
/**
|
|
96
104
|
* Whether the page was navigated by the client-side router.
|
|
97
105
|
*
|
|
98
|
-
* https://vike.dev/pageContext
|
|
106
|
+
* https://vike.dev/pageContext#isClientSideNavigation
|
|
99
107
|
*/
|
|
100
108
|
isClientSideNavigation: boolean;
|
|
101
109
|
/**
|
|
102
110
|
* The reason why the original page was aborted. Usually used for showing a custom message on the error page.
|
|
103
111
|
*
|
|
104
112
|
* https://vike.dev/render
|
|
113
|
+
* https://vike.dev/pageContext#abortReason
|
|
105
114
|
*/
|
|
106
115
|
abortReason?: unknown;
|
|
107
116
|
/**
|
|
108
117
|
* The status code set by `throw render(abortStatusCode)`.
|
|
109
118
|
*
|
|
110
119
|
* https://vike.dev/render
|
|
120
|
+
* https://vike.dev/pageContext#abortStatusCode
|
|
111
121
|
*/
|
|
112
122
|
abortStatusCode?: AbortStatusCode;
|
|
113
123
|
/**
|
|
114
124
|
* Error that occured while rendering.
|
|
115
125
|
*
|
|
116
126
|
* https://vike.dev/error-tracking
|
|
127
|
+
* https://vike.dev/pageContext#errorWhileRendering
|
|
117
128
|
*/
|
|
118
129
|
errorWhileRendering?: unknown;
|
|
119
130
|
/**
|
|
@@ -134,14 +145,17 @@ type PageContextBuiltInCommon<Data> = {
|
|
|
134
145
|
* Whether the Base URL is missing in the URL of the HTTP request made to the SSR server.
|
|
135
146
|
*
|
|
136
147
|
* https://vike.dev/base-url#setup
|
|
148
|
+
* https://vike.dev/pageContext#isBaseMissing
|
|
137
149
|
*/
|
|
138
150
|
isBaseMissing?: true;
|
|
139
151
|
};
|
|
140
152
|
type PageContextBuiltInServer<Data> = PageContextBuiltInCommon<Data> & PageContextUrlServer & {
|
|
141
153
|
/**
|
|
142
|
-
* Whether the page is being rendered on the client- or server-side / pre-rendered.
|
|
154
|
+
* Whether the page is being rendered on the client-side or server-side / pre-rendered.
|
|
155
|
+
*
|
|
156
|
+
* We recommend using `import.meta.env.SSR` instead, see https://vike.dev/pageContext#isClientSide
|
|
143
157
|
*
|
|
144
|
-
*
|
|
158
|
+
* https://vike.dev/pageContext#isClientSide
|
|
145
159
|
*/
|
|
146
160
|
isClientSide: false;
|
|
147
161
|
/**
|
|
@@ -150,13 +164,14 @@ type PageContextBuiltInServer<Data> = PageContextBuiltInCommon<Data> & PageConte
|
|
|
150
164
|
* The value is always `false` in development.
|
|
151
165
|
*
|
|
152
166
|
* https://vike.dev/pre-rendering
|
|
153
|
-
* https://vike.dev/pageContext
|
|
167
|
+
* https://vike.dev/pageContext#isPrerendering
|
|
154
168
|
*/
|
|
155
169
|
isPrerendering: boolean;
|
|
156
170
|
/**
|
|
157
171
|
* Runtime information about your app.
|
|
158
172
|
*
|
|
159
173
|
* https://vike.dev/getGlobalContext
|
|
174
|
+
* https://vike.dev/pageContext#globalContext
|
|
160
175
|
*/
|
|
161
176
|
globalContext: GlobalContextServer;
|
|
162
177
|
isHydration?: undefined;
|
|
@@ -170,12 +185,14 @@ type PageContextBuiltInClientWithClientRouting<Data> = Partial<PageContextBuiltI
|
|
|
170
185
|
* Whether the user is navigating back in history.
|
|
171
186
|
*
|
|
172
187
|
* The value is `true` when the user clicks on his browser's backward navigation button, or when invoking `history.back()`.
|
|
188
|
+
*
|
|
189
|
+
* https://vike.dev/pageContext#isBackwardNavigation
|
|
173
190
|
*/
|
|
174
191
|
isBackwardNavigation: boolean | null;
|
|
175
192
|
/**
|
|
176
193
|
* Upon client-side page navigation, you can use `pageContext.previousPageContext` to access the `pageContext` of the previous page.
|
|
177
194
|
*
|
|
178
|
-
* https://vike.dev/pageContext
|
|
195
|
+
* https://vike.dev/pageContext#previousPageContext
|
|
179
196
|
*/
|
|
180
197
|
previousPageContext: PageContextClient<Data> | null;
|
|
181
198
|
globalContext: GlobalContextClient;
|
|
@@ -185,12 +202,16 @@ type PageContextBuiltInClientWithServerRouting<Data> = Partial<PageContextBuiltI
|
|
|
185
202
|
* Whether the current page is already rendered to HTML.
|
|
186
203
|
*
|
|
187
204
|
* The `isHydration` value is always `true` when using Server Routing.
|
|
205
|
+
*
|
|
206
|
+
* https://vike.dev/pageContext#isHydration
|
|
188
207
|
*/
|
|
189
208
|
isHydration: true;
|
|
190
209
|
/**
|
|
191
210
|
* Whether the user is navigating back in history.
|
|
192
211
|
*
|
|
193
212
|
* The `isBackwardNavigation` property only works with Client Routing. (The value is always `null` when using Server Routing.)
|
|
213
|
+
*
|
|
214
|
+
* https://vike.dev/pageContext#isBackwardNavigation
|
|
194
215
|
*/
|
|
195
216
|
isBackwardNavigation: null;
|
|
196
217
|
globalContext: GlobalContextClientWithServerRouting;
|
|
@@ -199,7 +220,9 @@ type PageContextClientCommon = {
|
|
|
199
220
|
/**
|
|
200
221
|
* Whether the page is being rendered on the client-side, or rendered on the server-side / pre-rendered.
|
|
201
222
|
*
|
|
202
|
-
* In order to save client-side KBs, we recommend using `import.meta.env.SSR` whenever possible instead, see https://vike.dev/pageContext
|
|
223
|
+
* In order to save client-side KBs, we recommend using `import.meta.env.SSR` whenever possible instead, see https://vike.dev/pageContext#isClientSide
|
|
224
|
+
*
|
|
225
|
+
* https://vike.dev/pageContext#isClientSide
|
|
203
226
|
*/
|
|
204
227
|
isClientSide: true;
|
|
205
228
|
/**
|
|
@@ -208,7 +231,7 @@ type PageContextClientCommon = {
|
|
|
208
231
|
* The value is always `false` in development.
|
|
209
232
|
*
|
|
210
233
|
* https://vike.dev/pre-rendering
|
|
211
|
-
* https://vike.dev/pageContext
|
|
234
|
+
* https://vike.dev/pageContext#isPrerendering
|
|
212
235
|
*/
|
|
213
236
|
isPrerendering: false;
|
|
214
237
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.228-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.228-commit-1bb55f1";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.228-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.228-commit-1bb55f1';
|
|
@@ -7,6 +7,6 @@ function objectAssign(obj, objAddendum, objAddendumCanBePageContextObject) {
|
|
|
7
7
|
if (!objAddendum)
|
|
8
8
|
return;
|
|
9
9
|
if (!objAddendumCanBePageContextObject)
|
|
10
|
-
assert(!('
|
|
10
|
+
assert(!('isPageContext' in objAddendum));
|
|
11
11
|
Object.defineProperties(obj, Object.getOwnPropertyDescriptors(objAddendum));
|
|
12
12
|
}
|