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.
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/client/client-routing-runtime/history.d.ts +2 -2
- package/dist/esm/client/client-routing-runtime/history.js +5 -1
- package/dist/esm/client/client-routing-runtime/initClientRouter.js +2 -2
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/projectInfo.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { pushHistoryState };
|
|
2
2
|
export { onPopStateBegin };
|
|
3
3
|
export { saveScrollPosition };
|
|
4
|
-
export {
|
|
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 {
|
|
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 {
|
|
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
|
-
|
|
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-
|
|
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-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.203-commit-1b14559';
|