vike 0.4.239-commit-4d0d950 → 0.4.239-commit-9dcde6d

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.
Files changed (27) hide show
  1. package/dist/esm/client/index.d.ts +1 -1
  2. package/dist/esm/client/index.js +1 -1
  3. package/dist/esm/client/runtime-client-routing/createPageContextClientSide.js +1 -1
  4. package/dist/esm/client/runtime-client-routing/entry.js +3 -6
  5. package/dist/esm/client/runtime-client-routing/getBaseServer.js +0 -1
  6. package/dist/esm/client/runtime-client-routing/{globalContext.js → getGlobalContextClientInternal.js} +2 -4
  7. package/dist/esm/client/runtime-client-routing/getPageContextFromHooks.d.ts +4 -4
  8. package/dist/esm/client/runtime-client-routing/isClientSideRoutable.d.ts +1 -1
  9. package/dist/esm/client/runtime-client-routing/renderPageClientSide.d.ts +1 -1
  10. package/dist/esm/client/runtime-client-routing/renderPageClientSide.js +2 -5
  11. package/dist/esm/client/runtime-server-routing/createPageContextClientSide.js +1 -1
  12. package/dist/esm/client/runtime-server-routing/entry.js +3 -6
  13. package/dist/esm/client/runtime-server-routing/getGlobalContextClientInternal.js +6 -0
  14. package/dist/esm/client/shared/execHookOnRenderClient.d.ts +1 -1
  15. package/dist/esm/client/shared/{createGetGlobalContextClient.d.ts → getGlobalContextClientInternalShared.d.ts} +9 -7
  16. package/dist/esm/client/shared/{createGetGlobalContextClient.js → getGlobalContextClientInternalShared.js} +12 -15
  17. package/dist/esm/client/shared/loadPageConfigsLazyClientSide.js +1 -3
  18. package/dist/esm/node/prerender/runPrerender.js +3 -1
  19. package/dist/esm/shared/createGlobalContextShared.d.ts +1 -1
  20. package/dist/esm/shared/createGlobalContextShared.js +0 -1
  21. package/dist/esm/types/PageContext.d.ts +8 -8
  22. package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
  23. package/dist/esm/utils/PROJECT_VERSION.js +1 -1
  24. package/package.json +1 -1
  25. package/dist/esm/client/runtime-server-routing/globalContext.js +0 -9
  26. /package/dist/esm/client/runtime-client-routing/{globalContext.d.ts → getGlobalContextClientInternal.d.ts} +0 -0
  27. /package/dist/esm/client/runtime-server-routing/{globalContext.d.ts → getGlobalContextClientInternal.d.ts} +0 -0
@@ -1 +1 @@
1
- export { getGlobalContext, getGlobalContext as getGlobalContextAsync, getGlobalContextSync, } from './shared/createGetGlobalContextClient.js';
1
+ export { getGlobalContext, getGlobalContext as getGlobalContextAsync, getGlobalContextSync, } from './shared/getGlobalContextClientInternalShared.js';
@@ -1,4 +1,4 @@
1
1
  import { isBrowser } from '../utils/isBrowser.js';
2
2
  import { assert } from '../utils/assert.js';
3
3
  assert(isBrowser());
4
- export { getGlobalContext, getGlobalContext as getGlobalContextAsync, getGlobalContextSync, } from './shared/createGetGlobalContextClient.js';
4
+ export { getGlobalContext, getGlobalContext as getGlobalContextAsync, getGlobalContextSync, } from './shared/getGlobalContextClientInternalShared.js';
@@ -2,7 +2,7 @@ export { createPageContextClientSide };
2
2
  import { createPageContextObject, createPageContextShared } from '../../shared/createPageContextShared.js';
3
3
  import { getPageContextUrlComputed } from '../../shared/getPageContextUrlComputed.js';
4
4
  import { getBaseServer } from './getBaseServer.js';
5
- import { getGlobalContextClientInternal } from './globalContext.js';
5
+ import { getGlobalContextClientInternal } from './getGlobalContextClientInternal.js';
6
6
  import { assert, updateType, isBaseServer, objectAssign } from './utils.js';
