vike 0.4.249-commit-55681da → 0.4.249-commit-f416149
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/client/runtime-client-routing/history.d.ts +1 -1
- package/dist/client/runtime-client-routing/history.js +4 -11
- package/dist/client/runtime-client-routing/utils.d.ts +0 -1
- package/dist/client/runtime-client-routing/utils.js +0 -1
- package/dist/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/utils/PROJECT_VERSION.js +1 -1
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ type ScrollPosition = {
|
|
|
18
18
|
};
|
|
19
19
|
declare function saveScrollPosition(): void;
|
|
20
20
|
declare function pushHistoryState(url: string, overwriteLastHistoryEntry: boolean): void;
|
|
21
|
-
declare function replaceHistoryStateOriginal(state: unknown, url
|
|
21
|
+
declare function replaceHistoryStateOriginal(state: unknown, url?: Parameters<typeof window.history.replaceState>[2]): void;
|
|
22
22
|
type HistoryInfo = {
|
|
23
23
|
url: `/${string}`;
|
|
24
24
|
state: StateEnhanced;
|
|
@@ -4,7 +4,7 @@ export { onPopStateBegin };
|
|
|
4
4
|
export { saveScrollPosition };
|
|
5
5
|
export { initHistory };
|
|
6
6
|
import { getCurrentUrl } from '../shared/getCurrentUrl.js';
|
|
7
|
-
import { assert, assertUsage, getGlobalObject, isObject,
|
|
7
|
+
import { assert, assertUsage, getGlobalObject, isObject, redirectHard } from './utils.js';
|
|
8
8
|
const globalObject = getGlobalObject('history.ts', {
|
|
9
9
|
monkeyPatched: false,
|
|
10
10
|
previous: undefined,
|
|
@@ -102,26 +102,19 @@ function monkeyPatchHistoryAPI() {
|
|
|
102
102
|
triggeredBy: 'user',
|
|
103
103
|
},
|
|
104
104
|
};
|
|
105
|
-
assertIsEnhanced(state);
|
|
106
105
|
funcOriginal(state, ...rest);
|
|
107
|
-
|
|
108
|
-
assert(isEqual(state, window.history.state));
|
|
106
|
+
assertIsEnhanced(window.history.state);
|
|
109
107
|
globalObject.previous = getHistoryInfo();
|
|
110
108
|
// Workaround https://github.com/vikejs/vike/issues/2504#issuecomment-3149764736
|
|
111
109
|
queueMicrotask(() => {
|
|
112
|
-
if (
|
|
110
|
+
if (isEnhanced(window.history.state))
|
|
113
111
|
return;
|
|
114
112
|
Object.assign(state, window.history.state);
|
|
115
|
-
|
|
116
|
-
replaceHistoryStateOriginal(state, rest[1]);
|
|
117
|
-
assert(isEqual(state, window.history.state));
|
|
113
|
+
replaceHistoryStateOriginal(state);
|
|
118
114
|
});
|
|
119
115
|
};
|
|
120
116
|
});
|
|
121
117
|
}
|
|
122
|
-
function isEqual(state1, state2) {
|
|
123
|
-
return deepEqual(state1?.vike, state2?.vike);
|
|
124
|
-
}
|
|
125
118
|
function isEnhanced(state) {
|
|
126
119
|
if (state?.vike) {
|
|
127
120
|
/* We don't use the assert() below to save client-side KBs.
|
|
@@ -21,5 +21,4 @@ export * from '../../utils/PROJECT_VERSION.js';
|
|
|
21
21
|
export * from '../../utils/genPromise.js';
|
|
22
22
|
export * from '../../utils/catchInfiniteLoop.js';
|
|
23
23
|
export * from '../../utils/changeEnumerable.js';
|
|
24
|
-
export * from '../../utils/deepEqual.js';
|
|
25
24
|
export * from '../../utils/cast.js';
|
|
@@ -25,5 +25,4 @@ export * from '../../utils/PROJECT_VERSION.js';
|
|
|
25
25
|
export * from '../../utils/genPromise.js';
|
|
26
26
|
export * from '../../utils/catchInfiniteLoop.js';
|
|
27
27
|
export * from '../../utils/changeEnumerable.js';
|
|
28
|
-
export * from '../../utils/deepEqual.js';
|
|
29
28
|
export * from '../../utils/cast.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.249-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.249-commit-f416149";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.249-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.249-commit-f416149';
|