react-router 0.0.0-experimental-078ef8de9 → 0.0.0-experimental-ecd35cd60
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/README.md +1 -10
- package/dist/index.d.ts +64 -21
- package/dist/index.js +11550 -1238
- package/dist/index.js.map +1 -1
- package/dist/lib/components.d.ts +243 -36
- package/dist/lib/context.d.ts +3 -5
- package/dist/lib/dom/dom.d.ts +122 -0
- package/dist/lib/dom/global.d.ts +36 -0
- package/dist/lib/dom/lib.d.ts +965 -0
- package/dist/lib/dom/server.d.ts +40 -0
- package/dist/lib/dom/ssr/browser.d.ts +6 -0
- package/dist/lib/dom/ssr/components.d.ts +123 -0
- package/dist/lib/dom/ssr/data.d.ts +7 -0
- package/dist/lib/dom/ssr/entry.d.ts +50 -0
- package/dist/lib/dom/ssr/errorBoundaries.d.ts +36 -0
- package/dist/lib/dom/ssr/errors.d.ts +2 -0
- package/dist/lib/dom/ssr/fallback.d.ts +2 -0
- package/dist/lib/dom/ssr/fog-of-war.d.ts +37 -0
- package/dist/lib/dom/ssr/invariant.d.ts +2 -0
- package/dist/lib/dom/ssr/links.d.ts +126 -0
- package/dist/lib/dom/ssr/markup.d.ts +5 -0
- package/dist/lib/dom/ssr/routeModules.d.ts +141 -0
- package/dist/lib/dom/ssr/routes-test-stub.d.ts +59 -0
- package/dist/lib/dom/ssr/routes.d.ts +32 -0
- package/dist/lib/dom/ssr/server.d.ts +16 -0
- package/dist/lib/dom/ssr/single-fetch.d.ts +37 -0
- package/dist/lib/hooks.d.ts +282 -55
- package/dist/lib/router/define-route.d.ts +102 -0
- package/dist/lib/router/history.d.ts +253 -0
- package/dist/lib/router/index.d.ts +9 -0
- package/dist/lib/router/router.d.ts +540 -0
- package/dist/lib/router/utils.d.ts +487 -0
- package/dist/lib/server-runtime/build.d.ts +38 -0
- package/dist/lib/server-runtime/cookies.d.ts +69 -0
- package/dist/lib/server-runtime/crypto.d.ts +2 -0
- package/dist/lib/server-runtime/data.d.ts +31 -0
- package/dist/lib/server-runtime/dev.d.ts +8 -0
- package/dist/lib/server-runtime/entry.d.ts +3 -0
- package/dist/lib/server-runtime/errors.d.ts +51 -0
- package/dist/lib/server-runtime/formData.d.ts +15 -0
- package/dist/lib/server-runtime/invariant.d.ts +2 -0
- package/dist/lib/server-runtime/jsonify.d.ts +33 -0
- package/dist/lib/server-runtime/links.d.ts +104 -0
- package/dist/lib/server-runtime/markup.d.ts +1 -0
- package/dist/lib/server-runtime/mode.d.ts +9 -0
- package/dist/lib/server-runtime/responses.d.ts +30 -0
- package/dist/lib/server-runtime/routeMatching.d.ts +8 -0
- package/dist/lib/server-runtime/routeModules.d.ts +214 -0
- package/dist/lib/server-runtime/routes.d.ts +31 -0
- package/dist/lib/server-runtime/server.d.ts +5 -0
- package/dist/lib/server-runtime/serverHandoff.d.ts +12 -0
- package/dist/lib/server-runtime/sessions/cookieStorage.d.ts +23 -0
- package/dist/lib/server-runtime/sessions/memoryStorage.d.ts +20 -0
- package/dist/lib/server-runtime/sessions.d.ts +143 -0
- package/dist/lib/server-runtime/single-fetch.d.ts +56 -0
- package/dist/lib/server-runtime/typecheck.d.ts +4 -0
- package/dist/lib/server-runtime/upload/errors.d.ts +5 -0
- package/dist/lib/server-runtime/upload/memoryUploadHandler.d.ts +21 -0
- package/dist/lib/server-runtime/warnings.d.ts +1 -0
- package/dist/main.js +1 -1
- package/dist/react-router.development.js +12436 -1149
- package/dist/react-router.development.js.map +1 -1
- package/dist/react-router.production.min.js +2 -2
- package/dist/react-router.production.min.js.map +1 -1
- package/dist/umd/react-router.development.js +12727 -1258
- package/dist/umd/react-router.development.js.map +1 -1
- package/dist/umd/react-router.production.min.js +2 -2
- package/dist/umd/react-router.production.min.js.map +1 -1
- package/package.json +16 -5
package/README.md
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
# React Router
|
|
2
2
|
|
|
3
|
-
The `react-router` package is the heart of [React Router](https://github.com/remix-run/react-router) and provides all
|
|
4
|
-
the core functionality for both
|
|
5
|
-
[`react-router-dom`](https://github.com/remix-run/react-router/tree/main/packages/react-router-dom)
|
|
6
|
-
and
|
|
7
|
-
[`react-router-native`](https://github.com/remix-run/react-router/tree/main/packages/react-router-native).
|
|
8
|
-
|
|
9
|
-
If you're using React Router, you should never `import` anything directly from
|
|
10
|
-
the `react-router` package, but you should have everything you need in either
|
|
11
|
-
`react-router-dom` or `react-router-native`. Both of those packages re-export
|
|
12
|
-
everything from `react-router`.
|
|
3
|
+
The `react-router` package is the heart of [React Router](https://github.com/remix-run/react-router) and provides all the core functionality.
|
|
13
4
|
|
|
14
5
|
If you'd like to extend React Router and you know what you're doing, you should
|
|
15
6
|
add `react-router` **as a peer dependency, not a regular dependency** in your
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ActionFunction, ActionFunctionArgs, Blocker, BlockerFunction, unstable_DataStrategyFunction, unstable_DataStrategyFunctionArgs, unstable_DataStrategyMatch, ErrorResponse, Fetcher,
|
|
2
|
-
import {
|
|
3
|
-
import type { AwaitProps,
|
|
4
|
-
import { Await, MemoryRouter, Navigate, Outlet, Route, Router,
|
|
1
|
+
import type { ActionFunction, ActionFunctionArgs, Blocker, BlockerFunction, unstable_DataStrategyFunction, unstable_DataStrategyFunctionArgs, unstable_DataStrategyMatch, ErrorResponse, Fetcher, JsonFunction, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, Navigation, NavigationStates, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, RedirectFunction, RelativeRoutingType, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, unstable_HandlerResult } from "./lib/router";
|
|
2
|
+
import { Action as NavigationType, createPath, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, resolvePath, UNSAFE_ErrorResponseImpl } from "./lib/router";
|
|
3
|
+
import type { AwaitProps, IndexRouteProps, LayoutRouteProps, MemoryRouterProps, NavigateProps, OutletProps, PathRouteProps, RouteProps, RouterProps, RoutesProps, unstable_PatchRoutesOnMissFunction } from "./lib/components";
|
|
4
|
+
import { Await, MemoryRouter, Navigate, Outlet, Route, Router, Routes, createRoutesFromChildren, renderMatches, createMemoryRouter, mapRouteProperties } from "./lib/components";
|
|
5
5
|
import type { DataRouteMatch, DataRouteObject, IndexRouteObject, NavigateOptions, Navigator, NonIndexRouteObject, RouteMatch, RouteObject } from "./lib/context";
|
|
6
6
|
import { DataRouterContext, DataRouterStateContext, LocationContext, NavigationContext, RouteContext } from "./lib/context";
|
|
7
7
|
import type { NavigateFunction } from "./lib/hooks";
|
|
@@ -9,21 +9,64 @@ import { useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useIn
|
|
|
9
9
|
type Hash = string;
|
|
10
10
|
type Pathname = string;
|
|
11
11
|
type Search = string;
|
|
12
|
-
export type { ActionFunction, ActionFunctionArgs, AwaitProps, DataRouteMatch, DataRouteObject, unstable_DataStrategyFunction, unstable_DataStrategyFunctionArgs, unstable_DataStrategyMatch, ErrorResponse, Fetcher,
|
|
13
|
-
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
export
|
|
18
|
-
}
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
12
|
+
export type { ActionFunction, ActionFunctionArgs, AwaitProps, DataRouteMatch, DataRouteObject, unstable_DataStrategyFunction, unstable_DataStrategyFunctionArgs, unstable_DataStrategyMatch, ErrorResponse, Fetcher, Hash, IndexRouteObject, IndexRouteProps, JsonFunction, LayoutRouteProps, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, NavigationStates, Navigator, NonIndexRouteObject, OutletProps, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, PathRouteProps, Pathname, RedirectFunction, RelativeRoutingType, RouteMatch, RouteObject, RouteProps, RouterProps, RoutesProps, Search, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, Blocker, BlockerFunction, unstable_HandlerResult, unstable_PatchRoutesOnMissFunction, };
|
|
13
|
+
export { Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, Routes, createMemoryRouter, createPath, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, resolvePath, useBlocker, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, };
|
|
14
|
+
export type { AgnosticDataIndexRouteObject, AgnosticDataNonIndexRouteObject, AgnosticDataRouteMatch, AgnosticDataRouteObject, AgnosticIndexRouteObject, AgnosticNonIndexRouteObject, AgnosticRouteMatch, AgnosticRouteObject, HydrationState, InitialEntry, LowerCaseFormMethod, StaticHandler, TrackedPromise, FetcherStates, UpperCaseFormMethod, } from "./lib/router";
|
|
15
|
+
export { getStaticContextFromError, stripBasename, UNSAFE_convertRoutesToDataRoutes, } from "./lib/router";
|
|
16
|
+
export type { FormEncType, FormMethod, GetScrollRestorationKeyFunction, StaticHandlerContext, Submission, } from "./lib/router";
|
|
17
|
+
export type { BrowserRouterProps, HashRouterProps, HistoryRouterProps, LinkProps, NavLinkProps, NavLinkRenderProps, FetcherFormProps, FormProps, ScrollRestorationProps, SetURLSearchParams, SubmitFunction, FetcherSubmitFunction, FetcherWithComponents, RouterProviderProps, } from "./lib/dom/lib";
|
|
18
|
+
export { createBrowserRouter, createHashRouter, BrowserRouter, HashRouter, Link, UNSAFE_ViewTransitionContext, UNSAFE_FetchersContext, unstable_HistoryRouter, NavLink, Form, RouterProvider, ScrollRestoration, useLinkClickHandler, useSearchParams, useSubmit, useFormAction, useFetcher, useFetchers, UNSAFE_useScrollRestoration, useBeforeUnload, unstable_usePrompt, unstable_useViewTransitionState, } from "./lib/dom/lib";
|
|
19
|
+
export type { ParamKeyValuePair, SubmitOptions, URLSearchParamsInit, SubmitTarget, } from "./lib/dom/dom";
|
|
20
|
+
export { createSearchParams } from "./lib/dom/dom";
|
|
21
|
+
export type { StaticRouterProps, StaticRouterProviderProps, } from "./lib/dom/server";
|
|
22
|
+
export { createStaticHandler, createStaticRouter, StaticRouter, StaticRouterProvider, } from "./lib/dom/server";
|
|
23
|
+
export { HydratedRouter } from "./lib/dom/ssr/browser";
|
|
24
|
+
export { Meta, Links, Scripts, PrefetchPageLinks, } from "./lib/dom/ssr/components";
|
|
25
|
+
export type { ScriptsProps } from "./lib/dom/ssr/components";
|
|
26
|
+
export type { EntryContext } from "./lib/dom/ssr/entry";
|
|
27
|
+
export type { HtmlLinkDescriptor, LinkDescriptor, PrefetchPageDescriptor, } from "./lib/dom/ssr/links";
|
|
28
|
+
export type { ClientActionFunction, ClientActionFunctionArgs, ClientLoaderFunction, ClientLoaderFunctionArgs, MetaArgs, MetaDescriptor, MetaFunction, LinksFunction, } from "./lib/dom/ssr/routeModules";
|
|
29
|
+
export type { ServerRouterProps } from "./lib/dom/ssr/server";
|
|
30
|
+
export { ServerRouter } from "./lib/dom/ssr/server";
|
|
31
|
+
export type { RoutesTestStubProps } from "./lib/dom/ssr/routes-test-stub";
|
|
32
|
+
export { createRoutesStub } from "./lib/dom/ssr/routes-test-stub";
|
|
33
|
+
export { defineRoute, type Match, type MetaMatch, } from "./lib/router/define-route";
|
|
34
|
+
export { createCookieFactory, isCookie } from "./lib/server-runtime/cookies";
|
|
35
|
+
export { composeUploadHandlers as unstable_composeUploadHandlers, parseMultipartFormData as unstable_parseMultipartFormData, } from "./lib/server-runtime/formData";
|
|
36
|
+
export { createRequestHandler } from "./lib/server-runtime/server";
|
|
37
|
+
export { createSession, createSessionStorageFactory, isSession, } from "./lib/server-runtime/sessions";
|
|
38
|
+
export { createCookieSessionStorageFactory } from "./lib/server-runtime/sessions/cookieStorage";
|
|
39
|
+
export { createMemorySessionStorageFactory } from "./lib/server-runtime/sessions/memoryStorage";
|
|
40
|
+
export { createMemoryUploadHandler as unstable_createMemoryUploadHandler } from "./lib/server-runtime/upload/memoryUploadHandler";
|
|
41
|
+
export { MaxPartSizeExceededError } from "./lib/server-runtime/upload/errors";
|
|
42
|
+
export { setDevServerHooks as unstable_setDevServerHooks } from "./lib/server-runtime/dev";
|
|
43
|
+
export type { CreateCookieFunction, IsCookieFunction, } from "./lib/server-runtime/cookies";
|
|
44
|
+
export type { CreateRequestHandlerFunction } from "./lib/server-runtime/server";
|
|
45
|
+
export type { CreateSessionFunction, CreateSessionStorageFunction, IsSessionFunction, } from "./lib/server-runtime/sessions";
|
|
46
|
+
export type { CreateCookieSessionStorageFunction } from "./lib/server-runtime/sessions/cookieStorage";
|
|
47
|
+
export type { CreateMemorySessionStorageFunction } from "./lib/server-runtime/sessions/memoryStorage";
|
|
48
|
+
export type { HandleDataRequestFunction, HandleDocumentRequestFunction, HandleErrorFunction, ServerBuild, ServerEntryModule, } from "./lib/server-runtime/build";
|
|
49
|
+
export type { UploadHandlerPart, UploadHandler, } from "./lib/server-runtime/formData";
|
|
50
|
+
export type { MemoryUploadHandlerOptions, MemoryUploadHandlerFilterArgs, } from "./lib/server-runtime/upload/memoryUploadHandler";
|
|
51
|
+
export type { Cookie, CookieOptions, CookieParseOptions, CookieSerializeOptions, CookieSignatureOptions, } from "./lib/server-runtime/cookies";
|
|
52
|
+
export type { SignFunction, UnsignFunction } from "./lib/server-runtime/crypto";
|
|
53
|
+
export type { AppLoadContext } from "./lib/server-runtime/data";
|
|
54
|
+
export type { PageLinkDescriptor, } from "./lib/server-runtime/links";
|
|
55
|
+
export type { TypedResponse } from "./lib/server-runtime/responses";
|
|
56
|
+
export type { DataFunctionArgs, HeadersArgs, HeadersFunction, } from "./lib/server-runtime/routeModules";
|
|
57
|
+
export type { RequestHandler } from "./lib/server-runtime/server";
|
|
58
|
+
export type { Session, SessionData, SessionIdStorageStrategy, SessionStorage, FlashSessionData, } from "./lib/server-runtime/sessions";
|
|
59
|
+
export { ServerMode as UNSAFE_ServerMode } from "./lib/server-runtime/mode";
|
|
28
60
|
/** @internal */
|
|
29
|
-
export { DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, };
|
|
61
|
+
export { DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, UNSAFE_ErrorResponseImpl, };
|
|
62
|
+
/** @internal */
|
|
63
|
+
export { FrameworkContext as UNSAFE_FrameworkContext } from "./lib/dom/ssr/components";
|
|
64
|
+
/** @internal */
|
|
65
|
+
export type { RouteModules as UNSAFE_RouteModules } from "./lib/dom/ssr/routeModules";
|
|
66
|
+
/** @internal */
|
|
67
|
+
export type { FutureConfig as UNSAFE_FutureConfig, AssetsManifest as UNSAFE_AssetsManifest, FrameworkContextObject as UNSAFE_FrameworkContextObject, } from "./lib/dom/ssr/entry";
|
|
68
|
+
/** @internal */
|
|
69
|
+
export type { EntryRoute as UNSAFE_EntryRoute, RouteManifest as UNSAFE_RouteManifest, } from "./lib/dom/ssr/routes";
|
|
70
|
+
/** @internal */
|
|
71
|
+
export type { SingleFetchRedirectResult as UNSAFE_SingleFetchRedirectResult, SingleFetchResult as UNSAFE_SingleFetchResult, SingleFetchResults as UNSAFE_SingleFetchResults, } from "./lib/dom/ssr/single-fetch";
|
|
72
|
+
export { decodeViaTurboStream as UNSAFE_decodeViaTurboStream, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, } from "./lib/dom/ssr/single-fetch";
|