vike 0.4.203-commit-d47722f → 0.4.203-commit-1b14559

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.203-commit-d47722f';
5
+ exports.PROJECT_VERSION = '0.4.203-commit-1b14559';
@@ -1,7 +1,7 @@
1
1
  export { pushHistoryState };
2
2
  export { onPopStateBegin };
3
3
  export { saveScrollPosition };
4
- export { enhanceHistoryState };
4
+ export { initHistoryState };
5
5
  export { monkeyPatchHistoryAPI };
6
6
  export type { HistoryInfo };
7
7
  export type { ScrollPosition };
@@ -15,7 +15,6 @@ type ScrollPosition = {
15
15
  x: number;
16
16
  y: number;
17
17
  };
18
- declare function enhanceHistoryState(): void;
19
18
  declare function saveScrollPosition(): void;
20
19
  declare function pushHistoryState(url: string, overwriteLastHistoryEntry: boolean): void;
21
20
  declare function monkeyPatchHistoryAPI(): void;
@@ -28,3 +27,4 @@ declare function onPopStateBegin(): {
28
27
  previous: HistoryInfo;
29
28
  current: HistoryInfo;
30
29
  };
30
+ declare function initHistoryState(): void;
@@ -1,9 +1,10 @@
1
1
  export { pushHistoryState };
2
2
  export { onPopStateBegin };
3
3
  export { saveScrollPosition };
4
- export { enhanceHistoryState };
4
+ export { initHistoryState };
5
5
  export { monkeyPatchHistoryAPI };
6
6
  import { assert, assertUsage, getCurrentUrl, getGlobalObject, hasProp, isObject } from './utils.js';
7
+ initHistoryState(); // we redundantly call initHistoryState() to ensure it's called early
7
8
  const globalObject = getGlobalObject('history.ts', { previous: getHistoryInfo() });
8
9
  // `window.history.state === null` when:
9
10
  // - The very first render
@@ -145,3 +146,6 @@ function onPopStateBegin() {
145
146
  globalObject.previous = current;
146
147
  return { isNewState, previous, current };
147
148
  }
149
+ function initHistoryState() {
150
+ enhanceHistoryState();
151
+ }
@@ -6,7 +6,7 @@ import { initOnLinkClick } from './initOnLinkClick.js';
6
6
  import { setupNativeScrollRestoration } from './scrollRestoration.js';
7
7
  import { autoSaveScrollPosition } from './setScrollPosition.js';
8
8
  import { initLinkPrefetchHandlers } from './prefetch.js';
9
- import { enhanceHistoryState, monkeyPatchHistoryAPI } from './history.js';
9
+ import { initHistoryState, monkeyPatchHistoryAPI } from './history.js';
10
10
  async function initClientRouter() {
11
11
  // Init navigation history and scroll restoration
12
12
  initHistoryAndScroll();
@@ -29,7 +29,7 @@ async function renderFirstPage() {
29
29
  }
30
30
  function initHistoryAndScroll() {
31
31
  monkeyPatchHistoryAPI();
32
- enhanceHistoryState();
32
+ initHistoryState(); // we redundantly call initHistoryState() to ensure it's called early
33
33
  setupNativeScrollRestoration();
34
34
  autoSaveScrollPosition();
35
35
  // Handle back-/forward navigation
@@ -1 +1 @@
1
- export declare const PROJECT_VERSION: "0.4.203-commit-d47722f";
1
+ export declare const PROJECT_VERSION: "0.4.203-commit-1b14559";
@@ -1,2 +1,2 @@
1
1
  // Automatically updated by @brillout/release-me
2
- export const PROJECT_VERSION = '0.4.203-commit-d47722f';
2
+ export const PROJECT_VERSION = '0.4.203-commit-1b14559';
@@ -1,4 +1,4 @@
1
1
  export declare const projectInfo: {
2
2
  projectName: "Vike";
3
- projectVersion: "0.4.203-commit-d47722f";
3
+ projectVersion: "0.4.203-commit-1b14559";
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.203-commit-d47722f",
3
+ "version": "0.4.203-commit-1b14559",
4
4
  "repository": "https://github.com/vikejs/vike",
5
5
  "exports": {
6
6
  "./server": {