react-router 7.5.1-pre.0 → 7.5.2
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 +19 -1
- package/dist/development/{chunk-QP2GE2RJ.mjs → chunk-BAXFHI7N.mjs} +104 -35
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.d.ts +2 -2
- package/dist/development/dom-export.js +89 -61
- package/dist/development/dom-export.mjs +17 -41
- package/dist/{production/fog-of-war-CyHis97d.d.mts → development/fog-of-war-BLArG-qZ.d.ts} +2 -2
- package/dist/development/{fog-of-war-D4x86-Xc.d.ts → fog-of-war-D2zsXvum.d.mts} +2 -2
- package/dist/development/index.d.mts +19 -16
- package/dist/development/index.d.ts +19 -16
- package/dist/development/index.js +105 -35
- package/dist/development/index.mjs +6 -4
- package/dist/development/lib/types/route-module.d.mts +1 -1
- package/dist/development/lib/types/route-module.d.ts +1 -1
- package/dist/development/lib/types/route-module.js +1 -1
- package/dist/development/lib/types/route-module.mjs +1 -1
- package/dist/development/{route-data-OcOrqK13.d.ts → route-data-C12CLHiN.d.mts} +1 -1
- package/dist/{production/route-data-OcOrqK13.d.mts → development/route-data-C12CLHiN.d.ts} +1 -1
- package/dist/production/{chunk-TOAG3JKW.mjs → chunk-XAHXRTXS.mjs} +104 -35
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.d.ts +2 -2
- package/dist/production/dom-export.js +89 -61
- package/dist/production/dom-export.mjs +17 -41
- package/dist/{development/fog-of-war-CyHis97d.d.mts → production/fog-of-war-BLArG-qZ.d.ts} +2 -2
- package/dist/production/{fog-of-war-D4x86-Xc.d.ts → fog-of-war-D2zsXvum.d.mts} +2 -2
- package/dist/production/index.d.mts +19 -16
- package/dist/production/index.d.ts +19 -16
- package/dist/production/index.js +105 -35
- package/dist/production/index.mjs +6 -4
- package/dist/production/lib/types/route-module.d.mts +1 -1
- package/dist/production/lib/types/route-module.d.ts +1 -1
- package/dist/production/lib/types/route-module.js +1 -1
- package/dist/production/lib/types/route-module.mjs +1 -1
- package/dist/production/{route-data-OcOrqK13.d.ts → route-data-C12CLHiN.d.mts} +1 -1
- package/dist/{development/route-data-OcOrqK13.d.mts → production/route-data-C12CLHiN.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.5.
|
|
2
|
+
* react-router v7.5.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -18,15 +18,14 @@ import {
|
|
|
18
18
|
createRouter,
|
|
19
19
|
decodeViaTurboStream,
|
|
20
20
|
deserializeErrors,
|
|
21
|
+
getHydrationData,
|
|
21
22
|
getPatchRoutesOnNavigationFunction,
|
|
22
|
-
|
|
23
|
+
getTurboStreamSingleFetchDataStrategy,
|
|
23
24
|
hydrationRouteProperties,
|
|
24
25
|
invariant,
|
|
25
26
|
mapRouteProperties,
|
|
26
|
-
matchRoutes,
|
|
27
|
-
shouldHydrateRouteLoader,
|
|
28
27
|
useFogOFWarDiscovery
|
|
29
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-XAHXRTXS.mjs";
|
|
30
29
|
|
|
31
30
|
// lib/dom-export/dom-router-provider.tsx
|
|
32
31
|
import * as React from "react";
|
|
@@ -98,8 +97,8 @@ function createHydratedRouter({
|
|
|
98
97
|
ssrInfo.context.isSpaMode
|
|
99
98
|
);
|
|
100
99
|
let hydrationData = void 0;
|
|
101
|
-
let loaderData = ssrInfo.context.state.loaderData;
|
|
102
100
|
if (ssrInfo.context.isSpaMode) {
|
|
101
|
+
let { loaderData } = ssrInfo.context.state;
|
|
103
102
|
if (ssrInfo.manifest.routes.root?.hasLoader && loaderData && "root" in loaderData) {
|
|
104
103
|
hydrationData = {
|
|
105
104
|
loaderData: {
|
|
@@ -108,31 +107,18 @@ function createHydratedRouter({
|
|
|
108
107
|
};
|
|
109
108
|
}
|
|
110
109
|
} else {
|
|
111
|
-
hydrationData =
|
|
112
|
-
|
|
113
|
-
loaderData: { ...loaderData }
|
|
114
|
-
};
|
|
115
|
-
let initialMatches = matchRoutes(
|
|
110
|
+
hydrationData = getHydrationData(
|
|
111
|
+
ssrInfo.context.state,
|
|
116
112
|
routes,
|
|
113
|
+
(routeId) => ({
|
|
114
|
+
clientLoader: ssrInfo.routeModules[routeId]?.clientLoader,
|
|
115
|
+
hasLoader: ssrInfo.manifest.routes[routeId]?.hasLoader === true,
|
|
116
|
+
hasHydrateFallback: ssrInfo.routeModules[routeId]?.HydrateFallback != null
|
|
117
|
+
}),
|
|
117
118
|
window.location,
|
|
118
|
-
window.__reactRouterContext?.basename
|
|
119
|
+
window.__reactRouterContext?.basename,
|
|
120
|
+
ssrInfo.context.isSpaMode
|
|
119
121
|
);
|
|
120
|
-
if (initialMatches) {
|
|
121
|
-
for (let match of initialMatches) {
|
|
122
|
-
let routeId = match.route.id;
|
|
123
|
-
let route = ssrInfo.routeModules[routeId];
|
|
124
|
-
let manifestRoute = ssrInfo.manifest.routes[routeId];
|
|
125
|
-
if (route && manifestRoute && shouldHydrateRouteLoader(
|
|
126
|
-
manifestRoute,
|
|
127
|
-
route,
|
|
128
|
-
ssrInfo.context.isSpaMode
|
|
129
|
-
) && (route.HydrateFallback || !manifestRoute.hasLoader)) {
|
|
130
|
-
delete hydrationData.loaderData[routeId];
|
|
131
|
-
} else if (manifestRoute && !manifestRoute.hasLoader) {
|
|
132
|
-
hydrationData.loaderData[routeId] = null;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
122
|
if (hydrationData && hydrationData.errors) {
|
|
137
123
|
hydrationData.errors = deserializeErrors(hydrationData.errors);
|
|
138
124
|
}
|
|
@@ -148,20 +134,10 @@ function createHydratedRouter({
|
|
|
148
134
|
future: {
|
|
149
135
|
unstable_middleware: ssrInfo.context.future.unstable_middleware
|
|
150
136
|
},
|
|
151
|
-
dataStrategy:
|
|
137
|
+
dataStrategy: getTurboStreamSingleFetchDataStrategy(
|
|
152
138
|
() => router2,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
invariant(manifestRoute, "Route not found in manifest/routeModules");
|
|
156
|
-
let routeModule = ssrInfo.routeModules[routeId];
|
|
157
|
-
return {
|
|
158
|
-
hasLoader: manifestRoute.hasLoader,
|
|
159
|
-
hasClientLoader: manifestRoute.hasClientLoader,
|
|
160
|
-
// In some cases the module may not be loaded yet and we don't care
|
|
161
|
-
// if it's got shouldRevalidate or not
|
|
162
|
-
hasShouldRevalidate: routeModule ? routeModule.shouldRevalidate != null : void 0
|
|
163
|
-
};
|
|
164
|
-
},
|
|
139
|
+
ssrInfo.manifest,
|
|
140
|
+
ssrInfo.routeModules,
|
|
165
141
|
ssrInfo.context.ssr,
|
|
166
142
|
ssrInfo.context.basename
|
|
167
143
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { k as RouteObject, R as RouterInit, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, at as PatchRoutesOnNavigationFunction, a as Router$1, T as To, d as RelativeRoutingType, y as NonIndexRouteObject, a5 as LazyRouteFunction, s as IndexRouteObject, e as Location, f as Action, as as Navigator, av as RouteMatch, p as StaticHandlerContext, c as RouteManifest, b as RouteModules, G as DataRouteObject, J as ClientLoaderFunction, a4 as HTMLFormMethod, a2 as FormEncType, aD as PageLinkDescriptor, aT as History, O as GetScrollRestorationKeyFunction, N as NavigateOptions, Q as Fetcher, n as SerializeFrom, B as BlockerFunction } from './route-data-C12CLHiN.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @private
|
|
@@ -488,7 +488,7 @@ interface EntryRoute extends Route {
|
|
|
488
488
|
}
|
|
489
489
|
declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, ssr: boolean, isSpaMode: boolean): DataRouteObject[];
|
|
490
490
|
declare function createClientRoutes(manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState | null, ssr: boolean, isSpaMode: boolean, parentId?: string, routesByParentId?: Record<string, Omit<EntryRoute, "children">[]>, needsRevalidation?: Set<string>): DataRouteObject[];
|
|
491
|
-
declare function shouldHydrateRouteLoader(
|
|
491
|
+
declare function shouldHydrateRouteLoader(routeId: string, clientLoader: ClientLoaderFunction | undefined, hasLoader: boolean, isSpaMode: boolean): boolean;
|
|
492
492
|
|
|
493
493
|
type ParamKeyValuePair = [string, string];
|
|
494
494
|
type URLSearchParamsInit = string | ParamKeyValuePair[] | Record<string, string | string[]> | URLSearchParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { k as RouteObject, R as RouterInit, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, at as PatchRoutesOnNavigationFunction, a as Router$1, T as To, d as RelativeRoutingType, y as NonIndexRouteObject, a5 as LazyRouteFunction, s as IndexRouteObject, e as Location, f as Action, as as Navigator, av as RouteMatch, p as StaticHandlerContext, c as RouteManifest, b as RouteModules, G as DataRouteObject, J as ClientLoaderFunction, a4 as HTMLFormMethod, a2 as FormEncType, aD as PageLinkDescriptor, aT as History, O as GetScrollRestorationKeyFunction, N as NavigateOptions, Q as Fetcher, n as SerializeFrom, B as BlockerFunction } from './route-data-C12CLHiN.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @private
|
|
@@ -488,7 +488,7 @@ interface EntryRoute extends Route {
|
|
|
488
488
|
}
|
|
489
489
|
declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, ssr: boolean, isSpaMode: boolean): DataRouteObject[];
|
|
490
490
|
declare function createClientRoutes(manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState | null, ssr: boolean, isSpaMode: boolean, parentId?: string, routesByParentId?: Record<string, Omit<EntryRoute, "children">[]>, needsRevalidation?: Set<string>): DataRouteObject[];
|
|
491
|
-
declare function shouldHydrateRouteLoader(
|
|
491
|
+
declare function shouldHydrateRouteLoader(routeId: string, clientLoader: ClientLoaderFunction | undefined, hasLoader: boolean, isSpaMode: boolean): boolean;
|
|
492
492
|
|
|
493
493
|
type ParamKeyValuePair = [string, string];
|
|
494
494
|
type URLSearchParamsInit = string | ParamKeyValuePair[] | Record<string, string | string[]> | URLSearchParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as Router, D as DataStrategyFunction,
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export { g as Await, b as AwaitProps, T as BrowserRouter, B as BrowserRouterProps, D as DOMRouterOpts, w as FetcherFormProps, G as FetcherSubmitFunction, a7 as FetcherSubmitOptions, J as FetcherWithComponents, Y as Form, x as FormProps, U as HashRouter, H as HashRouterProps, s as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, V as Link, t as LinkProps, ae as Links, h as MemoryRouter, M as MemoryRouterOpts, c as MemoryRouterProps, ad as Meta, X as NavLink, u as NavLinkProps, v as NavLinkRenderProps, i as Navigate, N as NavigateProps, j as Outlet, O as OutletProps, a8 as ParamKeyValuePair, P as PathRouteProps, ag as PrefetchPageLinks, k as Route, d as RouteProps, l as Router, e as RouterProps, m as RouterProvider, R as RouterProviderProps, n as Routes, f as RoutesProps, af as Scripts, ah as ScriptsProps, Z as ScrollRestoration, S as ScrollRestorationProps, y as SetURLSearchParams, z as SubmitFunction, a9 as SubmitOptions, ab as SubmitTarget, ak as UNSAFE_FrameworkContext, an as UNSAFE_createClientRoutes, ao as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, al as UNSAFE_getPatchRoutesOnNavigationFunction, ai as UNSAFE_hydrationRouteProperties, aj as UNSAFE_mapRouteProperties, ap as UNSAFE_shouldHydrateRouteLoader, am as UNSAFE_useFogOFWarDiscovery, aq as UNSAFE_useScrollRestoration, aa as URLSearchParamsInit, K as createBrowserRouter, Q as createHashRouter, o as createMemoryRouter, p as createRoutesFromChildren, q as createRoutesFromElements, ac as createSearchParams, r as renderMatches, W as unstable_HistoryRouter, a5 as unstable_usePrompt, a4 as useBeforeUnload, a2 as useFetcher, a3 as useFetchers, a1 as useFormAction, _ as useLinkClickHandler, $ as useSearchParams, a0 as useSubmit, a6 as useViewTransitionState } from './fog-of-war-
|
|
1
|
+
import { a as Router, b as RouteModules, D as DataStrategyFunction, c as RouteManifest, S as ServerRouteModule, M as MiddlewareEnabled, u as unstable_RouterContextProvider, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, d as RelativeRoutingType, e as Location, f as Action, P as ParamParseKey, g as Path, h as PathPattern, i as PathMatch, N as NavigateOptions, j as Params$1, k as RouteObject, l as Navigation, m as RevalidationState, U as UIMatch, n as SerializeFrom, B as BlockerFunction, o as Blocker, p as StaticHandlerContext, q as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, r as unstable_InitialContext, s as IndexRouteObject, t as LoaderFunction, v as ActionFunction, w as MetaFunction, x as LinksFunction, y as NonIndexRouteObject, E as Equal, z as RouterState, G as DataRouteObject, J as ClientLoaderFunction } from './route-data-C12CLHiN.mjs';
|
|
2
|
+
export { aw as ClientActionFunction, ax as ClientActionFunctionArgs, ay as ClientLoaderFunctionArgs, ar as DataRouteMatch, Z as DataStrategyFunctionArgs, _ as DataStrategyMatch, $ as DataStrategyResult, a1 as ErrorResponse, Q as Fetcher, a2 as FormEncType, a3 as FormMethod, aG as Future, K as GetScrollPositionFunction, O as GetScrollRestorationKeyFunction, a4 as HTMLFormMethod, az as HeadersArgs, aA as HeadersFunction, aE as HtmlLinkDescriptor, ah as IDLE_BLOCKER, ag as IDLE_FETCHER, af as IDLE_NAVIGATION, a5 as LazyRouteFunction, aF as LinkDescriptor, aB as MetaArgs, aC as MetaDescriptor, V as NavigationStates, as as Navigator, aD as PageLinkDescriptor, at as PatchRoutesOnNavigationFunction, au as PatchRoutesOnNavigationFunctionArgs, a7 as PathParam, a8 as RedirectFunction, av as RouteMatch, Y as RouterFetchOptions, R as RouterInit, X as RouterNavigateOptions, W as RouterSubscriber, aa as ShouldRevalidateFunction, ab as ShouldRevalidateFunctionArgs, aM as UNSAFE_DataRouterContext, aN as UNSAFE_DataRouterStateContext, a0 as UNSAFE_DataWithResponseInit, aL as UNSAFE_ErrorResponseImpl, aO as UNSAFE_FetchersContext, aP as UNSAFE_LocationContext, aQ as UNSAFE_NavigationContext, aR as UNSAFE_RouteContext, aS as UNSAFE_ViewTransitionContext, aI as UNSAFE_createBrowserHistory, aK as UNSAFE_createRouter, aJ as UNSAFE_invariant, ad as createPath, ai as data, aj as generatePath, ak as isRouteErrorResponse, al as matchPath, am as matchRoutes, ae as parsePath, an as redirect, ao as redirectDocument, ap as replace, aq as resolvePath, a6 as unstable_MiddlewareFunction, a9 as unstable_RouterContext, aH as unstable_SerializesTo, ac as unstable_createContext } from './route-data-C12CLHiN.mjs';
|
|
3
|
+
import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext, C as CriticalCss } from './fog-of-war-D2zsXvum.mjs';
|
|
4
|
+
export { g as Await, b as AwaitProps, T as BrowserRouter, B as BrowserRouterProps, D as DOMRouterOpts, w as FetcherFormProps, G as FetcherSubmitFunction, a7 as FetcherSubmitOptions, J as FetcherWithComponents, Y as Form, x as FormProps, U as HashRouter, H as HashRouterProps, s as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, V as Link, t as LinkProps, ae as Links, h as MemoryRouter, M as MemoryRouterOpts, c as MemoryRouterProps, ad as Meta, X as NavLink, u as NavLinkProps, v as NavLinkRenderProps, i as Navigate, N as NavigateProps, j as Outlet, O as OutletProps, a8 as ParamKeyValuePair, P as PathRouteProps, ag as PrefetchPageLinks, k as Route, d as RouteProps, l as Router, e as RouterProps, m as RouterProvider, R as RouterProviderProps, n as Routes, f as RoutesProps, af as Scripts, ah as ScriptsProps, Z as ScrollRestoration, S as ScrollRestorationProps, y as SetURLSearchParams, z as SubmitFunction, a9 as SubmitOptions, ab as SubmitTarget, ak as UNSAFE_FrameworkContext, an as UNSAFE_createClientRoutes, ao as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, al as UNSAFE_getPatchRoutesOnNavigationFunction, ai as UNSAFE_hydrationRouteProperties, aj as UNSAFE_mapRouteProperties, ap as UNSAFE_shouldHydrateRouteLoader, am as UNSAFE_useFogOFWarDiscovery, aq as UNSAFE_useScrollRestoration, aa as URLSearchParamsInit, K as createBrowserRouter, Q as createHashRouter, o as createMemoryRouter, p as createRoutesFromChildren, q as createRoutesFromElements, ac as createSearchParams, r as renderMatches, W as unstable_HistoryRouter, a5 as unstable_usePrompt, a4 as useBeforeUnload, a2 as useFetcher, a3 as useFetchers, a1 as useFormAction, _ as useLinkClickHandler, $ as useSearchParams, a0 as useSubmit, a6 as useViewTransitionState } from './fog-of-war-D2zsXvum.mjs';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { ReactElement } from 'react';
|
|
7
7
|
import { ParseOptions, SerializeOptions } from 'cookie';
|
|
@@ -9,12 +9,7 @@ export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerialize
|
|
|
9
9
|
import { A as AppLoadContext } from './data-CQbyyGzl.mjs';
|
|
10
10
|
|
|
11
11
|
declare const SingleFetchRedirectSymbol: unique symbol;
|
|
12
|
-
|
|
13
|
-
hasLoader: boolean;
|
|
14
|
-
hasClientLoader: boolean;
|
|
15
|
-
hasShouldRevalidate: boolean | undefined;
|
|
16
|
-
};
|
|
17
|
-
declare function getSingleFetchDataStrategy(getRouter: () => Router, getRouteInfo: GetRouteInfoFunction, ssr: boolean, basename: string | undefined): DataStrategyFunction;
|
|
12
|
+
declare function getTurboStreamSingleFetchDataStrategy(getRouter: () => Router, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, basename: string | undefined): DataStrategyFunction;
|
|
18
13
|
declare function decodeViaTurboStream(body: ReadableStream<Uint8Array>, global: Window | typeof globalThis): Promise<{
|
|
19
14
|
done: Promise<undefined>;
|
|
20
15
|
value: unknown;
|
|
@@ -620,7 +615,7 @@ interface SessionData {
|
|
|
620
615
|
/**
|
|
621
616
|
* Session persists data across HTTP requests.
|
|
622
617
|
*
|
|
623
|
-
* @see https://
|
|
618
|
+
* @see https://reactrouter.com/explanation/sessions-and-cookies#sessions
|
|
624
619
|
*/
|
|
625
620
|
interface Session<Data = SessionData, FlashData = Data> {
|
|
626
621
|
/**
|
|
@@ -670,15 +665,13 @@ type CreateSessionFunction = <Data = SessionData, FlashData = Data>(initialData?
|
|
|
670
665
|
*
|
|
671
666
|
* Note: This function is typically not invoked directly by application code.
|
|
672
667
|
* Instead, use a `SessionStorage` object's `getSession` method.
|
|
673
|
-
*
|
|
674
|
-
* @see https://remix.run/utils/sessions#createsession
|
|
675
668
|
*/
|
|
676
669
|
declare const createSession: CreateSessionFunction;
|
|
677
670
|
type IsSessionFunction = (object: any) => object is Session;
|
|
678
671
|
/**
|
|
679
|
-
* Returns true if an object is a
|
|
672
|
+
* Returns true if an object is a React Router session.
|
|
680
673
|
*
|
|
681
|
-
* @see https://
|
|
674
|
+
* @see https://reactrouter.com/api/utils/isSession
|
|
682
675
|
*/
|
|
683
676
|
declare const isSession: IsSessionFunction;
|
|
684
677
|
/**
|
|
@@ -842,4 +835,14 @@ declare class RemixErrorBoundary extends React.Component<RemixErrorBoundaryProps
|
|
|
842
835
|
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
843
836
|
}
|
|
844
837
|
|
|
845
|
-
|
|
838
|
+
declare function getHydrationData(state: {
|
|
839
|
+
loaderData?: Router["state"]["loaderData"];
|
|
840
|
+
actionData?: Router["state"]["actionData"];
|
|
841
|
+
errors?: Router["state"]["errors"];
|
|
842
|
+
}, routes: DataRouteObject[], getRouteInfo: (routeId: string) => {
|
|
843
|
+
clientLoader: ClientLoaderFunction | undefined;
|
|
844
|
+
hasLoader: boolean;
|
|
845
|
+
hasHydrateFallback: boolean;
|
|
846
|
+
}, location: Path, basename: string | undefined, isSpaMode: boolean): HydrationState;
|
|
847
|
+
|
|
848
|
+
export { ActionFunction, ActionFunctionArgs, AppLoadContext, Blocker, BlockerFunction, ClientLoaderFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, DataRouteObject, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, LoaderFunctionArgs, Location, MetaFunction, type NavigateFunction, NavigateOptions, Navigation, Action as NavigationType, NonIndexRouteObject, ParamParseKey, Params$1 as Params, Path, PathMatch, PathPattern, type Register, RelativeRoutingType, type RequestHandler, RevalidationState, RouteObject, RouterState, type RoutesTestStubProps, type ServerBuild, type ServerEntryModule, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, To, UIMatch, AssetsManifest as UNSAFE_AssetsManifest, MiddlewareEnabled as UNSAFE_MiddlewareEnabled, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getHydrationData as UNSAFE_getHydrationData, getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy, createCookie, createCookieSessionStorage, createMemorySessionStorage, createRequestHandler, createRoutesStub, createSession, createSessionStorage, createStaticHandler, createStaticRouter, href, isCookie, isSession, unstable_InitialContext, unstable_RouterContextProvider, setDevServerHooks as unstable_setDevServerHooks, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as Router, D as DataStrategyFunction,
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export { g as Await, b as AwaitProps, T as BrowserRouter, B as BrowserRouterProps, D as DOMRouterOpts, w as FetcherFormProps, G as FetcherSubmitFunction, a7 as FetcherSubmitOptions, J as FetcherWithComponents, Y as Form, x as FormProps, U as HashRouter, H as HashRouterProps, s as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, V as Link, t as LinkProps, ae as Links, h as MemoryRouter, M as MemoryRouterOpts, c as MemoryRouterProps, ad as Meta, X as NavLink, u as NavLinkProps, v as NavLinkRenderProps, i as Navigate, N as NavigateProps, j as Outlet, O as OutletProps, a8 as ParamKeyValuePair, P as PathRouteProps, ag as PrefetchPageLinks, k as Route, d as RouteProps, l as Router, e as RouterProps, m as RouterProvider, R as RouterProviderProps, n as Routes, f as RoutesProps, af as Scripts, ah as ScriptsProps, Z as ScrollRestoration, S as ScrollRestorationProps, y as SetURLSearchParams, z as SubmitFunction, a9 as SubmitOptions, ab as SubmitTarget, ak as UNSAFE_FrameworkContext, an as UNSAFE_createClientRoutes, ao as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, al as UNSAFE_getPatchRoutesOnNavigationFunction, ai as UNSAFE_hydrationRouteProperties, aj as UNSAFE_mapRouteProperties, ap as UNSAFE_shouldHydrateRouteLoader, am as UNSAFE_useFogOFWarDiscovery, aq as UNSAFE_useScrollRestoration, aa as URLSearchParamsInit, K as createBrowserRouter, Q as createHashRouter, o as createMemoryRouter, p as createRoutesFromChildren, q as createRoutesFromElements, ac as createSearchParams, r as renderMatches, W as unstable_HistoryRouter, a5 as unstable_usePrompt, a4 as useBeforeUnload, a2 as useFetcher, a3 as useFetchers, a1 as useFormAction, _ as useLinkClickHandler, $ as useSearchParams, a0 as useSubmit, a6 as useViewTransitionState } from './fog-of-war-
|
|
1
|
+
import { a as Router, b as RouteModules, D as DataStrategyFunction, c as RouteManifest, S as ServerRouteModule, M as MiddlewareEnabled, u as unstable_RouterContextProvider, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, d as RelativeRoutingType, e as Location, f as Action, P as ParamParseKey, g as Path, h as PathPattern, i as PathMatch, N as NavigateOptions, j as Params$1, k as RouteObject, l as Navigation, m as RevalidationState, U as UIMatch, n as SerializeFrom, B as BlockerFunction, o as Blocker, p as StaticHandlerContext, q as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, r as unstable_InitialContext, s as IndexRouteObject, t as LoaderFunction, v as ActionFunction, w as MetaFunction, x as LinksFunction, y as NonIndexRouteObject, E as Equal, z as RouterState, G as DataRouteObject, J as ClientLoaderFunction } from './route-data-C12CLHiN.js';
|
|
2
|
+
export { aw as ClientActionFunction, ax as ClientActionFunctionArgs, ay as ClientLoaderFunctionArgs, ar as DataRouteMatch, Z as DataStrategyFunctionArgs, _ as DataStrategyMatch, $ as DataStrategyResult, a1 as ErrorResponse, Q as Fetcher, a2 as FormEncType, a3 as FormMethod, aG as Future, K as GetScrollPositionFunction, O as GetScrollRestorationKeyFunction, a4 as HTMLFormMethod, az as HeadersArgs, aA as HeadersFunction, aE as HtmlLinkDescriptor, ah as IDLE_BLOCKER, ag as IDLE_FETCHER, af as IDLE_NAVIGATION, a5 as LazyRouteFunction, aF as LinkDescriptor, aB as MetaArgs, aC as MetaDescriptor, V as NavigationStates, as as Navigator, aD as PageLinkDescriptor, at as PatchRoutesOnNavigationFunction, au as PatchRoutesOnNavigationFunctionArgs, a7 as PathParam, a8 as RedirectFunction, av as RouteMatch, Y as RouterFetchOptions, R as RouterInit, X as RouterNavigateOptions, W as RouterSubscriber, aa as ShouldRevalidateFunction, ab as ShouldRevalidateFunctionArgs, aM as UNSAFE_DataRouterContext, aN as UNSAFE_DataRouterStateContext, a0 as UNSAFE_DataWithResponseInit, aL as UNSAFE_ErrorResponseImpl, aO as UNSAFE_FetchersContext, aP as UNSAFE_LocationContext, aQ as UNSAFE_NavigationContext, aR as UNSAFE_RouteContext, aS as UNSAFE_ViewTransitionContext, aI as UNSAFE_createBrowserHistory, aK as UNSAFE_createRouter, aJ as UNSAFE_invariant, ad as createPath, ai as data, aj as generatePath, ak as isRouteErrorResponse, al as matchPath, am as matchRoutes, ae as parsePath, an as redirect, ao as redirectDocument, ap as replace, aq as resolvePath, a6 as unstable_MiddlewareFunction, a9 as unstable_RouterContext, aH as unstable_SerializesTo, ac as unstable_createContext } from './route-data-C12CLHiN.js';
|
|
3
|
+
import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext, C as CriticalCss } from './fog-of-war-BLArG-qZ.js';
|
|
4
|
+
export { g as Await, b as AwaitProps, T as BrowserRouter, B as BrowserRouterProps, D as DOMRouterOpts, w as FetcherFormProps, G as FetcherSubmitFunction, a7 as FetcherSubmitOptions, J as FetcherWithComponents, Y as Form, x as FormProps, U as HashRouter, H as HashRouterProps, s as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, V as Link, t as LinkProps, ae as Links, h as MemoryRouter, M as MemoryRouterOpts, c as MemoryRouterProps, ad as Meta, X as NavLink, u as NavLinkProps, v as NavLinkRenderProps, i as Navigate, N as NavigateProps, j as Outlet, O as OutletProps, a8 as ParamKeyValuePair, P as PathRouteProps, ag as PrefetchPageLinks, k as Route, d as RouteProps, l as Router, e as RouterProps, m as RouterProvider, R as RouterProviderProps, n as Routes, f as RoutesProps, af as Scripts, ah as ScriptsProps, Z as ScrollRestoration, S as ScrollRestorationProps, y as SetURLSearchParams, z as SubmitFunction, a9 as SubmitOptions, ab as SubmitTarget, ak as UNSAFE_FrameworkContext, an as UNSAFE_createClientRoutes, ao as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, al as UNSAFE_getPatchRoutesOnNavigationFunction, ai as UNSAFE_hydrationRouteProperties, aj as UNSAFE_mapRouteProperties, ap as UNSAFE_shouldHydrateRouteLoader, am as UNSAFE_useFogOFWarDiscovery, aq as UNSAFE_useScrollRestoration, aa as URLSearchParamsInit, K as createBrowserRouter, Q as createHashRouter, o as createMemoryRouter, p as createRoutesFromChildren, q as createRoutesFromElements, ac as createSearchParams, r as renderMatches, W as unstable_HistoryRouter, a5 as unstable_usePrompt, a4 as useBeforeUnload, a2 as useFetcher, a3 as useFetchers, a1 as useFormAction, _ as useLinkClickHandler, $ as useSearchParams, a0 as useSubmit, a6 as useViewTransitionState } from './fog-of-war-BLArG-qZ.js';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { ReactElement } from 'react';
|
|
7
7
|
import { ParseOptions, SerializeOptions } from 'cookie';
|
|
@@ -9,12 +9,7 @@ export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerialize
|
|
|
9
9
|
import { A as AppLoadContext } from './data-CQbyyGzl.js';
|
|
10
10
|
|
|
11
11
|
declare const SingleFetchRedirectSymbol: unique symbol;
|
|
12
|
-
|
|
13
|
-
hasLoader: boolean;
|
|
14
|
-
hasClientLoader: boolean;
|
|
15
|
-
hasShouldRevalidate: boolean | undefined;
|
|
16
|
-
};
|
|
17
|
-
declare function getSingleFetchDataStrategy(getRouter: () => Router, getRouteInfo: GetRouteInfoFunction, ssr: boolean, basename: string | undefined): DataStrategyFunction;
|
|
12
|
+
declare function getTurboStreamSingleFetchDataStrategy(getRouter: () => Router, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, basename: string | undefined): DataStrategyFunction;
|
|
18
13
|
declare function decodeViaTurboStream(body: ReadableStream<Uint8Array>, global: Window | typeof globalThis): Promise<{
|
|
19
14
|
done: Promise<undefined>;
|
|
20
15
|
value: unknown;
|
|
@@ -620,7 +615,7 @@ interface SessionData {
|
|
|
620
615
|
/**
|
|
621
616
|
* Session persists data across HTTP requests.
|
|
622
617
|
*
|
|
623
|
-
* @see https://
|
|
618
|
+
* @see https://reactrouter.com/explanation/sessions-and-cookies#sessions
|
|
624
619
|
*/
|
|
625
620
|
interface Session<Data = SessionData, FlashData = Data> {
|
|
626
621
|
/**
|
|
@@ -670,15 +665,13 @@ type CreateSessionFunction = <Data = SessionData, FlashData = Data>(initialData?
|
|
|
670
665
|
*
|
|
671
666
|
* Note: This function is typically not invoked directly by application code.
|
|
672
667
|
* Instead, use a `SessionStorage` object's `getSession` method.
|
|
673
|
-
*
|
|
674
|
-
* @see https://remix.run/utils/sessions#createsession
|
|
675
668
|
*/
|
|
676
669
|
declare const createSession: CreateSessionFunction;
|
|
677
670
|
type IsSessionFunction = (object: any) => object is Session;
|
|
678
671
|
/**
|
|
679
|
-
* Returns true if an object is a
|
|
672
|
+
* Returns true if an object is a React Router session.
|
|
680
673
|
*
|
|
681
|
-
* @see https://
|
|
674
|
+
* @see https://reactrouter.com/api/utils/isSession
|
|
682
675
|
*/
|
|
683
676
|
declare const isSession: IsSessionFunction;
|
|
684
677
|
/**
|
|
@@ -842,4 +835,14 @@ declare class RemixErrorBoundary extends React.Component<RemixErrorBoundaryProps
|
|
|
842
835
|
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
843
836
|
}
|
|
844
837
|
|
|
845
|
-
|
|
838
|
+
declare function getHydrationData(state: {
|
|
839
|
+
loaderData?: Router["state"]["loaderData"];
|
|
840
|
+
actionData?: Router["state"]["actionData"];
|
|
841
|
+
errors?: Router["state"]["errors"];
|
|
842
|
+
}, routes: DataRouteObject[], getRouteInfo: (routeId: string) => {
|
|
843
|
+
clientLoader: ClientLoaderFunction | undefined;
|
|
844
|
+
hasLoader: boolean;
|
|
845
|
+
hasHydrateFallback: boolean;
|
|
846
|
+
}, location: Path, basename: string | undefined, isSpaMode: boolean): HydrationState;
|
|
847
|
+
|
|
848
|
+
export { ActionFunction, ActionFunctionArgs, AppLoadContext, Blocker, BlockerFunction, ClientLoaderFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, DataRouteObject, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, LoaderFunctionArgs, Location, MetaFunction, type NavigateFunction, NavigateOptions, Navigation, Action as NavigationType, NonIndexRouteObject, ParamParseKey, Params$1 as Params, Path, PathMatch, PathPattern, type Register, RelativeRoutingType, type RequestHandler, RevalidationState, RouteObject, RouterState, type RoutesTestStubProps, type ServerBuild, type ServerEntryModule, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, To, UIMatch, AssetsManifest as UNSAFE_AssetsManifest, MiddlewareEnabled as UNSAFE_MiddlewareEnabled, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getHydrationData as UNSAFE_getHydrationData, getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy, createCookie, createCookieSessionStorage, createMemorySessionStorage, createRequestHandler, createRoutesStub, createSession, createSessionStorage, createStaticHandler, createStaticRouter, href, isCookie, isSession, unstable_InitialContext, unstable_RouterContextProvider, setDevServerHooks as unstable_setDevServerHooks, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
|
package/dist/production/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.5.
|
|
2
|
+
* react-router v7.5.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -89,8 +89,9 @@ __export(react_router_exports, {
|
|
|
89
89
|
UNSAFE_createRouter: () => createRouter,
|
|
90
90
|
UNSAFE_decodeViaTurboStream: () => decodeViaTurboStream,
|
|
91
91
|
UNSAFE_deserializeErrors: () => deserializeErrors2,
|
|
92
|
+
UNSAFE_getHydrationData: () => getHydrationData,
|
|
92
93
|
UNSAFE_getPatchRoutesOnNavigationFunction: () => getPatchRoutesOnNavigationFunction,
|
|
93
|
-
|
|
94
|
+
UNSAFE_getTurboStreamSingleFetchDataStrategy: () => getTurboStreamSingleFetchDataStrategy,
|
|
94
95
|
UNSAFE_hydrationRouteProperties: () => hydrationRouteProperties,
|
|
95
96
|
UNSAFE_invariant: () => invariant,
|
|
96
97
|
UNSAFE_mapRouteProperties: () => mapRouteProperties,
|
|
@@ -6461,6 +6462,7 @@ async function createRequestInit(request) {
|
|
|
6461
6462
|
|
|
6462
6463
|
// lib/dom/ssr/single-fetch.tsx
|
|
6463
6464
|
var SingleFetchRedirectSymbol = Symbol("SingleFetchRedirect");
|
|
6465
|
+
var SINGLE_FETCH_REDIRECT_STATUS = 202;
|
|
6464
6466
|
var NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([100, 101, 204, 205]);
|
|
6465
6467
|
function StreamTransfer({
|
|
6466
6468
|
context,
|
|
@@ -6528,10 +6530,19 @@ function StreamTransfer({
|
|
|
6528
6530
|
)));
|
|
6529
6531
|
}
|
|
6530
6532
|
}
|
|
6531
|
-
function
|
|
6533
|
+
function getTurboStreamSingleFetchDataStrategy(getRouter, manifest, routeModules, ssr, basename) {
|
|
6532
6534
|
let dataStrategy = getSingleFetchDataStrategyImpl(
|
|
6533
6535
|
getRouter,
|
|
6534
|
-
|
|
6536
|
+
(match) => {
|
|
6537
|
+
let manifestRoute = manifest.routes[match.route.id];
|
|
6538
|
+
invariant2(manifestRoute, "Route not found in manifest");
|
|
6539
|
+
let routeModule = routeModules[match.route.id];
|
|
6540
|
+
return {
|
|
6541
|
+
hasLoader: manifestRoute.hasLoader,
|
|
6542
|
+
hasClientLoader: manifestRoute.hasClientLoader,
|
|
6543
|
+
hasShouldRevalidate: Boolean(routeModule?.shouldRevalidate)
|
|
6544
|
+
};
|
|
6545
|
+
},
|
|
6535
6546
|
fetchAndDecodeViaTurboStream,
|
|
6536
6547
|
ssr,
|
|
6537
6548
|
basename
|
|
@@ -6546,7 +6557,7 @@ function getSingleFetchDataStrategyImpl(getRouter, getRouteInfo, fetchAndDecode,
|
|
|
6546
6557
|
return singleFetchActionStrategy(args, fetchAndDecode, basename);
|
|
6547
6558
|
}
|
|
6548
6559
|
let foundRevalidatingServerLoader = matches.some((m) => {
|
|
6549
|
-
let { hasLoader, hasClientLoader } = getRouteInfo(m
|
|
6560
|
+
let { hasLoader, hasClientLoader } = getRouteInfo(m);
|
|
6550
6561
|
return m.unstable_shouldCallHandler() && hasLoader && !hasClientLoader;
|
|
6551
6562
|
});
|
|
6552
6563
|
if (!ssr && !foundRevalidatingServerLoader) {
|
|
@@ -6598,7 +6609,7 @@ async function nonSsrStrategy(args, getRouteInfo, fetchAndDecode, basename) {
|
|
|
6598
6609
|
matchesToLoad.map(
|
|
6599
6610
|
(m) => m.resolve(async (handler) => {
|
|
6600
6611
|
try {
|
|
6601
|
-
let { hasClientLoader } = getRouteInfo(m
|
|
6612
|
+
let { hasClientLoader } = getRouteInfo(m);
|
|
6602
6613
|
let routeId = m.route.id;
|
|
6603
6614
|
let result = hasClientLoader ? await handler(async () => {
|
|
6604
6615
|
let { data: data2 } = await fetchAndDecode(args, basename, [routeId]);
|
|
@@ -6624,7 +6635,7 @@ async function singleFetchLoaderNavigationStrategy(args, router, getRouteInfo, f
|
|
|
6624
6635
|
async (m, i) => m.resolve(async (handler) => {
|
|
6625
6636
|
routeDfds[i].resolve();
|
|
6626
6637
|
let routeId = m.route.id;
|
|
6627
|
-
let { hasLoader, hasClientLoader, hasShouldRevalidate } = getRouteInfo(
|
|
6638
|
+
let { hasLoader, hasClientLoader, hasShouldRevalidate } = getRouteInfo(m);
|
|
6628
6639
|
let defaultShouldRevalidate = !m.unstable_shouldRevalidateArgs || m.unstable_shouldRevalidateArgs.actionStatus == null || m.unstable_shouldRevalidateArgs.actionStatus < 400;
|
|
6629
6640
|
let shouldCall = m.unstable_shouldCallHandler(defaultShouldRevalidate);
|
|
6630
6641
|
if (!shouldCall) {
|
|
@@ -6665,7 +6676,7 @@ async function singleFetchLoaderNavigationStrategy(args, router, getRouteInfo, f
|
|
|
6665
6676
|
);
|
|
6666
6677
|
await Promise.all(routeDfds.map((d) => d.promise));
|
|
6667
6678
|
if ((!router.state.initialized || routesParams.size === 0) && !window.__reactRouterHdrActive) {
|
|
6668
|
-
singleFetchDfd.resolve({});
|
|
6679
|
+
singleFetchDfd.resolve({ routes: {} });
|
|
6669
6680
|
} else {
|
|
6670
6681
|
let targetRoutes = ssr && foundOptOutRoute && routesParams.size > 0 ? [...routesParams.keys()] : void 0;
|
|
6671
6682
|
try {
|
|
@@ -6733,6 +6744,20 @@ async function fetchAndDecodeViaTurboStream(args, basename, targetRoutes) {
|
|
|
6733
6744
|
if (res.status === 404 && !res.headers.has("X-Remix-Response")) {
|
|
6734
6745
|
throw new ErrorResponseImpl(404, "Not Found", true);
|
|
6735
6746
|
}
|
|
6747
|
+
if (res.status === 204 && res.headers.has("X-Remix-Redirect")) {
|
|
6748
|
+
return {
|
|
6749
|
+
status: SINGLE_FETCH_REDIRECT_STATUS,
|
|
6750
|
+
data: {
|
|
6751
|
+
redirect: {
|
|
6752
|
+
redirect: res.headers.get("X-Remix-Redirect"),
|
|
6753
|
+
status: Number(res.headers.get("X-Remix-Status") || "302"),
|
|
6754
|
+
revalidate: res.headers.get("X-Remix-Revalidate") === "true",
|
|
6755
|
+
reload: res.headers.get("X-Remix-Reload-Document") === "true",
|
|
6756
|
+
replace: res.headers.get("X-Remix-Replace") === "true"
|
|
6757
|
+
}
|
|
6758
|
+
}
|
|
6759
|
+
};
|
|
6760
|
+
}
|
|
6736
6761
|
if (NO_BODY_STATUS_CODES.has(res.status)) {
|
|
6737
6762
|
let routes = {};
|
|
6738
6763
|
if (targetRoutes && request.method !== "GET") {
|
|
@@ -7183,8 +7208,9 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
|
|
|
7183
7208
|
}
|
|
7184
7209
|
};
|
|
7185
7210
|
dataRoute.loader.hydrate = shouldHydrateRouteLoader(
|
|
7186
|
-
route,
|
|
7187
|
-
routeModule,
|
|
7211
|
+
route.id,
|
|
7212
|
+
routeModule.clientLoader,
|
|
7213
|
+
route.hasLoader,
|
|
7188
7214
|
isSpaMode
|
|
7189
7215
|
);
|
|
7190
7216
|
dataRoute.action = ({ request, params, context }, singleFetch) => {
|
|
@@ -7382,8 +7408,8 @@ function getRouteModuleComponent(routeModule) {
|
|
|
7382
7408
|
return routeModule.default;
|
|
7383
7409
|
}
|
|
7384
7410
|
}
|
|
7385
|
-
function shouldHydrateRouteLoader(
|
|
7386
|
-
return isSpaMode &&
|
|
7411
|
+
function shouldHydrateRouteLoader(routeId, clientLoader, hasLoader, isSpaMode) {
|
|
7412
|
+
return isSpaMode && routeId !== "root" || clientLoader != null && (clientLoader.hydrate === true || hasLoader !== true);
|
|
7387
7413
|
}
|
|
7388
7414
|
|
|
7389
7415
|
// lib/dom/ssr/fog-of-war.ts
|
|
@@ -8065,7 +8091,7 @@ function mergeRefs(...refs) {
|
|
|
8065
8091
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
8066
8092
|
try {
|
|
8067
8093
|
if (isBrowser) {
|
|
8068
|
-
window.__reactRouterVersion = "7.5.
|
|
8094
|
+
window.__reactRouterVersion = "7.5.2";
|
|
8069
8095
|
}
|
|
8070
8096
|
} catch (e) {
|
|
8071
8097
|
}
|
|
@@ -9168,7 +9194,12 @@ function ServerRouter({
|
|
|
9168
9194
|
let routeId = match.route.id;
|
|
9169
9195
|
let route = routeModules[routeId];
|
|
9170
9196
|
let manifestRoute = context.manifest.routes[routeId];
|
|
9171
|
-
if (route && manifestRoute && shouldHydrateRouteLoader(
|
|
9197
|
+
if (route && manifestRoute && shouldHydrateRouteLoader(
|
|
9198
|
+
routeId,
|
|
9199
|
+
route.clientLoader,
|
|
9200
|
+
manifestRoute.hasLoader,
|
|
9201
|
+
context.isSpaMode
|
|
9202
|
+
) && (route.HydrateFallback || !manifestRoute.hasLoader)) {
|
|
9172
9203
|
delete context.staticHandlerContext.loaderData[routeId];
|
|
9173
9204
|
}
|
|
9174
9205
|
}
|
|
@@ -9637,6 +9668,26 @@ function invariant3(value, message) {
|
|
|
9637
9668
|
}
|
|
9638
9669
|
}
|
|
9639
9670
|
|
|
9671
|
+
// lib/server-runtime/dev.ts
|
|
9672
|
+
var globalDevServerHooksKey = "__reactRouterDevServerHooks";
|
|
9673
|
+
function setDevServerHooks(devServerHooks) {
|
|
9674
|
+
globalThis[globalDevServerHooksKey] = devServerHooks;
|
|
9675
|
+
}
|
|
9676
|
+
function getDevServerHooks() {
|
|
9677
|
+
return globalThis[globalDevServerHooksKey];
|
|
9678
|
+
}
|
|
9679
|
+
function getBuildTimeHeader(request, headerName) {
|
|
9680
|
+
if (typeof process !== "undefined") {
|
|
9681
|
+
try {
|
|
9682
|
+
if (process.env?.IS_RR_BUILD_REQUEST === "yes") {
|
|
9683
|
+
return request.headers.get(headerName);
|
|
9684
|
+
}
|
|
9685
|
+
} catch (e) {
|
|
9686
|
+
}
|
|
9687
|
+
}
|
|
9688
|
+
return null;
|
|
9689
|
+
}
|
|
9690
|
+
|
|
9640
9691
|
// lib/server-runtime/routes.ts
|
|
9641
9692
|
function groupRoutesByParentId2(manifest) {
|
|
9642
9693
|
let routes = {};
|
|
@@ -9668,10 +9719,11 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
9668
9719
|
// Need to use RR's version in the param typed here to permit the optional
|
|
9669
9720
|
// context even though we know it'll always be provided in remix
|
|
9670
9721
|
loader: route.module.loader ? async (args) => {
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9722
|
+
let preRenderedData = getBuildTimeHeader(
|
|
9723
|
+
args.request,
|
|
9724
|
+
"X-React-Router-Prerender-Data"
|
|
9725
|
+
);
|
|
9726
|
+
if (preRenderedData != null) {
|
|
9675
9727
|
let encoded = preRenderedData ? decodeURI(preRenderedData) : preRenderedData;
|
|
9676
9728
|
invariant3(encoded, "Missing prerendered data for route");
|
|
9677
9729
|
let uint8array = new TextEncoder().encode(encoded);
|
|
@@ -9746,15 +9798,6 @@ function createServerHandoffString(serverHandoff) {
|
|
|
9746
9798
|
return escapeHtml2(JSON.stringify(serverHandoff));
|
|
9747
9799
|
}
|
|
9748
9800
|
|
|
9749
|
-
// lib/server-runtime/dev.ts
|
|
9750
|
-
var globalDevServerHooksKey = "__reactRouterDevServerHooks";
|
|
9751
|
-
function setDevServerHooks(devServerHooks) {
|
|
9752
|
-
globalThis[globalDevServerHooksKey] = devServerHooks;
|
|
9753
|
-
}
|
|
9754
|
-
function getDevServerHooks() {
|
|
9755
|
-
return globalThis[globalDevServerHooksKey];
|
|
9756
|
-
}
|
|
9757
|
-
|
|
9758
9801
|
// lib/server-runtime/single-fetch.ts
|
|
9759
9802
|
var import_turbo_stream2 = require("turbo-stream");
|
|
9760
9803
|
|
|
@@ -9825,7 +9868,6 @@ function prependCookies(parentHeaders, childHeaders) {
|
|
|
9825
9868
|
}
|
|
9826
9869
|
|
|
9827
9870
|
// lib/server-runtime/single-fetch.ts
|
|
9828
|
-
var SINGLE_FETCH_REDIRECT_STATUS = 202;
|
|
9829
9871
|
var SERVER_NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([
|
|
9830
9872
|
...NO_BODY_STATUS_CODES,
|
|
9831
9873
|
304
|
|
@@ -10164,9 +10206,10 @@ Error: ${e instanceof Error ? e.toString() : e}`
|
|
|
10164
10206
|
if (stripBasename(normalizedPath, normalizedBasename) !== "/" && normalizedPath.endsWith("/")) {
|
|
10165
10207
|
normalizedPath = normalizedPath.slice(0, -1);
|
|
10166
10208
|
}
|
|
10209
|
+
let isSpaMode = getBuildTimeHeader(request, "X-React-Router-SPA-Mode") === "yes";
|
|
10167
10210
|
if (!_build.ssr) {
|
|
10168
10211
|
if (_build.prerender.length === 0) {
|
|
10169
|
-
|
|
10212
|
+
isSpaMode = true;
|
|
10170
10213
|
} else if (!_build.prerender.includes(normalizedPath) && !_build.prerender.includes(normalizedPath + "/")) {
|
|
10171
10214
|
if (url.pathname.endsWith(".data")) {
|
|
10172
10215
|
errorHandler(
|
|
@@ -10186,7 +10229,7 @@ Error: ${e instanceof Error ? e.toString() : e}`
|
|
|
10186
10229
|
statusText: "Not Found"
|
|
10187
10230
|
});
|
|
10188
10231
|
} else {
|
|
10189
|
-
|
|
10232
|
+
isSpaMode = true;
|
|
10190
10233
|
}
|
|
10191
10234
|
}
|
|
10192
10235
|
}
|
|
@@ -10255,7 +10298,7 @@ Error: ${e instanceof Error ? e.toString() : e}`
|
|
|
10255
10298
|
);
|
|
10256
10299
|
}
|
|
10257
10300
|
}
|
|
10258
|
-
} else if (!
|
|
10301
|
+
} else if (!isSpaMode && matches && matches[matches.length - 1].route.module.default == null && matches[matches.length - 1].route.module.ErrorBoundary == null) {
|
|
10259
10302
|
response = await handleResourceRequest(
|
|
10260
10303
|
serverMode,
|
|
10261
10304
|
_build,
|
|
@@ -10280,6 +10323,7 @@ Error: ${e instanceof Error ? e.toString() : e}`
|
|
|
10280
10323
|
request,
|
|
10281
10324
|
loadContext,
|
|
10282
10325
|
handleError,
|
|
10326
|
+
isSpaMode,
|
|
10283
10327
|
criticalCss
|
|
10284
10328
|
);
|
|
10285
10329
|
}
|
|
@@ -10355,8 +10399,7 @@ async function handleSingleFetchRequest(serverMode, build, staticHandler, reques
|
|
|
10355
10399
|
);
|
|
10356
10400
|
return response;
|
|
10357
10401
|
}
|
|
10358
|
-
async function handleDocumentRequest(serverMode, build, staticHandler, request, loadContext, handleError, criticalCss) {
|
|
10359
|
-
let isSpaMode = request.headers.has("X-React-Router-SPA-Mode");
|
|
10402
|
+
async function handleDocumentRequest(serverMode, build, staticHandler, request, loadContext, handleError, isSpaMode, criticalCss) {
|
|
10360
10403
|
try {
|
|
10361
10404
|
let response = await staticHandler.query(request, {
|
|
10362
10405
|
requestContext: loadContext,
|
|
@@ -10629,7 +10672,7 @@ function createSessionStorage({
|
|
|
10629
10672
|
function warnOnceAboutSigningSessionCookie(cookie) {
|
|
10630
10673
|
warnOnce(
|
|
10631
10674
|
cookie.isSigned,
|
|
10632
|
-
`The "${cookie.name}" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://
|
|
10675
|
+
`The "${cookie.name}" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://reactrouter.com/explanation/sessions-and-cookies#signing-cookies for more information.`
|
|
10633
10676
|
);
|
|
10634
10677
|
}
|
|
10635
10678
|
|
|
@@ -10745,6 +10788,32 @@ function deserializeErrors2(errors) {
|
|
|
10745
10788
|
}
|
|
10746
10789
|
return serialized;
|
|
10747
10790
|
}
|
|
10791
|
+
|
|
10792
|
+
// lib/dom/ssr/hydration.tsx
|
|
10793
|
+
function getHydrationData(state, routes, getRouteInfo, location, basename, isSpaMode) {
|
|
10794
|
+
let hydrationData = {
|
|
10795
|
+
...state,
|
|
10796
|
+
loaderData: { ...state.loaderData }
|
|
10797
|
+
};
|
|
10798
|
+
let initialMatches = matchRoutes(routes, location, basename);
|
|
10799
|
+
if (initialMatches) {
|
|
10800
|
+
for (let match of initialMatches) {
|
|
10801
|
+
let routeId = match.route.id;
|
|
10802
|
+
let routeInfo = getRouteInfo(routeId);
|
|
10803
|
+
if (shouldHydrateRouteLoader(
|
|
10804
|
+
routeId,
|
|
10805
|
+
routeInfo.clientLoader,
|
|
10806
|
+
routeInfo.hasLoader,
|
|
10807
|
+
isSpaMode
|
|
10808
|
+
) && (routeInfo.hasHydrateFallback || !routeInfo.hasLoader)) {
|
|
10809
|
+
delete hydrationData.loaderData[routeId];
|
|
10810
|
+
} else if (!routeInfo.hasLoader) {
|
|
10811
|
+
hydrationData.loaderData[routeId] = null;
|
|
10812
|
+
}
|
|
10813
|
+
}
|
|
10814
|
+
}
|
|
10815
|
+
return hydrationData;
|
|
10816
|
+
}
|
|
10748
10817
|
// Annotate the CommonJS export names for ESM import in node:
|
|
10749
10818
|
0 && (module.exports = {
|
|
10750
10819
|
Await,
|
|
@@ -10790,8 +10859,9 @@ function deserializeErrors2(errors) {
|
|
|
10790
10859
|
UNSAFE_createRouter,
|
|
10791
10860
|
UNSAFE_decodeViaTurboStream,
|
|
10792
10861
|
UNSAFE_deserializeErrors,
|
|
10862
|
+
UNSAFE_getHydrationData,
|
|
10793
10863
|
UNSAFE_getPatchRoutesOnNavigationFunction,
|
|
10794
|
-
|
|
10864
|
+
UNSAFE_getTurboStreamSingleFetchDataStrategy,
|
|
10795
10865
|
UNSAFE_hydrationRouteProperties,
|
|
10796
10866
|
UNSAFE_invariant,
|
|
10797
10867
|
UNSAFE_mapRouteProperties,
|