7
7
  async function createPageContextClientSide(urlOriginal) {
8
8
  const globalContext = await getGlobalContextClientInternal();
@@ -3,14 +3,11 @@ assertClientRouting();
3
3
  import { initClientRouter } from './initClientRouter.js';
4
4
  import { assertSingleInstance_onClientEntryClientRouting } from './utils.js';
5
5
  import { removeFoucBuster } from '../shared/removeFoucBuster.js';
6
- import { setVirtualFileExportsGlobalEntry } from '../shared/createGetGlobalContextClient.js';
6
+ import { setVirtualFileExportsGlobalEntry } from '../shared/getGlobalContextClientInternalShared.js';
7
7
  // @ts-expect-error
8
8
  import * as virtualFileExportsGlobalEntry from 'virtual:vike:global-entry:client:client-routing';
9
- // TODO/now: remove this ts-ignore
10
- // @ts-ignore Since dist/cjs/client/ is never used, we can ignore this error.
11
- const isProd = import.meta.env.PROD;
12
- assertSingleInstance_onClientEntryClientRouting(isProd);
13
- setVirtualFileExportsGlobalEntry(virtualFileExportsGlobalEntry, true);
9
+ assertSingleInstance_onClientEntryClientRouting(import.meta.env.PROD);
10
+ setVirtualFileExportsGlobalEntry(virtualFileExportsGlobalEntry);
14
11
  initClientRouter();
15
12
  if (import.meta.env.DEV)
16
13
  removeFoucBuster();
@@ -1,7 +1,6 @@
1
1
  export { getBaseServer };
2
2
  import { assert } from '../runtime-server-routing/utils.js';
3
3
  function getBaseServer() {
4
- // @ts-ignore Since dist/cjs/client/ is never used, we can ignore this error.
5
4
  const baseServer = import.meta.env.BASE_SERVER;
6
5
  assert(isBaseServer(baseServer));
7
6
  return baseServer;
@@ -1,11 +1,9 @@
1
- // TODO/now: rename file
2
- // TODO/now: rename export
3
1
  export { getGlobalContextClientInternal };
4
- import { createGetGlobalContextClient } from '../shared/createGetGlobalContextClient.js';
2
+ import { getGlobalContextClientInternalShared } from '../shared/getGlobalContextClientInternalShared.js';
5
3
  import { loadPageRoutes } from '../../shared/route/loadPageRoutes.js';
6
4
  import { objectAssign } from './utils.js';
7
5
  async function getGlobalContextClientInternal() {
8
- const globalContext = await createGetGlobalContextClient();
6
+ const globalContext = await getGlobalContextClientInternalShared();
9
7
  objectAssign(globalContext, await addGlobalContext(globalContext));
10
8
  return globalContext;
11
9
  }
@@ -145,7 +145,7 @@ declare function getPageContextFromHooks_isHydration(pageContext: PageContextSer
145
145
  isHydration: boolean;
146
146
  isBackwardNavigation: boolean | null;
147
147
  previousPageContext: import("../../types/PageContext.js").PageContextClient<unknown> | null;
148
- globalContext: import("./globalContext.js").GlobalContextClient;
148
+ globalContext: import("./getGlobalContextClientInternal.js").GlobalContextClient;
149
149
  } & {
150
150
  urlOriginal: string;
151
151
  } & {
@@ -210,7 +210,7 @@ declare function getPageContextFromHooks_isHydration(pageContext: PageContextSer
210
210
  isHydration: boolean;
211
211
  isBackwardNavigation: boolean | null;
212
212
  previousPageContext: import("../../types/PageContext.js").PageContextClient<unknown> | null;
213
- globalContext: import("./globalContext.js").GlobalContextClient;
213
+ globalContext: import("./getGlobalContextClientInternal.js").GlobalContextClient;
214
214
  } & {
215
215
  urlOriginal: string;
216
216
  } & {
@@ -366,7 +366,7 @@ declare function getPageContextFromClientHooks(pageContext: {
366
366
  isHydration: boolean;
367
367
  isBackwardNavigation: boolean | null;
368
368
  previousPageContext: import("../../types/PageContext.js").PageContextClient<unknown> | null;
369
- globalContext: import("./globalContext.js").GlobalContextClient;
369
+ globalContext: import("./getGlobalContextClientInternal.js").GlobalContextClient;
370
370
  } & {
371
371
  urlOriginal: string;
372
372
  } & {
@@ -429,7 +429,7 @@ declare function getPageContextFromClientHooks(pageContext: {
429
429
  isHydration: boolean;
430
430
  isBackwardNavigation: boolean | null;
431
431
  previousPageContext: import("../../types/PageContext.js").PageContextClient<unknown> | null;
432
- globalContext: import("./globalContext.js").GlobalContextClient;
432
+ globalContext: import("./getGlobalContextClientInternal.js").GlobalContextClient;
433
433
  } & {
434
434
  urlOriginal: string;
435
435
  } & {
@@ -1,5 +1,5 @@
1
1
  export { isClientSideRoutable };
2
- import type { GlobalContextClientInternal } from './globalContext.js';
2
+ import type { GlobalContextClientInternal } from './getGlobalContextClientInternal.js';
3
3
  import type { PageFile } from '../../shared/getPageFiles.js';
4
4
  declare function isClientSideRoutable(pageId: string, pageContext: {
5
5
  _globalContext: GlobalContextClientInternal;
@@ -156,7 +156,7 @@ declare function getPageContextBegin(isForErrorPage: boolean, { urlOriginal, isB
156
156
  isHydration: boolean;
157
157
  isBackwardNavigation: boolean | null;
158
158
  previousPageContext: PageContextClient<unknown> | null;
159
- globalContext: import("./globalContext.js").GlobalContextClient;
159
+ globalContext: import("./getGlobalContextClientInternal.js").GlobalContextClient;
160
160
  } & {
161
161
  urlOriginal: string;
162
162
  } & {
@@ -511,11 +511,9 @@ function disableClientRouting(err, log) {
511
511
  // We don't use console.error() to avoid flooding error trackers such as Sentry
512
512
  console.log(err);
513
513
  }
514
- // @ts-ignore Since dist/cjs/client/ is never used, we can ignore this error.
515
- const isProd = import.meta.env.PROD;
516
514
  assertInfo(false, [
517
515
  'Failed to fetch static asset.',
518
- isProd ? 'This usually happens when a new frontend is deployed.' : null,
516
+ import.meta.env.PROD ? 'This usually happens when a new frontend is deployed.' : null,
519
517
  'Falling back to Server Routing.',
520
518
  '(The next page navigation will use Server Routing instead of Client Routing.)',
521
519
  ]
@@ -646,8 +644,7 @@ function handleErrorFetchingStaticAssets(err, pageContext, isFirstRender) {
646
644
  }
647
645
  // [HMR] If error page is shown => re-render whole page
648
646
  if (import.meta.env.DEV && import.meta.hot)
649
- // TODO/now use after event
650
- import.meta.hot.on('vite:beforeUpdate', () => {
647
+ import.meta.hot.on('vite:afterUpdate', () => {
651
648
  const pageContext = globalObject.renderedPageContext;
652
649
  if (pageContext?.pageId && isErrorPage(pageContext.pageId, pageContext._globalContext._pageConfigs)) {
653
650
  renderPageClientSide({
@@ -4,7 +4,7 @@ import { getPageContextSerializedInHtml } from '../shared/getJsonSerializedInHtm
4
4
  import { loadPageConfigsLazyClientSide, } from '../shared/loadPageConfigsLazyClientSide.js';
5
5
  import { getCurrentUrl } from '../shared/getCurrentUrl.js';
6
6
  import { createPageContextObject, createPageContextShared } from '../../shared/createPageContextShared.js';
7
- import { getGlobalContextClientInternal } from './globalContext.js';
7
+ import { getGlobalContextClientInternal } from './getGlobalContextClientInternal.js';
8
8
  import { preparePageContextForPublicUsageClient, } from './preparePageContextForPublicUsageClient.js';
9
9
  import { execHook } from '../../shared/hooks/execHook.js';
10
10
  const urlFirst = getCurrentUrl({ withoutHash: true });
@@ -6,14 +6,11 @@ import { assertSingleInstance_onClientEntryServerRouting } from './utils.js';
6
6
  import { removeFoucBuster } from '../shared/removeFoucBuster.js';
7
7
  import { execHook } from '../../shared/hooks/execHook.js';
8
8
  import { preparePageContextForPublicUsageClient } from './preparePageContextForPublicUsageClient.js';
9
- import { setVirtualFileExportsGlobalEntry } from '../shared/createGetGlobalContextClient.js';
9
+ import { setVirtualFileExportsGlobalEntry } from '../shared/getGlobalContextClientInternalShared.js';
10
10
  // @ts-expect-error
11
11
  import * as virtualFileExportsGlobalEntry from 'virtual:vike:global-entry:client:server-routing';
12
- // TODO/now: remove this ts-ignore
13
- // @ts-ignore Since dist/cjs/client/ is never used, we can ignore this error.
14
- const isProd = import.meta.env.PROD;
15
- assertSingleInstance_onClientEntryServerRouting(isProd);
16
- setVirtualFileExportsGlobalEntry(virtualFileExportsGlobalEntry, false);
12
+ assertSingleInstance_onClientEntryServerRouting(import.meta.env.PROD);
13
+ setVirtualFileExportsGlobalEntry(virtualFileExportsGlobalEntry);
17
14
  if (import.meta.env.DEV)
18
15
  removeFoucBuster();
19
16
  hydrate();
@@ -0,0 +1,6 @@
1
+ export { getGlobalContextClientInternal };
2
+ import { getGlobalContextClientInternalShared } from '../shared/getGlobalContextClientInternalShared.js';
3
+ async function getGlobalContextClientInternal() {
4
+ const globalContext = await getGlobalContextClientInternalShared();
5
+ return globalContext;
6
+ }
@@ -2,7 +2,7 @@ export { execHookOnRenderClient };
2
2
  export type { PageContextBeforeRenderClient };
3
3
  import type { PageFile, PageContextConfig } from '../../shared/getPageFiles.js';
4
4
  import type { PageContextForPublicUsageClientShared } from './preparePageContextForPublicUsageClientShared.js';
5
- import type { GlobalContextClientInternalShared } from './createGetGlobalContextClient.js';
5
+ import type { GlobalContextClientInternalShared } from './getGlobalContextClientInternalShared.js';
6
6
  type PageContextBeforeRenderClient = {
7
7
  _pageFilesLoaded: PageFile[];
8
8
  urlOriginal?: string;
@@ -1,11 +1,11 @@
1
1
  export { getGlobalContext };
2
2
  export { getGlobalContextSync };
3
3
  export { setVirtualFileExportsGlobalEntry };
4
- export { createGetGlobalContextClient };
4
+ export { getGlobalContextClientInternalShared };
5
5
  export type GlobalContextClientInternalShared = GlobalContextClientInternal | GlobalContextClientInternalWithServerRouting;
6
- import type { GlobalContextClientInternal } from '../runtime-client-routing/globalContext.js';
7
- import type { GlobalContextClientInternalWithServerRouting } from '../runtime-server-routing/globalContext.js';
8
- declare function createGetGlobalContextClient(): Promise<{
6
+ import type { GlobalContextClientInternal } from '../runtime-client-routing/getGlobalContextClientInternal.js';
7
+ import type { GlobalContextClientInternalWithServerRouting } from '../runtime-server-routing/getGlobalContextClientInternal.js';
8
+ declare function getGlobalContextClientInternalShared(): Promise<{
9
9
  _globalConfigPublic: {
10
10
  pages: {
11
11
  [k: string]: {
@@ -53,13 +53,15 @@ declare function createGetGlobalContextClient(): Promise<{
53
53
  _allPageIds: string[];
54
54
  } & {
55
55
  /**
56
- * Whether the environment is client-side or server-side / pre-rendering.
56
+ * Whether the environment is the client-side:
57
+ * - In the browser, the value is `true`.
58
+ * - Upon SSR and pre-rendering, the value is `false`.
57
59
  *
58
- * We recommend using `import.meta.env.SSR` instead, see https://vike.dev/globalContext
60
+ * https://vike.dev/globalContext#isClientSide
59
61
  */
60
62
  isClientSide: true;
61
63
  }>;
62
64
  type NeverExported = never;
63
65
  declare function getGlobalContext(): Promise<NeverExported>;
64
66
  declare function getGlobalContextSync(): NeverExported;
65
- declare function setVirtualFileExportsGlobalEntry(virtualFileExportsGlobalEntry: unknown, isClientRouting: boolean): Promise<void>;
67
+ declare function setVirtualFileExportsGlobalEntry(virtualFileExportsGlobalEntry: unknown): Promise<void>;
@@ -3,32 +3,32 @@ export { getGlobalContext };
3
3
  export { getGlobalContextSync };
4
4
  export { setVirtualFileExportsGlobalEntry };
5
5
  // Internal usage
6
- // TODO/now rename export
7
- // TODO/now rename file
8
- export { createGetGlobalContextClient };
9
- import { createGlobalContextShared, getGlobalContextSyncErrMsg, } from '../../shared/createGlobalContextShared.js';
6
+ export { getGlobalContextClientInternalShared };
7
+ import { createGlobalContextShared, getGlobalContextSyncErrMsg } from '../../shared/createGlobalContextShared.js';
10
8
  import { getGlobalContextSerializedInHtml } from './getJsonSerializedInHtml.js';
11
9
  import { assert, assertUsage, genPromise, getGlobalObject, objectAssign, checkType } from './utils.js';
12
- const globalObject = getGlobalObject('createGetGlobalContextClient.ts', (() => {
10
+ const globalObject = getGlobalObject('getGlobalContextClientInternalShared.ts', (() => {
13
11
  const { promise: globalContextInitialPromise, resolve: globalContextInitialPromiseResolve } = genPromise();
14
12
  return {
15
13
  globalContextInitialPromise,
16
14
  globalContextInitialPromiseResolve,
17
15
  };
18
16
  })());
19
- async function createGetGlobalContextClient() {
17
+ async function getGlobalContextClientInternalShared() {
18
+ // Get
20
19
  if (globalObject.globalContextPromise) {
21
20
  const globalContext = await globalObject.globalContextPromise;
22
21
  return globalContext;
23
22
  }
24
23
  // Create
25
- const globalContextPromise = createGlobalContextShared(globalObject.virtualFileExportsGlobalEntry, globalObject, undefined, async (globalContext) => {
24
+ const globalContextPromise = createGlobalContextShared(globalObject.virtualFileExportsGlobalEntry, globalObject, () => {
26
25
  const globalContextAddendum = {
27
- // TODO/now update JSDocs
28
26
  /**
29
- * Whether the environment is client-side or server-side / pre-rendering.
27
+ * Whether the environment is the client-side:
28
+ * - In the browser, the value is `true`.
29
+ * - Upon SSR and pre-rendering, the value is `false`.
30
30
  *
31
- * We recommend using `import.meta.env.SSR` instead, see https://vike.dev/globalContext
31
+ * https://vike.dev/globalContext#isClientSide
32
32
  */
33
33
  isClientSide: true,
34
34
  };
@@ -55,15 +55,12 @@ function getGlobalContextSync() {
55
55
  checkType(globalContext);
56
56
  return globalContext;
57
57
  }
58
- async function setVirtualFileExportsGlobalEntry(virtualFileExportsGlobalEntry, isClientRouting) {
59
- // TODO/now: remove unused globalObject.isClientRouting
60
- assert(globalObject.isClientRouting === undefined || globalObject.isClientRouting === isClientRouting);
61
- globalObject.isClientRouting = isClientRouting;
58
+ async function setVirtualFileExportsGlobalEntry(virtualFileExportsGlobalEntry) {
62
59
  // HMR => virtualFileExportsGlobalEntry differ
63
60
  if (globalObject.virtualFileExportsGlobalEntry !== virtualFileExportsGlobalEntry) {
64
61
  delete globalObject.globalContextPromise;
65
62
  globalObject.virtualFileExportsGlobalEntry = virtualFileExportsGlobalEntry;
66
63
  // Eagerly call +onCreateGlobalContext() hooks
67
- await createGetGlobalContextClient();
64
+ await getGlobalContextClientInternalShared();
68
65
  }
69
66
  }
@@ -10,13 +10,11 @@ async function loadPageConfigsLazyClientSide(pageId, pageFilesAll, pageConfigs,
10
10
  const pageFilesClientSide = getPageFilesClientSide(pageFilesAll, pageId);
11
11
  const pageConfig = findPageConfig(pageConfigs, pageId);
12
12
  let pageConfigLoaded;
13
- // @ts-ignore Since dist/cjs/client/ is never used, we can ignore this error.
14
- const isDev = import.meta.env.DEV;
15
13
  try {
16
14
  // prettier-ignore
17
15
  // biome-ignore format:
18
16
  const result = await Promise.all([
19
- pageConfig && loadAndParseVirtualFilePageEntry(pageConfig, isDev),
17
+ pageConfig && loadAndParseVirtualFilePageEntry(pageConfig, import.meta.env.DEV),
20
18
  ...pageFilesClientSide.map((p) => p.loadFile?.()),
21
19
  ]);
22
20
  pageConfigLoaded = result[0];
@@ -715,12 +715,14 @@ async function prerenderRedirects(globalContext, onComplete, showWarningUponDyna
715
715
  }
716
716
  function getRedirectHtml(urlTarget) {
717
717
  const urlTargetSafe = escapeHtml(urlTarget);
718
- // To test it: /test/playground => http://localhost:3000/download
718
+ // - Test: /test/playground => http://localhost:3000/download
719
+ // - Adding `<link rel="canonical">` for SEO, see https://github.com/vikejs/vike/pull/2711
719
720
  const htmlString = `<!DOCTYPE html>
720
721
  <html lang="en">
721
722
  <head>
722
723
  <meta charset="UTF-8">
723
724
  <meta http-equiv="refresh" content="0;url=${urlTargetSafe}">
725
+ <link rel="canonical" href="${urlTargetSafe}" />
724
726
  <title>Redirect ${urlTargetSafe}</title>
725
727
  <style>body{opacity:0}</style>
726
728
  <noscript>
@@ -6,7 +6,7 @@ export type GlobalContextInternal = GlobalContextServerInternal | GlobalContextC
6
6
  import type { PageFile } from './getPageFiles.js';
7
7
  import type { PageConfigRuntime } from '../types/PageConfig.js';
8
8
  import type { GlobalContextServerInternal } from '../node/runtime/globalContext.js';
9
- import type { GlobalContextClientInternal } from '../client/runtime-client-routing/globalContext.js';
9
+ import type { GlobalContextClientInternal } from '../client/runtime-client-routing/getGlobalContextClientInternal.js';
10
10
  import { type Hook } from './hooks/getHook.js';
11
11
  declare const getGlobalContextSyncErrMsg = "The global context isn't set yet, call getGlobalContextSync() later or use getGlobalContext() instead.";
12
12
  declare function createGlobalContextShared<GlobalContextAdded extends {}, GlobalContextAddedAsync extends {}>(virtualFileExportsGlobalEntry: unknown, globalObject: {
@@ -9,7 +9,6 @@ import { getHookFromPageConfigGlobalCumulative } from './hooks/getHook.js';
9
9
  const getGlobalContextSyncErrMsg = "The global context isn't set yet, call getGlobalContextSync() later or use getGlobalContext() instead.";
10
10
  // TO-DO/eventually use flat globalContext — like flat pageContext
11
11
  async function createGlobalContextShared(virtualFileExportsGlobalEntry, globalObject, addGlobalContext,
12
- // TODO/now can we remove it now?
13
12
  // TO-DO/next-major-release: we'll be able to remove addGlobalContextTmp after loadPageRoutes() is sync (it will be sync after we remove the old design)
14
13
  addGlobalContextTmp, addGlobalContextAsync) {
15
14
  const { previousCreateGlobalContextPromise } = globalObject;
@@ -19,8 +19,8 @@ import type { From, PageContextConfig, Source, Sources } from '../shared/page-co
19
19
  import type { Config } from './Config.js';
20
20
  import type { AbortStatusCode } from '../shared/route/abort.js';
21
21
  import type { GlobalContextServer } from '../node/runtime/globalContext.js';
22
- import type { GlobalContextClient } from '../client/runtime-client-routing/globalContext.js';
23
- import type { GlobalContextClientWithServerRouting } from '../client/runtime-server-routing/globalContext.js';
22
+ import type { GlobalContextClient } from '../client/runtime-client-routing/getGlobalContextClientInternal.js';
23
+ import type { GlobalContextClientWithServerRouting } from '../client/runtime-server-routing/getGlobalContextClientInternal.js';
24
24
  type PageContextServer<Data = unknown> = PageContextBuiltInServer<Data> & Vike.PageContext & Vike.PageContextServer;
25
25
  type PageContext<Data = unknown> = PageContextClient<Data> | PageContextServer<Data>;
26
26
  type PageContextClient<Data = unknown> = PageContextBuiltInClientWithClientRouting<Data> & Vike.PageContext & Vike.PageContextClient;
@@ -137,9 +137,9 @@ type PageContextBuiltInCommon<Data> = PageContextConfig & {
137
137
  };
138
138
  type PageContextBuiltInServer<Data> = PageContextBuiltInCommon<Data> & PageContextUrlServer & {
139
139
  /**
140
- * Whether the page is being rendered on the client-side or server-side / pre-rendered.
141
- *
142
- * We recommend using `import.meta.env.SSR` instead, see https://vike.dev/pageContext#isClientSide
140
+ * Whether the environment is the client-side:
141
+ * - In the browser, the value is `true`.
142
+ * - Upon SSR and pre-rendering, the value is `false`.
143
143
  *
144
144
  * https://vike.dev/pageContext#isClientSide
145
145
  */
@@ -210,9 +210,9 @@ type PageContextBuiltInClientWithServerRouting<Data> = Partial<PageContextBuiltI
210
210
  };
211
211
  type PageContextClientCommon = {
212
212
  /**
213
- * Whether the page is being rendered on the client-side, or rendered on the server-side / pre-rendered.
214
- *
215
- * In order to save client-side KBs, we recommend using `import.meta.env.SSR` whenever possible instead, see https://vike.dev/pageContext#isClientSide
213
+ * Whether the environment is the client-side:
214
+ * - In the browser, the value is `true`.
215
+ * - Upon SSR and pre-rendering, the value is `false`.
216
216
  *
217
217
  * https://vike.dev/pageContext#isClientSide
218
218
  */
@@ -1 +1 @@
1
- export declare const PROJECT_VERSION: "0.4.239-commit-4d0d950";
1
+ export declare const PROJECT_VERSION: "0.4.239-commit-9dcde6d";
@@ -1,2 +1,2 @@
1
1
  // Automatically updated by @brillout/release-me
2
- export const PROJECT_VERSION = '0.4.239-commit-4d0d950';
2
+ export const PROJECT_VERSION = '0.4.239-commit-9dcde6d';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.239-commit-4d0d950",
3
+ "version": "0.4.239-commit-9dcde6d",
4
4
  "repository": "https://github.com/vikejs/vike",
5
5
  "exports": {
6
6
  "./server": {
@@ -1,9 +0,0 @@
1
- // TODO/now: rename file
2
- // TODO/now: rename export
3
- export { getGlobalContextClientInternal };
4
- import { createGetGlobalContextClient } from '../shared/createGetGlobalContextClient.js';
5
- // TODO/now: remove this useless function and re-export instead?
6
- async function getGlobalContextClientInternal() {
7
- const globalContext = await createGetGlobalContextClient();
8
- return globalContext;
9
- }