react-router 7.8.0 → 7.8.1-pre.0
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/CHANGELOG.md +12 -0
- package/dist/development/{chunk-VC6RBZTR.js → chunk-3JLHOGU7.js} +130 -130
- package/dist/development/{chunk-EVX7OBGB.js → chunk-CXAO7FY7.js} +70 -47
- package/dist/{production/chunk-XPGU3ZMH.mjs → development/chunk-V2P3SFSY.mjs} +147 -33
- package/dist/development/{chunk-ZYFC6VSF.mjs → chunk-WKLBIS42.mjs} +34 -11
- package/dist/development/dom-export.js +3 -3
- package/dist/development/dom-export.mjs +3 -3
- package/dist/{production/index-react-server-client-DXb0OgpJ.d.mts → development/index-react-server-client-11fLy3qB.d.mts} +1 -1
- package/dist/development/{index-react-server-client-CMphySRb.d.ts → index-react-server-client-BQ6FxdA_.d.ts} +1 -1
- package/dist/development/index-react-server-client.d.mts +2 -2
- package/dist/development/index-react-server-client.d.ts +2 -2
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.d.mts +38 -1
- package/dist/development/index-react-server.d.ts +38 -1
- package/dist/development/index-react-server.js +28 -9
- package/dist/development/index-react-server.mjs +28 -10
- package/dist/development/index.d.mts +42 -4
- package/dist/development/index.d.ts +42 -4
- package/dist/development/index.js +242 -128
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.d.mts +6 -3
- package/dist/development/lib/types/internal.d.ts +6 -3
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{route-data-CpB5xtMm.d.mts → route-data-CNjObrhZ.d.mts} +1 -1
- package/dist/development/{routeModules-qBivMBjd.d.ts → routeModules-C3oqzPpI.d.ts} +1 -1
- package/dist/production/{chunk-O6DRQPUD.js → chunk-6K5ETUFZ.js} +130 -130
- package/dist/production/{chunk-SIHON65V.mjs → chunk-GIJZ6O2U.mjs} +34 -11
- package/dist/production/{chunk-BOD6JCOU.js → chunk-ZFXTWIWH.js} +70 -47
- package/dist/{development/chunk-HZX6U7MI.mjs → production/chunk-ZKLGVTLT.mjs} +147 -33
- package/dist/production/dom-export.js +3 -3
- package/dist/production/dom-export.mjs +3 -3
- package/dist/{development/index-react-server-client-DXb0OgpJ.d.mts → production/index-react-server-client-11fLy3qB.d.mts} +1 -1
- package/dist/production/{index-react-server-client-CMphySRb.d.ts → index-react-server-client-BQ6FxdA_.d.ts} +1 -1
- package/dist/production/index-react-server-client.d.mts +2 -2
- package/dist/production/index-react-server-client.d.ts +2 -2
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.d.mts +38 -1
- package/dist/production/index-react-server.d.ts +38 -1
- package/dist/production/index-react-server.js +28 -9
- package/dist/production/index-react-server.mjs +28 -10
- package/dist/production/index.d.mts +42 -4
- package/dist/production/index.d.ts +42 -4
- package/dist/production/index.js +242 -128
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.d.mts +6 -3
- package/dist/production/lib/types/internal.d.ts +6 -3
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{route-data-CpB5xtMm.d.mts → route-data-CNjObrhZ.d.mts} +1 -1
- package/dist/production/{routeModules-qBivMBjd.d.ts → routeModules-C3oqzPpI.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.8.0
|
|
2
|
+
* react-router v7.8.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
redirect,
|
|
47
47
|
redirectDocument,
|
|
48
48
|
replace,
|
|
49
|
+
setIsHydrated,
|
|
49
50
|
shouldHydrateRouteLoader,
|
|
50
51
|
singleFetchUrl,
|
|
51
52
|
stripBasename,
|
|
@@ -57,7 +58,7 @@ import {
|
|
|
57
58
|
withComponentProps,
|
|
58
59
|
withErrorBoundaryProps,
|
|
59
60
|
withHydrateFallbackProps
|
|
60
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-GIJZ6O2U.mjs";
|
|
61
62
|
|
|
62
63
|
// lib/dom/ssr/server.tsx
|
|
63
64
|
import * as React from "react";
|
|
@@ -1122,6 +1123,28 @@ var createRequestHandler = (build, mode) => {
|
|
|
1122
1123
|
let isSpaMode = getBuildTimeHeader(request, "X-React-Router-SPA-Mode") === "yes";
|
|
1123
1124
|
if (!_build.ssr) {
|
|
1124
1125
|
let decodedPath = decodeURI(normalizedPath);
|
|
1126
|
+
if (normalizedBasename !== "/") {
|
|
1127
|
+
let strippedPath = stripBasename(decodedPath, normalizedBasename);
|
|
1128
|
+
if (strippedPath == null) {
|
|
1129
|
+
errorHandler(
|
|
1130
|
+
new ErrorResponseImpl(
|
|
1131
|
+
404,
|
|
1132
|
+
"Not Found",
|
|
1133
|
+
`Refusing to prerender the \`${decodedPath}\` path because it does not start with the basename \`${normalizedBasename}\``
|
|
1134
|
+
),
|
|
1135
|
+
{
|
|
1136
|
+
context: loadContext,
|
|
1137
|
+
params,
|
|
1138
|
+
request
|
|
1139
|
+
}
|
|
1140
|
+
);
|
|
1141
|
+
return new Response("Not Found", {
|
|
1142
|
+
status: 404,
|
|
1143
|
+
statusText: "Not Found"
|
|
1144
|
+
});
|
|
1145
|
+
}
|
|
1146
|
+
decodedPath = strippedPath;
|
|
1147
|
+
}
|
|
1125
1148
|
if (_build.prerender.length === 0) {
|
|
1126
1149
|
isSpaMode = true;
|
|
1127
1150
|
} else if (!_build.prerender.includes(decodedPath) && !_build.prerender.includes(decodedPath + "/")) {
|
|
@@ -1834,6 +1857,26 @@ function RSCDefaultRootErrorBoundary({
|
|
|
1834
1857
|
);
|
|
1835
1858
|
}
|
|
1836
1859
|
|
|
1860
|
+
// lib/rsc/route-modules.ts
|
|
1861
|
+
function createRSCRouteModules(payload) {
|
|
1862
|
+
const routeModules = {};
|
|
1863
|
+
for (const match of payload.matches) {
|
|
1864
|
+
populateRSCRouteModules(routeModules, match);
|
|
1865
|
+
}
|
|
1866
|
+
return routeModules;
|
|
1867
|
+
}
|
|
1868
|
+
function populateRSCRouteModules(routeModules, matches) {
|
|
1869
|
+
matches = Array.isArray(matches) ? matches : [matches];
|
|
1870
|
+
for (const match of matches) {
|
|
1871
|
+
routeModules[match.id] = {
|
|
1872
|
+
links: match.links,
|
|
1873
|
+
meta: match.meta,
|
|
1874
|
+
default: noopComponent
|
|
1875
|
+
};
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
var noopComponent = () => null;
|
|
1879
|
+
|
|
1837
1880
|
// lib/rsc/browser.tsx
|
|
1838
1881
|
function createCallServer({
|
|
1839
1882
|
createFromReadableStream,
|
|
@@ -1867,7 +1910,7 @@ function createCallServer({
|
|
|
1867
1910
|
window.location.href = payload.location;
|
|
1868
1911
|
return;
|
|
1869
1912
|
}
|
|
1870
|
-
globalVar.
|
|
1913
|
+
globalVar.__reactRouterDataRouter.navigate(payload.location, {
|
|
1871
1914
|
replace: payload.replace
|
|
1872
1915
|
});
|
|
1873
1916
|
return payload.actionResult;
|
|
@@ -1888,34 +1931,38 @@ function createCallServer({
|
|
|
1888
1931
|
window.location.href = rerender.location;
|
|
1889
1932
|
return;
|
|
1890
1933
|
}
|
|
1891
|
-
globalVar.
|
|
1934
|
+
globalVar.__reactRouterDataRouter.navigate(rerender.location, {
|
|
1892
1935
|
replace: rerender.replace
|
|
1893
1936
|
});
|
|
1894
1937
|
return;
|
|
1895
1938
|
}
|
|
1896
1939
|
let lastMatch;
|
|
1897
1940
|
for (const match of rerender.matches) {
|
|
1898
|
-
globalVar.
|
|
1941
|
+
globalVar.__reactRouterDataRouter.patchRoutes(
|
|
1899
1942
|
lastMatch?.id ?? null,
|
|
1900
1943
|
[createRouteFromServerManifest(match)],
|
|
1901
1944
|
true
|
|
1902
1945
|
);
|
|
1903
1946
|
lastMatch = match;
|
|
1904
1947
|
}
|
|
1905
|
-
window.
|
|
1948
|
+
window.__reactRouterDataRouter._internalSetStateDoNotUseOrYouWillBreakYourApp(
|
|
1949
|
+
{}
|
|
1950
|
+
);
|
|
1906
1951
|
React4.startTransition(() => {
|
|
1907
|
-
window.
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1952
|
+
window.__reactRouterDataRouter._internalSetStateDoNotUseOrYouWillBreakYourApp(
|
|
1953
|
+
{
|
|
1954
|
+
loaderData: Object.assign(
|
|
1955
|
+
{},
|
|
1956
|
+
globalVar.__reactRouterDataRouter.state.loaderData,
|
|
1957
|
+
rerender.loaderData
|
|
1958
|
+
),
|
|
1959
|
+
errors: rerender.errors ? Object.assign(
|
|
1960
|
+
{},
|
|
1961
|
+
globalVar.__reactRouterDataRouter.state.errors,
|
|
1962
|
+
rerender.errors
|
|
1963
|
+
) : null
|
|
1964
|
+
}
|
|
1965
|
+
);
|
|
1919
1966
|
});
|
|
1920
1967
|
}
|
|
1921
1968
|
}
|
|
@@ -1931,8 +1978,14 @@ function createRouterFromPayload({
|
|
|
1931
1978
|
payload
|
|
1932
1979
|
}) {
|
|
1933
1980
|
const globalVar = window;
|
|
1934
|
-
if (globalVar.
|
|
1981
|
+
if (globalVar.__reactRouterDataRouter && globalVar.__reactRouterRouteModules)
|
|
1982
|
+
return {
|
|
1983
|
+
router: globalVar.__reactRouterDataRouter,
|
|
1984
|
+
routeModules: globalVar.__reactRouterRouteModules
|
|
1985
|
+
};
|
|
1935
1986
|
if (payload.type !== "render") throw new Error("Invalid payload type");
|
|
1987
|
+
globalVar.__reactRouterRouteModules = globalVar.__reactRouterRouteModules ?? {};
|
|
1988
|
+
populateRSCRouteModules(globalVar.__reactRouterRouteModules, payload.matches);
|
|
1936
1989
|
let patches = /* @__PURE__ */ new Map();
|
|
1937
1990
|
payload.patches?.forEach((patch) => {
|
|
1938
1991
|
invariant(patch.parentId, "Invalid patch parentId");
|
|
@@ -1957,7 +2010,7 @@ function createRouterFromPayload({
|
|
|
1957
2010
|
}
|
|
1958
2011
|
return [route];
|
|
1959
2012
|
}, []);
|
|
1960
|
-
globalVar.
|
|
2013
|
+
globalVar.__reactRouterDataRouter = createRouter({
|
|
1961
2014
|
routes,
|
|
1962
2015
|
unstable_getContext,
|
|
1963
2016
|
basename: payload.basename,
|
|
@@ -1995,26 +2048,79 @@ function createRouterFromPayload({
|
|
|
1995
2048
|
},
|
|
1996
2049
|
// FIXME: Pass `build.ssr` into this function
|
|
1997
2050
|
dataStrategy: getRSCSingleFetchDataStrategy(
|
|
1998
|
-
() => globalVar.
|
|
2051
|
+
() => globalVar.__reactRouterDataRouter,
|
|
1999
2052
|
true,
|
|
2000
2053
|
payload.basename,
|
|
2001
2054
|
createFromReadableStream,
|
|
2002
2055
|
fetchImplementation
|
|
2003
2056
|
)
|
|
2004
2057
|
});
|
|
2005
|
-
if (globalVar.
|
|
2058
|
+
if (globalVar.__reactRouterDataRouter.state.initialized) {
|
|
2006
2059
|
globalVar.__routerInitialized = true;
|
|
2007
|
-
globalVar.
|
|
2060
|
+
globalVar.__reactRouterDataRouter.initialize();
|
|
2008
2061
|
} else {
|
|
2009
2062
|
globalVar.__routerInitialized = false;
|
|
2010
2063
|
}
|
|
2011
2064
|
let lastLoaderData = void 0;
|
|
2012
|
-
globalVar.
|
|
2065
|
+
globalVar.__reactRouterDataRouter.subscribe(({ loaderData, actionData }) => {
|
|
2013
2066
|
if (lastLoaderData !== loaderData) {
|
|
2014
2067
|
globalVar.__routerActionID = (globalVar.__routerActionID ?? (globalVar.__routerActionID = 0)) + 1;
|
|
2015
2068
|
}
|
|
2016
2069
|
});
|
|
2017
|
-
|
|
2070
|
+
globalVar.__reactRouterDataRouter._updateRoutesForHMR = (routeUpdateByRouteId) => {
|
|
2071
|
+
const oldRoutes = window.__reactRouterDataRouter.routes;
|
|
2072
|
+
const newRoutes = [];
|
|
2073
|
+
function walkRoutes(routes2, parentId) {
|
|
2074
|
+
return routes2.map((route) => {
|
|
2075
|
+
const routeUpdate = routeUpdateByRouteId.get(route.id);
|
|
2076
|
+
if (routeUpdate) {
|
|
2077
|
+
const {
|
|
2078
|
+
routeModule,
|
|
2079
|
+
hasAction,
|
|
2080
|
+
hasComponent,
|
|
2081
|
+
hasErrorBoundary,
|
|
2082
|
+
hasLoader
|
|
2083
|
+
} = routeUpdate;
|
|
2084
|
+
const newRoute = createRouteFromServerManifest({
|
|
2085
|
+
clientAction: routeModule.clientAction,
|
|
2086
|
+
clientLoader: routeModule.clientLoader,
|
|
2087
|
+
element: route.element,
|
|
2088
|
+
errorElement: route.errorElement,
|
|
2089
|
+
handle: route.handle,
|
|
2090
|
+
hasAction,
|
|
2091
|
+
hasComponent,
|
|
2092
|
+
hasErrorBoundary,
|
|
2093
|
+
hasLoader,
|
|
2094
|
+
hydrateFallbackElement: route.hydrateFallbackElement,
|
|
2095
|
+
id: route.id,
|
|
2096
|
+
index: route.index,
|
|
2097
|
+
links: routeModule.links,
|
|
2098
|
+
meta: routeModule.meta,
|
|
2099
|
+
parentId,
|
|
2100
|
+
path: route.path,
|
|
2101
|
+
shouldRevalidate: routeModule.shouldRevalidate
|
|
2102
|
+
});
|
|
2103
|
+
if (route.children) {
|
|
2104
|
+
newRoute.children = walkRoutes(route.children, route.id);
|
|
2105
|
+
}
|
|
2106
|
+
return newRoute;
|
|
2107
|
+
}
|
|
2108
|
+
const updatedRoute = { ...route };
|
|
2109
|
+
if (route.children) {
|
|
2110
|
+
updatedRoute.children = walkRoutes(route.children, route.id);
|
|
2111
|
+
}
|
|
2112
|
+
return updatedRoute;
|
|
2113
|
+
});
|
|
2114
|
+
}
|
|
2115
|
+
newRoutes.push(
|
|
2116
|
+
...walkRoutes(oldRoutes, void 0)
|
|
2117
|
+
);
|
|
2118
|
+
window.__reactRouterDataRouter._internalSetRoutes(newRoutes);
|
|
2119
|
+
};
|
|
2120
|
+
return {
|
|
2121
|
+
router: globalVar.__reactRouterDataRouter,
|
|
2122
|
+
routeModules: globalVar.__reactRouterRouteModules
|
|
2123
|
+
};
|
|
2018
2124
|
}
|
|
2019
2125
|
var renderedRoutesContext = unstable_createContext();
|
|
2020
2126
|
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
|
@@ -2058,7 +2164,7 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
|
|
|
2058
2164
|
const renderedRoutes = renderedRoutesById.get(match.route.id);
|
|
2059
2165
|
if (renderedRoutes) {
|
|
2060
2166
|
for (const rendered of renderedRoutes) {
|
|
2061
|
-
window.
|
|
2167
|
+
window.__reactRouterDataRouter.patchRoutes(
|
|
2062
2168
|
rendered.parentId ?? null,
|
|
2063
2169
|
[createRouteFromServerManifest(rendered)],
|
|
2064
2170
|
true
|
|
@@ -2132,7 +2238,7 @@ function RSCHydratedRouter({
|
|
|
2132
2238
|
unstable_getContext
|
|
2133
2239
|
}) {
|
|
2134
2240
|
if (payload.type !== "render") throw new Error("Invalid payload type");
|
|
2135
|
-
let router = React4.useMemo(
|
|
2241
|
+
let { router, routeModules } = React4.useMemo(
|
|
2136
2242
|
() => createRouterFromPayload({
|
|
2137
2243
|
payload,
|
|
2138
2244
|
fetchImplementation,
|
|
@@ -2146,11 +2252,14 @@ function RSCHydratedRouter({
|
|
|
2146
2252
|
unstable_getContext
|
|
2147
2253
|
]
|
|
2148
2254
|
);
|
|
2255
|
+
React4.useEffect(() => {
|
|
2256
|
+
setIsHydrated();
|
|
2257
|
+
}, []);
|
|
2149
2258
|
React4.useLayoutEffect(() => {
|
|
2150
2259
|
const globalVar = window;
|
|
2151
2260
|
if (!globalVar.__routerInitialized) {
|
|
2152
2261
|
globalVar.__routerInitialized = true;
|
|
2153
|
-
globalVar.
|
|
2262
|
+
globalVar.__reactRouterDataRouter.initialize();
|
|
2154
2263
|
}
|
|
2155
2264
|
}, []);
|
|
2156
2265
|
let [location2, setLocation] = React4.useState(router.state.location);
|
|
@@ -2216,7 +2325,7 @@ function RSCHydratedRouter({
|
|
|
2216
2325
|
unstable_middleware: false,
|
|
2217
2326
|
unstable_subResourceIntegrity: false
|
|
2218
2327
|
},
|
|
2219
|
-
isSpaMode:
|
|
2328
|
+
isSpaMode: false,
|
|
2220
2329
|
ssr: true,
|
|
2221
2330
|
criticalCss: "",
|
|
2222
2331
|
manifest: {
|
|
@@ -2229,7 +2338,7 @@ function RSCHydratedRouter({
|
|
|
2229
2338
|
}
|
|
2230
2339
|
},
|
|
2231
2340
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2232
|
-
routeModules
|
|
2341
|
+
routeModules
|
|
2233
2342
|
};
|
|
2234
2343
|
return /* @__PURE__ */ React4.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React4.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React4.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React4.createElement(RouterProvider, { router, flushSync: ReactDOM.flushSync }))));
|
|
2235
2344
|
}
|
|
@@ -2242,6 +2351,8 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2242
2351
|
// the server loader flow regardless of whether the client loader calls
|
|
2243
2352
|
// `serverLoader` or not, otherwise we'll have nothing to render.
|
|
2244
2353
|
match.hasComponent && !match.element;
|
|
2354
|
+
invariant(window.__reactRouterRouteModules);
|
|
2355
|
+
populateRSCRouteModules(window.__reactRouterRouteModules, match);
|
|
2245
2356
|
let dataRoute = {
|
|
2246
2357
|
id: match.id,
|
|
2247
2358
|
element: match.element,
|
|
@@ -2337,7 +2448,10 @@ function getManifestUrl(paths) {
|
|
|
2337
2448
|
return new URL(`${paths[0]}.manifest`, window.location.origin);
|
|
2338
2449
|
}
|
|
2339
2450
|
const globalVar = window;
|
|
2340
|
-
let basename = (globalVar.
|
|
2451
|
+
let basename = (globalVar.__reactRouterDataRouter.basename ?? "").replace(
|
|
2452
|
+
/^\/|\/$/g,
|
|
2453
|
+
""
|
|
2454
|
+
);
|
|
2341
2455
|
let url = new URL(`${basename}/.manifest`, window.location.origin);
|
|
2342
2456
|
paths.sort().forEach((path) => url.searchParams.append("p", path));
|
|
2343
2457
|
return url;
|
|
@@ -2363,7 +2477,7 @@ async function fetchAndApplyManifestPatches(paths, createFromReadableStream, fet
|
|
|
2363
2477
|
}
|
|
2364
2478
|
paths.forEach((p) => addToFifoQueue(p, discoveredPaths));
|
|
2365
2479
|
payload.patches.forEach((p) => {
|
|
2366
|
-
window.
|
|
2480
|
+
window.__reactRouterDataRouter.patchRoutes(
|
|
2367
2481
|
p.parentId ?? null,
|
|
2368
2482
|
[createRouteFromServerManifest(p)]
|
|
2369
2483
|
);
|
|
@@ -2640,7 +2754,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2640
2754
|
}
|
|
2641
2755
|
},
|
|
2642
2756
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2643
|
-
routeModules:
|
|
2757
|
+
routeModules: createRSCRouteModules(payload)
|
|
2644
2758
|
};
|
|
2645
2759
|
return /* @__PURE__ */ React5.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React5.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React5.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React5.createElement(
|
|
2646
2760
|
StaticRouterProvider,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
2
|
-
* react-router v7.8.0
|
|
2
|
+
* react-router v7.8.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"use client";
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkZFXTWIWHjs = require('./chunk-ZFXTWIWH.js');
|
|
15
15
|
|
|
16
16
|
// lib/dom-export/dom-router-provider.tsx
|
|
17
17
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react);
|
|
@@ -180,7 +180,7 @@ function HydratedRouter(props) {
|
|
|
180
180
|
}, []);
|
|
181
181
|
React2.useEffect(() => {
|
|
182
182
|
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
|
|
183
|
-
document.querySelectorAll(`[${
|
|
183
|
+
document.querySelectorAll(`[${_chunkZFXTWIWHjs.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
|
184
184
|
}
|
|
185
185
|
}, [criticalCss]);
|
|
186
186
|
let [location, setLocation] = React2.useState(router.state.location);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.8.0
|
|
2
|
+
* react-router v7.8.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import {
|
|
13
13
|
deserializeErrors,
|
|
14
14
|
getHydrationData
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ZKLGVTLT.mjs";
|
|
16
16
|
import {
|
|
17
17
|
CRITICAL_CSS_DATA_ATTRIBUTE,
|
|
18
18
|
FrameworkContext,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
invariant,
|
|
30
30
|
mapRouteProperties,
|
|
31
31
|
useFogOFWarDiscovery
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-GIJZ6O2U.mjs";
|
|
33
33
|
|
|
34
34
|
// lib/dom-export/dom-router-provider.tsx
|
|
35
35
|
import * as React from "react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './components-CuPfnyiZ.mjs';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { az as RouteManifest, M as MiddlewareEnabled, o as unstable_RouterContextProvider, j as LoaderFunctionArgs, i as ActionFunctionArgs, J as StaticHandlerContext, H as HydrationState, z as DataRouteObject, a2 as HTMLFormMethod, a0 as FormEncType, a as RelativeRoutingType, T as To, aA as History, E as GetScrollRestorationKeyFunction, e as RouterInit, F as FutureConfig$1, D as DataStrategyFunction, P as PatchRoutesOnNavigationFunction, q as NavigateOptions, K as Fetcher, f as RouteObject, R as Router, B as BlockerFunction, c as Location, aB as CreateStaticHandlerOptions$1, C as StaticHandler } from './context-DohQKLID.mjs';
|
|
4
|
-
import { o as ServerRouteModule, A as AppLoadContext, c as RouteModules, h as ClientLoaderFunction, m as PageLinkDescriptor, d as SerializeFrom } from './route-data-
|
|
4
|
+
import { o as ServerRouteModule, A as AppLoadContext, c as RouteModules, h as ClientLoaderFunction, m as PageLinkDescriptor, d as SerializeFrom } from './route-data-CNjObrhZ.mjs';
|
|
5
5
|
|
|
6
6
|
type ServerRouteManifest = RouteManifest<Omit<ServerRoute, "children">>;
|
|
7
7
|
interface ServerRoute extends Route {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as InitialEntry, T as To, i as RelativeRoutingType, w as NonIndexRouteObject,
|
|
1
|
+
import { I as InitialEntry, T as To, i as RelativeRoutingType, w as NonIndexRouteObject, ag as LazyRouteFunction, q as IndexRouteObject, a as Location, A as Action, aD as Navigator, d as Router$1, V as RouterInit, aZ as FutureConfig$1, H as HydrationState, D as DataStrategyFunction, X as PatchRoutesOnNavigationFunction, p as RouteObject, aF as RouteMatch, o as Params, U as UIMatch, af as HTMLFormMethod, ad as FormEncType, a_ as RouteManifest, a$ as ServerRouteModule, z as MiddlewareEnabled, y as unstable_RouterContextProvider, x as AppLoadContext, ah as LoaderFunctionArgs, a7 as ActionFunctionArgs, e as RouteModules, Y as DataRouteObject, K as ClientLoaderFunction, a0 as StaticHandlerContext, aK as PageLinkDescriptor, b0 as History, $ as GetScrollRestorationKeyFunction, f as NavigateOptions, a1 as Fetcher, h as SerializeFrom, B as BlockerFunction, b1 as CreateStaticHandlerOptions$1, Z as StaticHandler } from './routeModules-C3oqzPpI.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
declare function mapRouteProperties(route: RouteObject): Partial<RouteObject> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { f as Await, g as MemoryRouter, h as Navigate, i as Outlet, j as Route, k as Router, l as RouterProvider, m as Routes, W as UNSAFE_WithComponentProps, v as UNSAFE_WithErrorBoundaryProps, t as UNSAFE_WithHydrateFallbackProps } from './components-CuPfnyiZ.mjs';
|
|
2
|
-
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-
|
|
2
|
+
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-11fLy3qB.mjs';
|
|
3
3
|
import './context-DohQKLID.mjs';
|
|
4
4
|
import 'react';
|
|
5
|
-
import './route-data-
|
|
5
|
+
import './route-data-CNjObrhZ.mjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { h as Await, V as BrowserRouter, _ as Form, W as HashRouter, X as Link, am as Links, i as MemoryRouter, al as Meta, Z as NavLink, j as Navigate, k as Outlet, l as Route, m as Router, n as RouterProvider, o as Routes, $ as ScrollRestoration, aj as StaticRouter, ak as StaticRouterProvider, az as UNSAFE_WithComponentProps, aD as UNSAFE_WithErrorBoundaryProps, aB as UNSAFE_WithHydrateFallbackProps, Y as unstable_HistoryRouter } from './index-react-server-client-
|
|
2
|
-
import './routeModules-
|
|
1
|
+
export { h as Await, V as BrowserRouter, _ as Form, W as HashRouter, X as Link, am as Links, i as MemoryRouter, al as Meta, Z as NavLink, j as Navigate, k as Outlet, l as Route, m as Router, n as RouterProvider, o as Routes, $ as ScrollRestoration, aj as StaticRouter, ak as StaticRouterProvider, az as UNSAFE_WithComponentProps, aD as UNSAFE_WithErrorBoundaryProps, aB as UNSAFE_WithHydrateFallbackProps, Y as unstable_HistoryRouter } from './index-react-server-client-BQ6FxdA_.js';
|
|
2
|
+
import './routeModules-C3oqzPpI.js';
|
|
3
3
|
import 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
|
|
2
|
-
* react-router v7.8.0
|
|
2
|
+
* react-router v7.8.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunk6K5ETUFZjs = require('./chunk-6K5ETUFZ.js');
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkZFXTWIWHjs = require('./chunk-ZFXTWIWH.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -58,4 +58,4 @@ var _chunkBOD6JCOUjs = require('./chunk-BOD6JCOU.js');
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
exports.Await =
|
|
61
|
+
exports.Await = _chunk6K5ETUFZjs.Await; exports.BrowserRouter = _chunk6K5ETUFZjs.BrowserRouter; exports.Form = _chunk6K5ETUFZjs.Form; exports.HashRouter = _chunk6K5ETUFZjs.HashRouter; exports.Link = _chunk6K5ETUFZjs.Link; exports.Links = _chunkZFXTWIWHjs.Links; exports.MemoryRouter = _chunk6K5ETUFZjs.MemoryRouter; exports.Meta = _chunkZFXTWIWHjs.Meta; exports.NavLink = _chunk6K5ETUFZjs.NavLink; exports.Navigate = _chunk6K5ETUFZjs.Navigate; exports.Outlet = _chunk6K5ETUFZjs.Outlet; exports.Route = _chunk6K5ETUFZjs.Route; exports.Router = _chunk6K5ETUFZjs.Router; exports.RouterProvider = _chunk6K5ETUFZjs.RouterProvider; exports.Routes = _chunk6K5ETUFZjs.Routes; exports.ScrollRestoration = _chunk6K5ETUFZjs.ScrollRestoration; exports.StaticRouter = _chunk6K5ETUFZjs.StaticRouter; exports.StaticRouterProvider = _chunk6K5ETUFZjs.StaticRouterProvider; exports.UNSAFE_WithComponentProps = _chunk6K5ETUFZjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunk6K5ETUFZjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunk6K5ETUFZjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunk6K5ETUFZjs.HistoryRouter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.8.0
|
|
2
|
+
* react-router v7.8.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
WithComponentProps,
|
|
33
33
|
WithErrorBoundaryProps,
|
|
34
34
|
WithHydrateFallbackProps
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-GIJZ6O2U.mjs";
|
|
36
36
|
export {
|
|
37
37
|
Await,
|
|
38
38
|
BrowserRouter,
|
|
@@ -849,6 +849,43 @@ declare const redirectDocument$1: RedirectFunction;
|
|
|
849
849
|
* header.
|
|
850
850
|
*/
|
|
851
851
|
declare const replace$1: RedirectFunction;
|
|
852
|
+
type ErrorResponse = {
|
|
853
|
+
status: number;
|
|
854
|
+
statusText: string;
|
|
855
|
+
data: any;
|
|
856
|
+
};
|
|
857
|
+
/**
|
|
858
|
+
* Check if the given error is an {@link ErrorResponse} generated from a 4xx/5xx
|
|
859
|
+
* [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
|
|
860
|
+
* thrown from an [`action`](../../start/framework/route-module#action)/[`loader`](../../start/framework/route-module#loader)
|
|
861
|
+
*
|
|
862
|
+
* @example
|
|
863
|
+
* import { isRouteErrorResponse } from "react-router";
|
|
864
|
+
*
|
|
865
|
+
* export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
|
|
866
|
+
* if (isRouteErrorResponse(error)) {
|
|
867
|
+
* return (
|
|
868
|
+
* <>
|
|
869
|
+
* <p>Error: `${error.status}: ${error.statusText}`</p>
|
|
870
|
+
* <p>{error.data}</p>
|
|
871
|
+
* </>
|
|
872
|
+
* );
|
|
873
|
+
* }
|
|
874
|
+
*
|
|
875
|
+
* return (
|
|
876
|
+
* <p>Error: {error instanceof Error ? error.message : "Unknown Error"}</p>
|
|
877
|
+
* );
|
|
878
|
+
* }
|
|
879
|
+
*
|
|
880
|
+
* @public
|
|
881
|
+
* @category Utils
|
|
882
|
+
* @mode framework
|
|
883
|
+
* @mode data
|
|
884
|
+
* @param error The error to check.
|
|
885
|
+
* @returns `true` if the error is an {@link ErrorResponse}, `false` otherwise.
|
|
886
|
+
*
|
|
887
|
+
*/
|
|
888
|
+
declare function isRouteErrorResponse(error: any): error is ErrorResponse;
|
|
852
889
|
|
|
853
890
|
/**
|
|
854
891
|
* A Router instance manages all navigation and data loading/mutations
|
|
@@ -2187,4 +2224,4 @@ interface MemorySessionStorageOptions {
|
|
|
2187
2224
|
*/
|
|
2188
2225
|
declare function createMemorySessionStorage<Data = SessionData, FlashData = Data>({ cookie }?: MemorySessionStorageOptions): SessionStorage<Data, FlashData>;
|
|
2189
2226
|
|
|
2190
|
-
export { type Cookie, type CookieOptions, type CookieSignatureOptions, type FlashSessionData, type IsCookieFunction, type IsSessionFunction, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, createCookie, createCookieSessionStorage, createMemorySessionStorage, createSession, createSessionStorage, createStaticHandler, data, isCookie, isSession, matchRoutes, redirect, redirectDocument, replace, type DecodeActionFunction as unstable_DecodeActionFunction, type DecodeFormStateFunction as unstable_DecodeFormStateFunction, type DecodeReplyFunction as unstable_DecodeReplyFunction, type LoadServerActionFunction as unstable_LoadServerActionFunction, type unstable_MiddlewareFunction, type unstable_MiddlewareNextFunction, type RSCManifestPayload as unstable_RSCManifestPayload, type RSCMatch as unstable_RSCMatch, type RSCPayload as unstable_RSCPayload, type RSCRenderPayload as unstable_RSCRenderPayload, type RSCRouteConfig as unstable_RSCRouteConfig, type RSCRouteConfigEntry as unstable_RSCRouteConfigEntry, type RSCRouteManifest as unstable_RSCRouteManifest, type RSCRouteMatch as unstable_RSCRouteMatch, type unstable_RouterContext, unstable_RouterContextProvider, unstable_createContext, matchRSCServerRequest as unstable_matchRSCServerRequest };
|
|
2227
|
+
export { type Cookie, type CookieOptions, type CookieSignatureOptions, type FlashSessionData, type IsCookieFunction, type IsSessionFunction, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, createCookie, createCookieSessionStorage, createMemorySessionStorage, createSession, createSessionStorage, createStaticHandler, data, isCookie, isRouteErrorResponse, isSession, matchRoutes, redirect, redirectDocument, replace, type DecodeActionFunction as unstable_DecodeActionFunction, type DecodeFormStateFunction as unstable_DecodeFormStateFunction, type DecodeReplyFunction as unstable_DecodeReplyFunction, type LoadServerActionFunction as unstable_LoadServerActionFunction, type unstable_MiddlewareFunction, type unstable_MiddlewareNextFunction, type RSCManifestPayload as unstable_RSCManifestPayload, type RSCMatch as unstable_RSCMatch, type RSCPayload as unstable_RSCPayload, type RSCRenderPayload as unstable_RSCRenderPayload, type RSCRouteConfig as unstable_RSCRouteConfig, type RSCRouteConfigEntry as unstable_RSCRouteConfigEntry, type RSCRouteManifest as unstable_RSCRouteManifest, type RSCRouteMatch as unstable_RSCRouteMatch, type unstable_RouterContext, unstable_RouterContextProvider, unstable_createContext, matchRSCServerRequest as unstable_matchRSCServerRequest };
|
|
@@ -849,6 +849,43 @@ declare const redirectDocument$1: RedirectFunction;
|
|
|
849
849
|
* header.
|
|
850
850
|
*/
|
|
851
851
|
declare const replace$1: RedirectFunction;
|
|
852
|
+
type ErrorResponse = {
|
|
853
|
+
status: number;
|
|
854
|
+
statusText: string;
|
|
855
|
+
data: any;
|
|
856
|
+
};
|
|
857
|
+
/**
|
|
858
|
+
* Check if the given error is an {@link ErrorResponse} generated from a 4xx/5xx
|
|
859
|
+
* [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
|
|
860
|
+
* thrown from an [`action`](../../start/framework/route-module#action)/[`loader`](../../start/framework/route-module#loader)
|
|
861
|
+
*
|
|
862
|
+
* @example
|
|
863
|
+
* import { isRouteErrorResponse } from "react-router";
|
|
864
|
+
*
|
|
865
|
+
* export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
|
|
866
|
+
* if (isRouteErrorResponse(error)) {
|
|
867
|
+
* return (
|
|
868
|
+
* <>
|
|
869
|
+
* <p>Error: `${error.status}: ${error.statusText}`</p>
|
|
870
|
+
* <p>{error.data}</p>
|
|
871
|
+
* </>
|
|
872
|
+
* );
|
|
873
|
+
* }
|
|
874
|
+
*
|
|
875
|
+
* return (
|
|
876
|
+
* <p>Error: {error instanceof Error ? error.message : "Unknown Error"}</p>
|
|
877
|
+
* );
|
|
878
|
+
* }
|
|
879
|
+
*
|
|
880
|
+
* @public
|
|
881
|
+
* @category Utils
|
|
882
|
+
* @mode framework
|
|
883
|
+
* @mode data
|
|
884
|
+
* @param error The error to check.
|
|
885
|
+
* @returns `true` if the error is an {@link ErrorResponse}, `false` otherwise.
|
|
886
|
+
*
|
|
887
|
+
*/
|
|
888
|
+
declare function isRouteErrorResponse(error: any): error is ErrorResponse;
|
|
852
889
|
|
|
853
890
|
/**
|
|
854
891
|
* A Router instance manages all navigation and data loading/mutations
|
|
@@ -2187,4 +2224,4 @@ interface MemorySessionStorageOptions {
|
|
|
2187
2224
|
*/
|
|
2188
2225
|
declare function createMemorySessionStorage<Data = SessionData, FlashData = Data>({ cookie }?: MemorySessionStorageOptions): SessionStorage<Data, FlashData>;
|
|
2189
2226
|
|
|
2190
|
-
export { type Cookie, type CookieOptions, type CookieSignatureOptions, type FlashSessionData, type IsCookieFunction, type IsSessionFunction, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, createCookie, createCookieSessionStorage, createMemorySessionStorage, createSession, createSessionStorage, createStaticHandler, data, isCookie, isSession, matchRoutes, redirect, redirectDocument, replace, type DecodeActionFunction as unstable_DecodeActionFunction, type DecodeFormStateFunction as unstable_DecodeFormStateFunction, type DecodeReplyFunction as unstable_DecodeReplyFunction, type LoadServerActionFunction as unstable_LoadServerActionFunction, type unstable_MiddlewareFunction, type unstable_MiddlewareNextFunction, type RSCManifestPayload as unstable_RSCManifestPayload, type RSCMatch as unstable_RSCMatch, type RSCPayload as unstable_RSCPayload, type RSCRenderPayload as unstable_RSCRenderPayload, type RSCRouteConfig as unstable_RSCRouteConfig, type RSCRouteConfigEntry as unstable_RSCRouteConfigEntry, type RSCRouteManifest as unstable_RSCRouteManifest, type RSCRouteMatch as unstable_RSCRouteMatch, type unstable_RouterContext, unstable_RouterContextProvider, unstable_createContext, matchRSCServerRequest as unstable_matchRSCServerRequest };
|
|
2227
|
+
export { type Cookie, type CookieOptions, type CookieSignatureOptions, type FlashSessionData, type IsCookieFunction, type IsSessionFunction, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, createCookie, createCookieSessionStorage, createMemorySessionStorage, createSession, createSessionStorage, createStaticHandler, data, isCookie, isRouteErrorResponse, isSession, matchRoutes, redirect, redirectDocument, replace, type DecodeActionFunction as unstable_DecodeActionFunction, type DecodeFormStateFunction as unstable_DecodeFormStateFunction, type DecodeReplyFunction as unstable_DecodeReplyFunction, type LoadServerActionFunction as unstable_LoadServerActionFunction, type unstable_MiddlewareFunction, type unstable_MiddlewareNextFunction, type RSCManifestPayload as unstable_RSCManifestPayload, type RSCMatch as unstable_RSCMatch, type RSCPayload as unstable_RSCPayload, type RSCRenderPayload as unstable_RSCRenderPayload, type RSCRouteConfig as unstable_RSCRouteConfig, type RSCRouteConfigEntry as unstable_RSCRouteConfigEntry, type RSCRouteManifest as unstable_RSCRouteManifest, type RSCRouteMatch as unstable_RSCRouteMatch, type unstable_RouterContext, unstable_RouterContextProvider, unstable_createContext, matchRSCServerRequest as unstable_matchRSCServerRequest };
|