react-router 0.0.0-experimental-0be18542a → 0.0.0-experimental-e0e92e3b1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/{browser-cstcbNCb.d.ts → browser-C3X761mx.d.ts} +5 -42
- package/dist/{production/browser-cstcbNCb.d.ts → development/browser-Cd-LzL5m.d.mts} +5 -42
- package/dist/development/{chunk-GCL7JN2I.mjs → chunk-ZUOEVBB4.mjs} +282 -374
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.d.ts +2 -2
- package/dist/development/dom-export.js +61 -44
- package/dist/development/dom-export.mjs +12 -28
- package/dist/development/index.d.mts +17 -5
- package/dist/development/index.d.ts +17 -5
- package/dist/development/index.js +281 -373
- package/dist/development/index.mjs +4 -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/{production/route-data-D8Uf5Cm-.d.mts → development/route-data-DX3MskAN.d.mts} +1 -1
- package/dist/{production/route-data-D8Uf5Cm-.d.ts → development/route-data-DX3MskAN.d.ts} +1 -1
- package/dist/development/server.d.mts +3 -5
- package/dist/development/server.d.ts +3 -5
- package/dist/development/server.js +87 -210
- package/dist/development/server.mjs +88 -204
- package/dist/{development/browser-D6LL53bK.d.mts → production/browser-C3X761mx.d.ts} +5 -42
- package/dist/production/{browser-D6LL53bK.d.mts → browser-Cd-LzL5m.d.mts} +5 -42
- package/dist/production/{chunk-LKN6HKRD.mjs → chunk-TS5MBYTJ.mjs} +282 -374
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.d.ts +2 -2
- package/dist/production/dom-export.js +61 -44
- package/dist/production/dom-export.mjs +12 -28
- package/dist/production/index.d.mts +17 -5
- package/dist/production/index.d.ts +17 -5
- package/dist/production/index.js +281 -373
- package/dist/production/index.mjs +4 -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/{development/route-data-D8Uf5Cm-.d.ts → production/route-data-DX3MskAN.d.mts} +1 -1
- package/dist/{development/route-data-D8Uf5Cm-.d.mts → production/route-data-DX3MskAN.d.ts} +1 -1
- package/dist/production/server.d.mts +3 -5
- package/dist/production/server.d.ts +3 -5
- package/dist/production/server.js +87 -210
- package/dist/production/server.mjs +88 -204
- package/package.json +21 -40
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { k as RouteObject, R as RouterInit, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction,
|
|
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, aw as ClientActionFunction, x as LinksFunction, w as MetaFunction, aa as ShouldRevalidateFunction, j as Params } from './route-data-DX3MskAN.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;
|
|
@@ -1688,33 +1688,10 @@ declare global {
|
|
|
1688
1688
|
declare function getPatchRoutesOnNavigationFunction(manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, isSpaMode: boolean, basename: string | undefined): PatchRoutesOnNavigationFunction | undefined;
|
|
1689
1689
|
declare function useFogOFWarDiscovery(router: Router$1, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, isSpaMode: boolean): void;
|
|
1690
1690
|
|
|
1691
|
-
type ServerRouteObjectBase = {
|
|
1692
|
-
action?: ActionFunction;
|
|
1693
|
-
clientAction?: ClientActionFunction;
|
|
1694
|
-
clientLoader?: ClientLoaderFunction;
|
|
1695
|
-
default?: React.ComponentType<any>;
|
|
1696
|
-
ErrorBoundary?: React.ComponentType<any>;
|
|
1697
|
-
handle?: any;
|
|
1698
|
-
HydrateFallback?: React.ComponentType<any>;
|
|
1699
|
-
Layout?: React.ComponentType<any>;
|
|
1700
|
-
links?: LinksFunction;
|
|
1701
|
-
loader?: LoaderFunction;
|
|
1702
|
-
meta?: MetaFunction;
|
|
1703
|
-
shouldRevalidate?: ShouldRevalidateFunction;
|
|
1704
|
-
};
|
|
1705
|
-
type ServerRouteObject = ServerRouteObjectBase & {
|
|
1706
|
-
id: string;
|
|
1707
|
-
path?: string;
|
|
1708
|
-
lazy?: LazyRouteFunction<ServerRouteObjectBase>;
|
|
1709
|
-
} & ({
|
|
1710
|
-
index: true;
|
|
1711
|
-
} | {
|
|
1712
|
-
children?: ServerRouteObject[];
|
|
1713
|
-
});
|
|
1714
1691
|
type RenderedRoute = {
|
|
1715
1692
|
clientAction?: ClientActionFunction;
|
|
1716
1693
|
clientLoader?: ClientLoaderFunction;
|
|
1717
|
-
element?: React.ReactElement;
|
|
1694
|
+
element?: React.ReactElement | false;
|
|
1718
1695
|
errorElement?: React.ReactElement;
|
|
1719
1696
|
handle?: any;
|
|
1720
1697
|
hasAction: boolean;
|
|
@@ -1754,27 +1731,13 @@ type ServerActionPayload = {
|
|
|
1754
1731
|
rerender?: Promise<ServerRenderPayload>;
|
|
1755
1732
|
};
|
|
1756
1733
|
type ServerPayload = ServerRenderPayload | ServerManifestPayload | ServerActionPayload;
|
|
1757
|
-
type ServerMatch = {
|
|
1758
|
-
statusCode: number;
|
|
1759
|
-
headers: Headers;
|
|
1760
|
-
payload: ServerPayload;
|
|
1761
|
-
};
|
|
1762
|
-
type DecodeCallServerFunction = (id: string, reply: FormData | string) => Promise<() => Promise<unknown>>;
|
|
1763
|
-
declare function matchServerRequest({ decodeCallServer, onError, request, routes, }: {
|
|
1764
|
-
decodeCallServer?: DecodeCallServerFunction;
|
|
1765
|
-
onError?: (error: unknown) => void;
|
|
1766
|
-
request: Request;
|
|
1767
|
-
routes: ServerRouteObject[];
|
|
1768
|
-
}): Promise<ServerMatch | Response>;
|
|
1769
|
-
declare function routeServerRequest(request: Request, requestServer: (request: Request) => Promise<Response>, decode: (body: ReadableStream<Uint8Array>) => Promise<ServerPayload>, renderHTML: (payload: ServerPayload) => ReadableStream<Uint8Array> | Promise<ReadableStream<Uint8Array>>): Promise<Response>;
|
|
1770
|
-
declare function isReactServerRequest(url: URL): boolean;
|
|
1771
1734
|
|
|
1772
1735
|
type DecodeServerResponseFunction = (body: ReadableStream<Uint8Array>) => Promise<ServerPayload>;
|
|
1773
1736
|
type EncodeActionFunction = (args: unknown[]) => Promise<BodyInit>;
|
|
1774
1737
|
declare global {
|
|
1775
1738
|
interface Window {
|
|
1776
1739
|
__router: Router$1;
|
|
1777
|
-
|
|
1740
|
+
__routerInitialized: boolean;
|
|
1778
1741
|
}
|
|
1779
1742
|
}
|
|
1780
1743
|
declare function createCallServer({ decode, encodeAction, }: {
|
|
@@ -1793,4 +1756,4 @@ declare global {
|
|
|
1793
1756
|
}
|
|
1794
1757
|
declare function getServerStream(): ReadableStream<any>;
|
|
1795
1758
|
|
|
1796
|
-
export { useLinkClickHandler as $, type AssetsManifest as A, type BrowserRouterProps as B, type CriticalCss as C, type DOMRouterOpts as D, type EntryContext as E, type FutureConfig as F, type SubmitFunction as G, type HashRouterProps as H, type IndexRouteProps as I, type FetcherSubmitFunction as J, type FetcherWithComponents as K, type LayoutRouteProps as L, type MemoryRouterOpts as M, type NavigateProps as N, type OutletProps as O, type PathRouteProps as P, createBrowserRouter as Q, type RouterProviderProps as R, type ServerPayload as S, createHashRouter as T, BrowserRouter as U, HashRouter as V, Link as W, HistoryRouter as X, NavLink as Y, Form as Z, ScrollRestoration as _, type Route as a, useSearchParams as a0, useSubmit as a1, useFormAction as a2, useFetcher as a3, useFetchers as a4, useBeforeUnload as a5, usePrompt as a6, useViewTransitionState as a7, type FetcherSubmitOptions as a8, type ParamKeyValuePair as a9,
|
|
1759
|
+
export { useLinkClickHandler as $, type AssetsManifest as A, type BrowserRouterProps as B, type CriticalCss as C, type DOMRouterOpts as D, type EntryContext as E, type FutureConfig as F, type SubmitFunction as G, type HashRouterProps as H, type IndexRouteProps as I, type FetcherSubmitFunction as J, type FetcherWithComponents as K, type LayoutRouteProps as L, type MemoryRouterOpts as M, type NavigateProps as N, type OutletProps as O, type PathRouteProps as P, createBrowserRouter as Q, type RouterProviderProps as R, type ServerPayload as S, createHashRouter as T, BrowserRouter as U, HashRouter as V, Link as W, HistoryRouter as X, NavLink as Y, Form as Z, ScrollRestoration as _, type Route as a, useSearchParams as a0, useSubmit as a1, useFormAction as a2, useFetcher as a3, useFetchers as a4, useBeforeUnload as a5, usePrompt as a6, useViewTransitionState as a7, type FetcherSubmitOptions as a8, type ParamKeyValuePair as a9, type SubmitOptions as aa, type URLSearchParamsInit as ab, type SubmitTarget as ac, createSearchParams as ad, Meta as ae, Links as af, Scripts as ag, PrefetchPageLinks as ah, type ScriptsProps as ai, hydrationRouteProperties as aj, mapRouteProperties as ak, FrameworkContext as al, getPatchRoutesOnNavigationFunction as am, useFogOFWarDiscovery as an, createClientRoutes as ao, createClientRoutesWithHMRRevalidationOptOut as ap, shouldHydrateRouteLoader as aq, useScrollRestoration as ar, type DecodeServerResponseFunction as as, type EncodeActionFunction as at, createCallServer as au, ServerBrowserRouter as av, getServerStream as aw, type AwaitProps as b, type MemoryRouterProps as c, type RouteProps as d, type RouterProps as e, type RoutesProps as f, Await as g, MemoryRouter as h, Navigate as i, Outlet as j, Route$1 as k, Router as l, RouterProvider as m, Routes as n, createMemoryRouter as o, createRoutesFromChildren as p, createRoutesFromElements as q, renderMatches as r, type HistoryRouterProps as s, type LinkProps as t, type NavLinkProps as u, type NavLinkRenderProps as v, type FetcherFormProps as w, type FormProps as x, type ScrollRestorationProps as y, type SetURLSearchParams as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { k as RouteObject, R as RouterInit, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction,
|
|
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, aw as ClientActionFunction, x as LinksFunction, w as MetaFunction, aa as ShouldRevalidateFunction, j as Params } from './route-data-DX3MskAN.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;
|
|
@@ -1688,33 +1688,10 @@ declare global {
|
|
|
1688
1688
|
declare function getPatchRoutesOnNavigationFunction(manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, isSpaMode: boolean, basename: string | undefined): PatchRoutesOnNavigationFunction | undefined;
|
|
1689
1689
|
declare function useFogOFWarDiscovery(router: Router$1, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, isSpaMode: boolean): void;
|
|
1690
1690
|
|
|
1691
|
-
type ServerRouteObjectBase = {
|
|
1692
|
-
action?: ActionFunction;
|
|
1693
|
-
clientAction?: ClientActionFunction;
|
|
1694
|
-
clientLoader?: ClientLoaderFunction;
|
|
1695
|
-
default?: React.ComponentType<any>;
|
|
1696
|
-
ErrorBoundary?: React.ComponentType<any>;
|
|
1697
|
-
handle?: any;
|
|
1698
|
-
HydrateFallback?: React.ComponentType<any>;
|
|
1699
|
-
Layout?: React.ComponentType<any>;
|
|
1700
|
-
links?: LinksFunction;
|
|
1701
|
-
loader?: LoaderFunction;
|
|
1702
|
-
meta?: MetaFunction;
|
|
1703
|
-
shouldRevalidate?: ShouldRevalidateFunction;
|
|
1704
|
-
};
|
|
1705
|
-
type ServerRouteObject = ServerRouteObjectBase & {
|
|
1706
|
-
id: string;
|
|
1707
|
-
path?: string;
|
|
1708
|
-
lazy?: LazyRouteFunction<ServerRouteObjectBase>;
|
|
1709
|
-
} & ({
|
|
1710
|
-
index: true;
|
|
1711
|
-
} | {
|
|
1712
|
-
children?: ServerRouteObject[];
|
|
1713
|
-
});
|
|
1714
1691
|
type RenderedRoute = {
|
|
1715
1692
|
clientAction?: ClientActionFunction;
|
|
1716
1693
|
clientLoader?: ClientLoaderFunction;
|
|
1717
|
-
element?: React.ReactElement;
|
|
1694
|
+
element?: React.ReactElement | false;
|
|
1718
1695
|
errorElement?: React.ReactElement;
|
|
1719
1696
|
handle?: any;
|
|
1720
1697
|
hasAction: boolean;
|
|
@@ -1754,27 +1731,13 @@ type ServerActionPayload = {
|
|
|
1754
1731
|
rerender?: Promise<ServerRenderPayload>;
|
|
1755
1732
|
};
|
|
1756
1733
|
type ServerPayload = ServerRenderPayload | ServerManifestPayload | ServerActionPayload;
|
|
1757
|
-
type ServerMatch = {
|
|
1758
|
-
statusCode: number;
|
|
1759
|
-
headers: Headers;
|
|
1760
|
-
payload: ServerPayload;
|
|
1761
|
-
};
|
|
1762
|
-
type DecodeCallServerFunction = (id: string, reply: FormData | string) => Promise<() => Promise<unknown>>;
|
|
1763
|
-
declare function matchServerRequest({ decodeCallServer, onError, request, routes, }: {
|
|
1764
|
-
decodeCallServer?: DecodeCallServerFunction;
|
|
1765
|
-
onError?: (error: unknown) => void;
|
|
1766
|
-
request: Request;
|
|
1767
|
-
routes: ServerRouteObject[];
|
|
1768
|
-
}): Promise<ServerMatch | Response>;
|
|
1769
|
-
declare function routeServerRequest(request: Request, requestServer: (request: Request) => Promise<Response>, decode: (body: ReadableStream<Uint8Array>) => Promise<ServerPayload>, renderHTML: (payload: ServerPayload) => ReadableStream<Uint8Array> | Promise<ReadableStream<Uint8Array>>): Promise<Response>;
|
|
1770
|
-
declare function isReactServerRequest(url: URL): boolean;
|
|
1771
1734
|
|
|
1772
1735
|
type DecodeServerResponseFunction = (body: ReadableStream<Uint8Array>) => Promise<ServerPayload>;
|
|
1773
1736
|
type EncodeActionFunction = (args: unknown[]) => Promise<BodyInit>;
|
|
1774
1737
|
declare global {
|
|
1775
1738
|
interface Window {
|
|
1776
1739
|
__router: Router$1;
|
|
1777
|
-
|
|
1740
|
+
__routerInitialized: boolean;
|
|
1778
1741
|
}
|
|
1779
1742
|
}
|
|
1780
1743
|
declare function createCallServer({ decode, encodeAction, }: {
|
|
@@ -1793,4 +1756,4 @@ declare global {
|
|
|
1793
1756
|
}
|
|
1794
1757
|
declare function getServerStream(): ReadableStream<any>;
|
|
1795
1758
|
|
|
1796
|
-
export { useLinkClickHandler as $, type AssetsManifest as A, type BrowserRouterProps as B, type CriticalCss as C, type DOMRouterOpts as D, type EntryContext as E, type FutureConfig as F, type SubmitFunction as G, type HashRouterProps as H, type IndexRouteProps as I, type FetcherSubmitFunction as J, type FetcherWithComponents as K, type LayoutRouteProps as L, type MemoryRouterOpts as M, type NavigateProps as N, type OutletProps as O, type PathRouteProps as P, createBrowserRouter as Q, type RouterProviderProps as R, type ServerPayload as S, createHashRouter as T, BrowserRouter as U, HashRouter as V, Link as W, HistoryRouter as X, NavLink as Y, Form as Z, ScrollRestoration as _, type Route as a, useSearchParams as a0, useSubmit as a1, useFormAction as a2, useFetcher as a3, useFetchers as a4, useBeforeUnload as a5, usePrompt as a6, useViewTransitionState as a7, type FetcherSubmitOptions as a8, type ParamKeyValuePair as a9,
|
|
1759
|
+
export { useLinkClickHandler as $, type AssetsManifest as A, type BrowserRouterProps as B, type CriticalCss as C, type DOMRouterOpts as D, type EntryContext as E, type FutureConfig as F, type SubmitFunction as G, type HashRouterProps as H, type IndexRouteProps as I, type FetcherSubmitFunction as J, type FetcherWithComponents as K, type LayoutRouteProps as L, type MemoryRouterOpts as M, type NavigateProps as N, type OutletProps as O, type PathRouteProps as P, createBrowserRouter as Q, type RouterProviderProps as R, type ServerPayload as S, createHashRouter as T, BrowserRouter as U, HashRouter as V, Link as W, HistoryRouter as X, NavLink as Y, Form as Z, ScrollRestoration as _, type Route as a, useSearchParams as a0, useSubmit as a1, useFormAction as a2, useFetcher as a3, useFetchers as a4, useBeforeUnload as a5, usePrompt as a6, useViewTransitionState as a7, type FetcherSubmitOptions as a8, type ParamKeyValuePair as a9, type SubmitOptions as aa, type URLSearchParamsInit as ab, type SubmitTarget as ac, createSearchParams as ad, Meta as ae, Links as af, Scripts as ag, PrefetchPageLinks as ah, type ScriptsProps as ai, hydrationRouteProperties as aj, mapRouteProperties as ak, FrameworkContext as al, getPatchRoutesOnNavigationFunction as am, useFogOFWarDiscovery as an, createClientRoutes as ao, createClientRoutesWithHMRRevalidationOptOut as ap, shouldHydrateRouteLoader as aq, useScrollRestoration as ar, type DecodeServerResponseFunction as as, type EncodeActionFunction as at, createCallServer as au, ServerBrowserRouter as av, getServerStream as aw, type AwaitProps as b, type MemoryRouterProps as c, type RouteProps as d, type RouterProps as e, type RoutesProps as f, Await as g, MemoryRouter as h, Navigate as i, Outlet as j, Route$1 as k, Router as l, RouterProvider as m, Routes as n, createMemoryRouter as o, createRoutesFromChildren as p, createRoutesFromElements as q, renderMatches as r, type HistoryRouterProps as s, type LinkProps as t, type NavLinkProps as u, type NavLinkRenderProps as v, type FetcherFormProps as w, type FormProps as x, type ScrollRestorationProps as y, type SetURLSearchParams as z };
|