vike-lite-react 1.0.11 → 1.0.12
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.
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { t as PageContextProvider } from "../../PageContextProvider-DfE3nMiU.mjs";
|
|
2
2
|
import { Component, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
4
|
-
import { matchRoute } from "vike-lite/__internal/shared";
|
|
4
|
+
import { BASE_URL, matchRoute, stripBase } from "vike-lite/__internal/shared";
|
|
5
5
|
import { createLinkClickHandler, createLinkPrefetchHandler, finalizeNavigation } from "vike-lite/__internal/client";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
//#region src/__internal/shared/stripBase.ts
|
|
8
|
-
function stripBase(pathname) {
|
|
9
|
-
const { BASE_URL } = import.meta.env;
|
|
10
|
-
if (BASE_URL === "/" || !pathname.startsWith(BASE_URL)) return pathname;
|
|
11
|
-
const stripped = pathname.slice(BASE_URL.length);
|
|
12
|
-
return stripped.startsWith("/") ? stripped : "/" + stripped;
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
15
7
|
//#region src/__internal/client/onRenderClient.tsx
|
|
16
8
|
var RootErrorBoundary = class extends Component {
|
|
17
9
|
static getDerivedStateFromError(error) {
|
|
@@ -140,9 +132,7 @@ function RouterApp(props) {
|
|
|
140
132
|
const { route, routeParams } = matched;
|
|
141
133
|
try {
|
|
142
134
|
const urlObj = new URL(urlFull);
|
|
143
|
-
const
|
|
144
|
-
const { BASE_URL } = import.meta.env;
|
|
145
|
-
const jsonUrl = `${BASE_URL.endsWith("/") ? BASE_URL.slice(0, -1) : BASE_URL}${jsonTarget}.pageContext.json${urlObj.search}`;
|
|
135
|
+
const jsonUrl = `${BASE_URL}${pathname === "/" ? "/index" : pathname}.pageContext.json${urlObj.search}`;
|
|
146
136
|
let ctx = null;
|
|
147
137
|
if (route.data || route.title) {
|
|
148
138
|
const res = await fetch(jsonUrl, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike-lite-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react": "^19.2.7",
|
|
64
64
|
"react-dom": "^19.2.7",
|
|
65
65
|
"tsdown": "^0.22.9",
|
|
66
|
-
"vike-lite": "1.15.
|
|
66
|
+
"vike-lite": "1.15.9",
|
|
67
67
|
"vite": "^8.1.5"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|