vike 0.4.208-commit-8d0a7ba → 0.4.209-commit-5e317ec

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.
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PROJECT_VERSION = void 0;
4
4
  // Automatically updated by @brillout/release-me
5
- exports.PROJECT_VERSION = '0.4.208-commit-8d0a7ba';
5
+ exports.PROJECT_VERSION = '0.4.209-commit-5e317ec';
@@ -23,6 +23,7 @@ import { getCurrentUrl } from '../shared/getCurrentUrl.js';
23
23
  const globalObject = getGlobalObject('renderPageClientSide.ts', (() => {
24
24
  const { promise: firstRenderStartPromise, resolve: firstRenderStartPromiseResolve } = genPromise();
25
25
  return {
26
+ previousPageContext: null,
26
27
  renderCounter: 0,
27
28
  firstRenderStartPromise,
28
29
  firstRenderStartPromiseResolve
@@ -218,10 +219,20 @@ async function renderPageClientSide(renderArgs) {
218
219
  isBackwardNavigation,
219
220
  isClientSideNavigation,
220
221
  isHydration: isFirstRender && !isForErrorPage,
221
- // Make it public as `pageContext.previous`? Maybe after https://github.com/vikejs/vike/issues/1268
222
- _previousPageContext: previousPageContext,
222
+ previousPageContext,
223
223
  ...pageContextInitClient
224
224
  });
225
+ // TODO/next-major-release: remove
226
+ Object.defineProperty(pageContext, '_previousPageContext', {
227
+ get() {
228
+ assertWarning(false, 'pageContext._previousPageContext has been renamed pageContext.previousPageContext', {
229
+ showStackTrace: true,
230
+ onlyOnce: true
231
+ });
232
+ return previousPageContext;
233
+ },
234
+ enumerable: false
235
+ });
225
236
  {
226
237
  const pageContextFromAllRewrites = getPageContextFromAllRewrites(pageContextsFromRewrite);
227
238
  assert(!('urlOriginal' in pageContextFromAllRewrites));
@@ -133,6 +133,12 @@ type PageContextBuiltInClientWithClientRouting<Data> = Partial<PageContextBuiltI
133
133
  * The value is `true` when the user clicks on his browser's backward navigation button, or when invoking `history.back()`.
134
134
  */
135
135
  isBackwardNavigation: boolean | null;
136
+ /**
137
+ * Upon client-side page navigation, you can use `pageContext.previousPageContext` to access the `pageContext` of the previous page.
138
+ *
139
+ * https://vike.dev/pageContext
140
+ */
141
+ previousPageContext: PageContextClient<Data> | null;
136
142
  } & PageContextUrlClient;
137
143
  type PageContextBuiltInClientWithServerRouting<Data> = Partial<PageContextBuiltInCommon<Data>> & Pick<PageContextBuiltInCommon<Data>, 'Page' | 'pageExports' | 'exports' | 'abortReason' | 'pageId' | 'data'> & {
138
144
  /**
@@ -1 +1 @@
1
- export declare const PROJECT_VERSION: "0.4.208-commit-8d0a7ba";
1
+ export declare const PROJECT_VERSION: "0.4.209-commit-5e317ec";
@@ -1,2 +1,2 @@
1
1
  // Automatically updated by @brillout/release-me
2
- export const PROJECT_VERSION = '0.4.208-commit-8d0a7ba';
2
+ export const PROJECT_VERSION = '0.4.209-commit-5e317ec';
@@ -1,4 +1,4 @@
1
1
  export declare const projectInfo: {
2
2
  projectName: "Vike";
3
- projectVersion: "0.4.208-commit-8d0a7ba";
3
+ projectVersion: "0.4.209-commit-5e317ec";
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.208-commit-8d0a7ba",
3
+ "version": "0.4.209-commit-5e317ec",
4
4
  "repository": "https://github.com/vikejs/vike",
5
5
  "exports": {
6
6
  "./server": {
@@ -125,7 +125,7 @@
125
125
  "@brillout/json-serializer": "^0.5.15",
126
126
  "@brillout/picocolors": "^1.0.15",
127
127
  "@brillout/require-shim": "^0.1.2",
128
- "@brillout/vite-plugin-server-entry": "^0.5.5",
128
+ "@brillout/vite-plugin-server-entry": "^0.5.6",
129
129
  "acorn": "^8.0.0",
130
130
  "cac": "^6.0.0",
131
131
  "es-module-lexer": "^1.0.0",