react-router 7.6.1 → 7.6.3-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 +28 -0
- package/dist/development/{chunk-DQRVZFIR.mjs → chunk-CCB6XHGW.mjs} +48 -39
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.js +1 -1
- package/dist/development/dom-export.mjs +2 -2
- package/dist/development/index.d.mts +8 -389
- package/dist/development/index.d.ts +819 -799
- package/dist/development/index.js +51 -39
- package/dist/development/index.mjs +9 -3
- package/dist/development/lib/types/internal.d.mts +7 -71
- package/dist/development/lib/types/internal.d.ts +7 -71
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/{production/lib-B8x_tOvL.d.mts → development/lib-B33EY9A0.d.mts} +537 -136
- package/dist/{production/register-BkDIKxVz.d.ts → development/register-COAKzST_.d.ts} +68 -2
- package/dist/{production/route-data-WyrduLgj.d.mts → development/route-data-D7Xbr_Ww.d.mts} +68 -2
- package/dist/production/{chunk-UG2XJOVM.mjs → chunk-2T4DELW3.mjs} +48 -39
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.js +1 -1
- package/dist/production/dom-export.mjs +2 -2
- package/dist/production/index.d.mts +8 -389
- package/dist/production/index.d.ts +819 -799
- package/dist/production/index.js +51 -39
- package/dist/production/index.mjs +9 -3
- package/dist/production/lib/types/internal.d.mts +7 -71
- package/dist/production/lib/types/internal.d.ts +7 -71
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/{development/lib-B8x_tOvL.d.mts → production/lib-B33EY9A0.d.mts} +537 -136
- package/dist/{development/register-BkDIKxVz.d.ts → production/register-COAKzST_.d.ts} +68 -2
- package/dist/{development/route-data-WyrduLgj.d.mts → production/route-data-D7Xbr_Ww.d.mts} +68 -2
- package/package.json +1 -1
|
@@ -1767,7 +1767,73 @@ type ClientData<T> = T extends Response ? never : T extends DataWithResponseInit
|
|
|
1767
1767
|
type ServerData<T> = T extends Response ? never : T extends DataWithResponseInit<infer U> ? Serialize<U> : Serialize<T>;
|
|
1768
1768
|
type ServerDataFrom<T> = ServerData<DataFrom<T>>;
|
|
1769
1769
|
type ClientDataFrom<T> = ClientData<DataFrom<T>>;
|
|
1770
|
-
type
|
|
1770
|
+
type ClientDataFunctionArgs<Params> = {
|
|
1771
|
+
/**
|
|
1772
|
+
* A {@link https://developer.mozilla.org/en-US/docs/Web/API/Request Fetch Request instance} which you can use to read the URL, the method, the "content-type" header, and the request body from the request.
|
|
1773
|
+
*
|
|
1774
|
+
* @note Because client data functions are called before a network request is made, the Request object does not include the headers which the browser automatically adds. React Router infers the "content-type" header from the enc-type of the form that performed the submission.
|
|
1775
|
+
**/
|
|
1776
|
+
request: Request;
|
|
1777
|
+
/**
|
|
1778
|
+
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
|
1779
|
+
* @example
|
|
1780
|
+
* // app/routes.ts
|
|
1781
|
+
* route("teams/:teamId", "./team.tsx"),
|
|
1782
|
+
*
|
|
1783
|
+
* // app/team.tsx
|
|
1784
|
+
* export function clientLoader({
|
|
1785
|
+
* params,
|
|
1786
|
+
* }: Route.ClientLoaderArgs) {
|
|
1787
|
+
* params.teamId;
|
|
1788
|
+
* // ^ string
|
|
1789
|
+
* }
|
|
1790
|
+
**/
|
|
1791
|
+
params: Params;
|
|
1792
|
+
/**
|
|
1793
|
+
* When `future.unstable_middleware` is not enabled, this is undefined.
|
|
1794
|
+
*
|
|
1795
|
+
* When `future.unstable_middleware` is enabled, this is an instance of
|
|
1796
|
+
* `unstable_RouterContextProvider` and can be used to access context values
|
|
1797
|
+
* from your route middlewares. You may pass in initial context values in your
|
|
1798
|
+
* `<HydratedRouter unstable_getContext>` prop
|
|
1799
|
+
*/
|
|
1800
|
+
context: unstable_RouterContextProvider;
|
|
1801
|
+
};
|
|
1802
|
+
type ServerDataFunctionArgs<Params> = {
|
|
1803
|
+
/** A {@link https://developer.mozilla.org/en-US/docs/Web/API/Request Fetch Request instance} which you can use to read the url, method, headers (such as cookies), and request body from the request. */
|
|
1804
|
+
request: Request;
|
|
1805
|
+
/**
|
|
1806
|
+
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
|
1807
|
+
* @example
|
|
1808
|
+
* // app/routes.ts
|
|
1809
|
+
* route("teams/:teamId", "./team.tsx"),
|
|
1810
|
+
*
|
|
1811
|
+
* // app/team.tsx
|
|
1812
|
+
* export function loader({
|
|
1813
|
+
* params,
|
|
1814
|
+
* }: Route.LoaderArgs) {
|
|
1815
|
+
* params.teamId;
|
|
1816
|
+
* // ^ string
|
|
1817
|
+
* }
|
|
1818
|
+
**/
|
|
1819
|
+
params: Params;
|
|
1820
|
+
/**
|
|
1821
|
+
* Without `future.unstable_middleware` enabled, this is the context passed in
|
|
1822
|
+
* to your server adapter's `getLoadContext` function. It's a way to bridge the
|
|
1823
|
+
* gap between the adapter's request/response API with your React Router app.
|
|
1824
|
+
* It is only applicable if you are using a custom server adapter.
|
|
1825
|
+
*
|
|
1826
|
+
* With `future.unstable_middleware` enabled, this is an instance of
|
|
1827
|
+
* `unstable_RouterContextProvider` and can be used for type-safe access to
|
|
1828
|
+
* context value set in your route middlewares. If you are using a custom
|
|
1829
|
+
* server adapter, you may provide an initial set of context values from your
|
|
1830
|
+
* `getLoadContext` function.
|
|
1831
|
+
*/
|
|
1832
|
+
context: MiddlewareEnabled extends true ? unstable_RouterContextProvider : AppLoadContext;
|
|
1833
|
+
};
|
|
1834
|
+
type SerializeFrom<T> = T extends (...args: infer Args) => unknown ? Args extends [
|
|
1835
|
+
ClientLoaderFunctionArgs | ClientActionFunctionArgs | ClientDataFunctionArgs<unknown>
|
|
1836
|
+
] ? ClientDataFrom<T> : ServerDataFrom<T> : T;
|
|
1771
1837
|
type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
|
|
1772
1838
|
type IsHydrate<ClientLoader> = ClientLoader extends {
|
|
1773
1839
|
hydrate: true;
|
|
@@ -1813,4 +1879,4 @@ type RouteFiles = Register extends {
|
|
|
1813
1879
|
routeFiles: infer Registered extends AnyRouteFiles;
|
|
1814
1880
|
} ? Registered : AnyRouteFiles;
|
|
1815
1881
|
|
|
1816
|
-
export { type Equal as $,
|
|
1882
|
+
export { type Equal as $, type AppLoadContext as A, type BlockerFunction as B, type ClientLoaderFunction as C, type DataRouteObject as D, type PageLinkDescriptor as E, type FutureConfig as F, type History as G, type HydrationState as H, type IndexRouteObject as I, type GetScrollRestorationKeyFunction as J, type Fetcher as K, type LoaderFunctionArgs as L, type MiddlewareEnabled as M, type NavigateOptions as N, type CreateStaticHandlerOptions as O, type ParamParseKey as P, type StaticHandler as Q, type RouteManifest as R, type ServerRouteModule as S, type To as T, type UIMatch as U, type LoaderFunction as V, type ActionFunction as W, type MetaFunction as X, type LinksFunction as Y, type unstable_InitialContext as Z, type Pages as _, type ActionFunctionArgs as a, type unstable_MiddlewareNextFunction as a$, type RouterState as a0, type GetScrollPositionFunction as a1, type NavigationStates as a2, type RouterSubscriber as a3, type RouterNavigateOptions as a4, type RouterFetchOptions as a5, type RevalidationState as a6, type DataStrategyFunctionArgs as a7, type DataStrategyMatch as a8, type DataStrategyResult as a9, type ClientActionFunction as aA, type ClientActionFunctionArgs as aB, type ClientLoaderFunctionArgs as aC, type HeadersArgs as aD, type HeadersFunction as aE, type MetaArgs as aF, type MetaDescriptor as aG, type HtmlLinkDescriptor as aH, type LinkDescriptor as aI, type Future as aJ, type unstable_SerializesTo as aK, type Register as aL, createBrowserHistory as aM, invariant as aN, createRouter as aO, ErrorResponseImpl as aP, DataRouterContext as aQ, DataRouterStateContext as aR, FetchersContext as aS, LocationContext as aT, NavigationContext as aU, RouteContext as aV, ViewTransitionContext as aW, type RouteModule as aX, type Pretty as aY, type GetLoaderData as aZ, type ServerDataFunctionArgs as a_, DataWithResponseInit as aa, type ErrorResponse as ab, type FormMethod as ac, type unstable_MiddlewareFunction as ad, type PathParam as ae, type RedirectFunction as af, type unstable_RouterContext as ag, type ShouldRevalidateFunction as ah, type ShouldRevalidateFunctionArgs as ai, unstable_createContext as aj, createPath as ak, parsePath as al, IDLE_NAVIGATION as am, IDLE_FETCHER as an, IDLE_BLOCKER as ao, data as ap, generatePath as aq, isRouteErrorResponse as ar, matchPath as as, matchRoutes as at, redirect as au, redirectDocument as av, replace as aw, resolvePath as ax, type DataRouteMatch as ay, type PatchRoutesOnNavigationFunctionArgs as az, type RouteModules as b, type ClientDataFunctionArgs as b0, type ServerDataFrom as b1, type RouteFiles as b2, type Normalize as b3, type GetActionData as b4, type StaticHandlerContext as c, type Router as d, type DataStrategyFunction as e, type Blocker as f, type SerializeFrom as g, type RelativeRoutingType as h, type Location as i, type Path as j, type PathPattern as k, type PathMatch as l, type Navigation as m, Action as n, type Params as o, type RouteObject as p, type LazyRouteFunction as q, type NonIndexRouteObject as r, type RouterInit as s, type InitialEntry as t, unstable_RouterContextProvider as u, type PatchRoutesOnNavigationFunction as v, type Navigator as w, type RouteMatch as x, type HTMLFormMethod as y, type FormEncType as z };
|
|
@@ -1767,7 +1767,73 @@ type ClientData<T> = T extends Response ? never : T extends DataWithResponseInit
|
|
|
1767
1767
|
type ServerData<T> = T extends Response ? never : T extends DataWithResponseInit<infer U> ? Serialize<U> : Serialize<T>;
|
|
1768
1768
|
type ServerDataFrom<T> = ServerData<DataFrom<T>>;
|
|
1769
1769
|
type ClientDataFrom<T> = ClientData<DataFrom<T>>;
|
|
1770
|
-
type
|
|
1770
|
+
type ClientDataFunctionArgs<Params> = {
|
|
1771
|
+
/**
|
|
1772
|
+
* A {@link https://developer.mozilla.org/en-US/docs/Web/API/Request Fetch Request instance} which you can use to read the URL, the method, the "content-type" header, and the request body from the request.
|
|
1773
|
+
*
|
|
1774
|
+
* @note Because client data functions are called before a network request is made, the Request object does not include the headers which the browser automatically adds. React Router infers the "content-type" header from the enc-type of the form that performed the submission.
|
|
1775
|
+
**/
|
|
1776
|
+
request: Request;
|
|
1777
|
+
/**
|
|
1778
|
+
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
|
1779
|
+
* @example
|
|
1780
|
+
* // app/routes.ts
|
|
1781
|
+
* route("teams/:teamId", "./team.tsx"),
|
|
1782
|
+
*
|
|
1783
|
+
* // app/team.tsx
|
|
1784
|
+
* export function clientLoader({
|
|
1785
|
+
* params,
|
|
1786
|
+
* }: Route.ClientLoaderArgs) {
|
|
1787
|
+
* params.teamId;
|
|
1788
|
+
* // ^ string
|
|
1789
|
+
* }
|
|
1790
|
+
**/
|
|
1791
|
+
params: Params;
|
|
1792
|
+
/**
|
|
1793
|
+
* When `future.unstable_middleware` is not enabled, this is undefined.
|
|
1794
|
+
*
|
|
1795
|
+
* When `future.unstable_middleware` is enabled, this is an instance of
|
|
1796
|
+
* `unstable_RouterContextProvider` and can be used to access context values
|
|
1797
|
+
* from your route middlewares. You may pass in initial context values in your
|
|
1798
|
+
* `<HydratedRouter unstable_getContext>` prop
|
|
1799
|
+
*/
|
|
1800
|
+
context: unstable_RouterContextProvider;
|
|
1801
|
+
};
|
|
1802
|
+
type ServerDataFunctionArgs<Params> = {
|
|
1803
|
+
/** A {@link https://developer.mozilla.org/en-US/docs/Web/API/Request Fetch Request instance} which you can use to read the url, method, headers (such as cookies), and request body from the request. */
|
|
1804
|
+
request: Request;
|
|
1805
|
+
/**
|
|
1806
|
+
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
|
1807
|
+
* @example
|
|
1808
|
+
* // app/routes.ts
|
|
1809
|
+
* route("teams/:teamId", "./team.tsx"),
|
|
1810
|
+
*
|
|
1811
|
+
* // app/team.tsx
|
|
1812
|
+
* export function loader({
|
|
1813
|
+
* params,
|
|
1814
|
+
* }: Route.LoaderArgs) {
|
|
1815
|
+
* params.teamId;
|
|
1816
|
+
* // ^ string
|
|
1817
|
+
* }
|
|
1818
|
+
**/
|
|
1819
|
+
params: Params;
|
|
1820
|
+
/**
|
|
1821
|
+
* Without `future.unstable_middleware` enabled, this is the context passed in
|
|
1822
|
+
* to your server adapter's `getLoadContext` function. It's a way to bridge the
|
|
1823
|
+
* gap between the adapter's request/response API with your React Router app.
|
|
1824
|
+
* It is only applicable if you are using a custom server adapter.
|
|
1825
|
+
*
|
|
1826
|
+
* With `future.unstable_middleware` enabled, this is an instance of
|
|
1827
|
+
* `unstable_RouterContextProvider` and can be used for type-safe access to
|
|
1828
|
+
* context value set in your route middlewares. If you are using a custom
|
|
1829
|
+
* server adapter, you may provide an initial set of context values from your
|
|
1830
|
+
* `getLoadContext` function.
|
|
1831
|
+
*/
|
|
1832
|
+
context: MiddlewareEnabled extends true ? unstable_RouterContextProvider : AppLoadContext;
|
|
1833
|
+
};
|
|
1834
|
+
type SerializeFrom<T> = T extends (...args: infer Args) => unknown ? Args extends [
|
|
1835
|
+
ClientLoaderFunctionArgs | ClientActionFunctionArgs | ClientDataFunctionArgs<unknown>
|
|
1836
|
+
] ? ClientDataFrom<T> : ServerDataFrom<T> : T;
|
|
1771
1837
|
type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
|
|
1772
1838
|
type IsHydrate<ClientLoader> = ClientLoader extends {
|
|
1773
1839
|
hydrate: true;
|
|
@@ -1790,4 +1856,4 @@ type _DataActionData<ServerActionData, ClientActionData> = Awaited<[
|
|
|
1790
1856
|
IsDefined<ClientActionData>
|
|
1791
1857
|
] extends [true, true] ? ServerActionData | ClientActionData : IsDefined<ClientActionData> extends true ? ClientActionData : IsDefined<ServerActionData> extends true ? ServerActionData : undefined>;
|
|
1792
1858
|
|
|
1793
|
-
export { type
|
|
1859
|
+
export { type Params as $, type ActionFunction as A, type Blocker as B, type CreateStaticHandlerOptions as C, type DataStrategyFunction as D, type Equal as E, type FutureConfig as F, type GetScrollPositionFunction as G, type HydrationState as H, type InitialEntry as I, type DataStrategyMatch as J, type DataStrategyResult as K, type Location as L, type MetaFunction as M, type NonIndexRouteObject as N, DataWithResponseInit as O, type PatchRoutesOnNavigationFunction as P, type ErrorResponse as Q, type RouterInit as R, type StaticHandlerContext as S, type To as T, type FormEncType as U, type FormMethod as V, type HTMLFormMethod as W, type LazyRouteFunction as X, type LoaderFunctionArgs as Y, type unstable_MiddlewareFunction as Z, type ParamParseKey as _, type Router as a, type ServerDataFrom as a$, type PathMatch as a0, type PathParam as a1, type PathPattern as a2, type RedirectFunction as a3, type unstable_RouterContext as a4, type ShouldRevalidateFunction as a5, type ShouldRevalidateFunctionArgs as a6, type UIMatch as a7, unstable_createContext as a8, unstable_RouterContextProvider as a9, type MetaDescriptor as aA, type PageLinkDescriptor as aB, type HtmlLinkDescriptor as aC, type LinkDescriptor as aD, type Future as aE, type unstable_SerializesTo as aF, createBrowserHistory as aG, invariant as aH, createRouter as aI, ErrorResponseImpl as aJ, DataRouterContext as aK, DataRouterStateContext as aL, FetchersContext as aM, LocationContext as aN, NavigationContext as aO, RouteContext as aP, ViewTransitionContext as aQ, type RouteManifest as aR, type ServerRouteModule as aS, type SerializeFrom as aT, type History as aU, type RouteModule as aV, type Pretty as aW, type GetLoaderData as aX, type ServerDataFunctionArgs as aY, type unstable_MiddlewareNextFunction as aZ, type ClientDataFunctionArgs as a_, Action as aa, createPath as ab, parsePath as ac, IDLE_NAVIGATION as ad, IDLE_FETCHER as ae, IDLE_BLOCKER as af, data as ag, generatePath as ah, isRouteErrorResponse as ai, matchPath as aj, matchRoutes as ak, redirect as al, redirectDocument as am, replace as an, resolvePath as ao, type DataRouteMatch as ap, type NavigateOptions as aq, type Navigator as ar, type PatchRoutesOnNavigationFunctionArgs as as, type RouteMatch as at, type ClientActionFunction as au, type ClientActionFunctionArgs as av, type ClientLoaderFunctionArgs as aw, type HeadersArgs as ax, type HeadersFunction as ay, type MetaArgs as az, type RouteModules as b, type Normalize as b0, type GetActionData as b1, type RouteObject as c, type StaticHandler as d, type IndexRouteObject as e, type LoaderFunction as f, type LinksFunction as g, type MiddlewareEnabled as h, type AppLoadContext as i, type RouterState as j, type DataRouteObject as k, type ClientLoaderFunction as l, type Path as m, type GetScrollRestorationKeyFunction as n, type Fetcher as o, type Navigation as p, type NavigationStates as q, type RelativeRoutingType as r, type BlockerFunction as s, type RouterSubscriber as t, type unstable_InitialContext as u, type RouterNavigateOptions as v, type RouterFetchOptions as w, type RevalidationState as x, type ActionFunctionArgs as y, type DataStrategyFunctionArgs as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.6.
|
|
2
|
+
* react-router v7.6.3-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -5920,6 +5920,38 @@ var createRoutesFromElements = createRoutesFromChildren;
|
|
|
5920
5920
|
function renderMatches(matches) {
|
|
5921
5921
|
return _renderMatches(matches);
|
|
5922
5922
|
}
|
|
5923
|
+
function withComponentProps(Component4) {
|
|
5924
|
+
return function WithComponentProps() {
|
|
5925
|
+
const props = {
|
|
5926
|
+
params: useParams(),
|
|
5927
|
+
loaderData: useLoaderData(),
|
|
5928
|
+
actionData: useActionData(),
|
|
5929
|
+
matches: useMatches()
|
|
5930
|
+
};
|
|
5931
|
+
return React3.createElement(Component4, props);
|
|
5932
|
+
};
|
|
5933
|
+
}
|
|
5934
|
+
function withHydrateFallbackProps(HydrateFallback) {
|
|
5935
|
+
return function WithHydrateFallbackProps() {
|
|
5936
|
+
const props = {
|
|
5937
|
+
params: useParams(),
|
|
5938
|
+
loaderData: useLoaderData(),
|
|
5939
|
+
actionData: useActionData()
|
|
5940
|
+
};
|
|
5941
|
+
return React3.createElement(HydrateFallback, props);
|
|
5942
|
+
};
|
|
5943
|
+
}
|
|
5944
|
+
function withErrorBoundaryProps(ErrorBoundary) {
|
|
5945
|
+
return function WithErrorBoundaryProps() {
|
|
5946
|
+
const props = {
|
|
5947
|
+
params: useParams(),
|
|
5948
|
+
loaderData: useLoaderData(),
|
|
5949
|
+
actionData: useActionData(),
|
|
5950
|
+
error: useRouteError()
|
|
5951
|
+
};
|
|
5952
|
+
return React3.createElement(ErrorBoundary, props);
|
|
5953
|
+
};
|
|
5954
|
+
}
|
|
5923
5955
|
|
|
5924
5956
|
// lib/dom/lib.tsx
|
|
5925
5957
|
import * as React10 from "react";
|
|
@@ -8685,7 +8717,7 @@ function mergeRefs(...refs) {
|
|
|
8685
8717
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
8686
8718
|
try {
|
|
8687
8719
|
if (isBrowser) {
|
|
8688
|
-
window.__reactRouterVersion = "7.6.
|
|
8720
|
+
window.__reactRouterVersion = "7.6.3-pre.0";
|
|
8689
8721
|
}
|
|
8690
8722
|
} catch (e) {
|
|
8691
8723
|
}
|
|
@@ -9879,37 +9911,6 @@ function createRoutesStub(routes, unstable_getContext) {
|
|
|
9879
9911
|
return /* @__PURE__ */ React13.createElement(FrameworkContext.Provider, { value: remixContextRef.current }, /* @__PURE__ */ React13.createElement(RouterProvider, { router: routerRef.current }));
|
|
9880
9912
|
};
|
|
9881
9913
|
}
|
|
9882
|
-
function withComponentProps(Component4) {
|
|
9883
|
-
return function Wrapped() {
|
|
9884
|
-
return React13.createElement(Component4, {
|
|
9885
|
-
params: useParams(),
|
|
9886
|
-
loaderData: useLoaderData(),
|
|
9887
|
-
actionData: useActionData(),
|
|
9888
|
-
matches: useMatches()
|
|
9889
|
-
});
|
|
9890
|
-
};
|
|
9891
|
-
}
|
|
9892
|
-
function withHydrateFallbackProps(HydrateFallback) {
|
|
9893
|
-
return function Wrapped() {
|
|
9894
|
-
const props = {
|
|
9895
|
-
params: useParams(),
|
|
9896
|
-
loaderData: useLoaderData(),
|
|
9897
|
-
actionData: useActionData()
|
|
9898
|
-
};
|
|
9899
|
-
return React13.createElement(HydrateFallback, props);
|
|
9900
|
-
};
|
|
9901
|
-
}
|
|
9902
|
-
function withErrorBoundaryProps(ErrorBoundary) {
|
|
9903
|
-
return function Wrapped() {
|
|
9904
|
-
const props = {
|
|
9905
|
-
params: useParams(),
|
|
9906
|
-
loaderData: useLoaderData(),
|
|
9907
|
-
actionData: useActionData(),
|
|
9908
|
-
error: useRouteError()
|
|
9909
|
-
};
|
|
9910
|
-
return React13.createElement(ErrorBoundary, props);
|
|
9911
|
-
};
|
|
9912
|
-
}
|
|
9913
9914
|
function processRoutes(routes, manifest, routeModules, parentId) {
|
|
9914
9915
|
return routes.map((route) => {
|
|
9915
9916
|
if (!route.id) {
|
|
@@ -10428,6 +10429,13 @@ function createServerHandoffString(serverHandoff) {
|
|
|
10428
10429
|
// lib/server-runtime/headers.ts
|
|
10429
10430
|
import { splitCookiesString } from "set-cookie-parser";
|
|
10430
10431
|
function getDocumentHeaders(build, context) {
|
|
10432
|
+
return getDocumentHeadersImpl(context, (m) => {
|
|
10433
|
+
let route = build.routes[m.route.id];
|
|
10434
|
+
invariant3(route, `Route with id "${m.route.id}" not found in build`);
|
|
10435
|
+
return route.module.headers;
|
|
10436
|
+
});
|
|
10437
|
+
}
|
|
10438
|
+
function getDocumentHeadersImpl(context, getRouteHeadersFn) {
|
|
10431
10439
|
let boundaryIdx = context.errors ? context.matches.findIndex((m) => context.errors[m.route.id]) : -1;
|
|
10432
10440
|
let matches = boundaryIdx >= 0 ? context.matches.slice(0, boundaryIdx + 1) : context.matches;
|
|
10433
10441
|
let errorHeaders;
|
|
@@ -10445,14 +10453,12 @@ function getDocumentHeaders(build, context) {
|
|
|
10445
10453
|
}
|
|
10446
10454
|
return matches.reduce((parentHeaders, match, idx) => {
|
|
10447
10455
|
let { id } = match.route;
|
|
10448
|
-
let route = build.routes[id];
|
|
10449
|
-
invariant3(route, `Route with id "${id}" not found in build`);
|
|
10450
|
-
let routeModule = route.module;
|
|
10451
10456
|
let loaderHeaders = context.loaderHeaders[id] || new Headers();
|
|
10452
10457
|
let actionHeaders = context.actionHeaders[id] || new Headers();
|
|
10453
10458
|
let includeErrorHeaders = errorHeaders != null && idx === matches.length - 1;
|
|
10454
10459
|
let includeErrorCookies = includeErrorHeaders && errorHeaders !== loaderHeaders && errorHeaders !== actionHeaders;
|
|
10455
|
-
|
|
10460
|
+
let headersFn = getRouteHeadersFn(match);
|
|
10461
|
+
if (headersFn == null) {
|
|
10456
10462
|
let headers2 = new Headers(parentHeaders);
|
|
10457
10463
|
if (includeErrorCookies) {
|
|
10458
10464
|
prependCookies(errorHeaders, headers2);
|
|
@@ -10462,12 +10468,12 @@ function getDocumentHeaders(build, context) {
|
|
|
10462
10468
|
return headers2;
|
|
10463
10469
|
}
|
|
10464
10470
|
let headers = new Headers(
|
|
10465
|
-
|
|
10471
|
+
typeof headersFn === "function" ? headersFn({
|
|
10466
10472
|
loaderHeaders,
|
|
10467
10473
|
parentHeaders,
|
|
10468
10474
|
actionHeaders,
|
|
10469
10475
|
errorHeaders: includeErrorHeaders ? errorHeaders : void 0
|
|
10470
|
-
}) :
|
|
10476
|
+
}) : headersFn
|
|
10471
10477
|
);
|
|
10472
10478
|
if (includeErrorCookies) {
|
|
10473
10479
|
prependCookies(errorHeaders, headers);
|
|
@@ -11509,6 +11515,9 @@ export {
|
|
|
11509
11515
|
createRoutesFromChildren,
|
|
11510
11516
|
createRoutesFromElements,
|
|
11511
11517
|
renderMatches,
|
|
11518
|
+
withComponentProps,
|
|
11519
|
+
withHydrateFallbackProps,
|
|
11520
|
+
withErrorBoundaryProps,
|
|
11512
11521
|
createSearchParams,
|
|
11513
11522
|
SingleFetchRedirectSymbol,
|
|
11514
11523
|
getTurboStreamSingleFetchDataStrategy,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterProviderProps$1 } from './lib-
|
|
3
|
-
import { R as RouterInit } from './route-data-
|
|
2
|
+
import { R as RouterProviderProps$1 } from './lib-B33EY9A0.mjs';
|
|
3
|
+
import { R as RouterInit } from './route-data-D7Xbr_Ww.mjs';
|
|
4
4
|
|
|
5
5
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
6
6
|
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.6.
|
|
2
|
+
* react-router v7.6.3-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
invariant,
|
|
26
26
|
mapRouteProperties,
|
|
27
27
|
useFogOFWarDiscovery
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-2T4DELW3.mjs";
|
|
29
29
|
|
|
30
30
|
// lib/dom-export/dom-router-provider.tsx
|
|
31
31
|
import * as React from "react";
|