react-router 8.5.0 → 8.5.1
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 +44 -1
- package/dist/development/dom-export.js +1 -1
- package/dist/development/index-react-server-client.js +1 -1
- package/dist/development/index-react-server.d.ts +50 -396
- package/dist/development/index-react-server.js +43 -15
- package/dist/development/index.js +1 -1
- package/dist/development/lib/actions.js +1 -1
- package/dist/development/lib/await.js +58 -0
- package/dist/development/lib/components.d.ts +41 -5
- package/dist/development/lib/components.js +62 -4
- package/dist/development/lib/context.d.ts +2 -2
- package/dist/development/lib/context.js +1 -1
- package/dist/development/lib/dom/dom.js +1 -1
- package/dist/development/lib/dom/lib.js +1 -1
- package/dist/development/lib/dom/server.js +1 -1
- package/dist/development/lib/dom/ssr/components.js +1 -1
- package/dist/development/lib/dom/ssr/data.js +1 -1
- package/dist/development/lib/dom/ssr/errorBoundaries.js +1 -1
- package/dist/development/lib/dom/ssr/fallback.js +1 -1
- package/dist/development/lib/dom/ssr/fog-of-war.js +12 -3
- package/dist/development/lib/dom/ssr/hydration.js +1 -1
- package/dist/development/lib/dom/ssr/invariant.js +1 -1
- package/dist/development/lib/dom/ssr/links.js +1 -1
- package/dist/development/lib/dom/ssr/markup.js +1 -1
- package/dist/development/lib/dom/ssr/route-discovery.d.ts +2 -2
- package/dist/development/lib/dom/ssr/route-discovery.js +3 -3
- package/dist/development/lib/dom/ssr/routeModules.js +1 -1
- package/dist/development/lib/dom/ssr/routes-test-stub.js +1 -1
- package/dist/development/lib/dom/ssr/routes.js +1 -1
- package/dist/development/lib/dom/ssr/server.js +1 -1
- package/dist/development/lib/dom/ssr/single-fetch.d.ts +1 -1
- package/dist/development/lib/dom/ssr/single-fetch.js +7 -7
- package/dist/development/lib/dom-export/dom-router-provider.js +1 -1
- package/dist/development/lib/dom-export/hydrated-router.js +2 -2
- package/dist/development/lib/errors.js +1 -1
- package/dist/development/lib/hooks.d.ts +0 -3
- package/dist/development/lib/hooks.js +5 -6
- package/dist/development/lib/href.js +1 -1
- package/dist/development/lib/router/history.js +1 -1
- package/dist/development/lib/router/instrumentation.js +1 -1
- package/dist/development/lib/router/matcher-route-pattern.js +1 -1
- package/dist/development/lib/router/matcher-route-pattern.preload.js +1 -1
- package/dist/development/lib/router/matcher.js +6 -1
- package/dist/development/lib/router/navigation.js +1 -1
- package/dist/development/lib/router/router.d.ts +2 -0
- package/dist/development/lib/router/router.js +58 -28
- package/dist/development/lib/router/url.js +1 -1
- package/dist/development/lib/router/utils.d.ts +7 -0
- package/dist/development/lib/router/utils.js +1 -1
- package/dist/development/lib/rsc/browser.js +3 -3
- package/dist/development/lib/rsc/errorBoundaries.js +1 -1
- package/dist/development/lib/rsc/html-stream/browser.js +1 -1
- package/dist/development/lib/rsc/html-stream/server.js +1 -1
- package/dist/development/lib/rsc/route-modules.js +1 -1
- package/dist/development/lib/rsc/server.ssr.js +1 -1
- package/dist/development/lib/server-runtime/cookies.js +1 -1
- package/dist/development/lib/server-runtime/crypto.js +1 -1
- package/dist/development/lib/server-runtime/data.js +1 -1
- package/dist/development/lib/server-runtime/dev.js +1 -1
- package/dist/development/lib/server-runtime/entry.js +1 -1
- package/dist/development/lib/server-runtime/errors.js +1 -1
- package/dist/development/lib/server-runtime/headers.js +1 -1
- package/dist/development/lib/server-runtime/invariant.js +1 -1
- package/dist/development/lib/server-runtime/mode.js +1 -1
- package/dist/development/lib/server-runtime/routeMatching.js +1 -1
- package/dist/development/lib/server-runtime/routes.js +1 -1
- package/dist/development/lib/server-runtime/server.js +13 -5
- package/dist/development/lib/server-runtime/serverHandoff.js +1 -1
- package/dist/development/lib/server-runtime/sessions/cookieStorage.js +1 -1
- package/dist/development/lib/server-runtime/sessions/memoryStorage.js +1 -1
- package/dist/development/lib/server-runtime/sessions.js +2 -2
- package/dist/development/lib/server-runtime/single-fetch.js +1 -1
- package/dist/development/lib/server-runtime/urls.js +1 -1
- package/dist/development/lib/server-runtime/warnings.js +1 -1
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/route-pattern.js +1 -1
- package/dist/development/vendor/turbo-stream-v2/flatten.js +1 -1
- package/dist/development/vendor/turbo-stream-v2/turbo-stream.js +1 -1
- package/dist/development/vendor/turbo-stream-v2/unflatten.js +23 -3
- package/dist/development/vendor/turbo-stream-v2/utils.js +1 -1
- package/dist/production/dom-export.js +1 -1
- package/dist/production/index-react-server-client.js +1 -1
- package/dist/production/index-react-server.d.ts +50 -396
- package/dist/production/index-react-server.js +43 -15
- package/dist/production/index.js +1 -1
- package/dist/production/lib/actions.js +1 -1
- package/dist/production/lib/await.js +58 -0
- package/dist/production/lib/components.d.ts +41 -5
- package/dist/production/lib/components.js +62 -4
- package/dist/production/lib/context.d.ts +2 -2
- package/dist/production/lib/context.js +1 -1
- package/dist/production/lib/dom/dom.js +1 -1
- package/dist/production/lib/dom/lib.js +1 -1
- package/dist/production/lib/dom/server.js +1 -1
- package/dist/production/lib/dom/ssr/components.js +1 -1
- package/dist/production/lib/dom/ssr/data.js +1 -1
- package/dist/production/lib/dom/ssr/errorBoundaries.js +1 -1
- package/dist/production/lib/dom/ssr/fallback.js +1 -1
- package/dist/production/lib/dom/ssr/fog-of-war.js +12 -3
- package/dist/production/lib/dom/ssr/hydration.js +1 -1
- package/dist/production/lib/dom/ssr/invariant.js +1 -1
- package/dist/production/lib/dom/ssr/links.js +1 -1
- package/dist/production/lib/dom/ssr/markup.js +1 -1
- package/dist/production/lib/dom/ssr/route-discovery.d.ts +2 -2
- package/dist/production/lib/dom/ssr/route-discovery.js +3 -3
- package/dist/production/lib/dom/ssr/routeModules.js +1 -1
- package/dist/production/lib/dom/ssr/routes-test-stub.js +1 -1
- package/dist/production/lib/dom/ssr/routes.js +1 -1
- package/dist/production/lib/dom/ssr/server.js +1 -1
- package/dist/production/lib/dom/ssr/single-fetch.d.ts +1 -1
- package/dist/production/lib/dom/ssr/single-fetch.js +7 -7
- package/dist/production/lib/dom-export/dom-router-provider.js +1 -1
- package/dist/production/lib/dom-export/hydrated-router.js +2 -2
- package/dist/production/lib/errors.js +1 -1
- package/dist/production/lib/hooks.d.ts +0 -3
- package/dist/production/lib/hooks.js +5 -6
- package/dist/production/lib/href.js +1 -1
- package/dist/production/lib/router/history.js +1 -1
- package/dist/production/lib/router/instrumentation.js +1 -1
- package/dist/production/lib/router/matcher-route-pattern.js +1 -1
- package/dist/production/lib/router/matcher-route-pattern.preload.js +1 -1
- package/dist/production/lib/router/matcher.js +6 -1
- package/dist/production/lib/router/navigation.js +1 -1
- package/dist/production/lib/router/router.d.ts +2 -0
- package/dist/production/lib/router/router.js +58 -28
- package/dist/production/lib/router/url.js +1 -1
- package/dist/production/lib/router/utils.d.ts +7 -0
- package/dist/production/lib/router/utils.js +1 -1
- package/dist/production/lib/rsc/browser.js +3 -3
- package/dist/production/lib/rsc/errorBoundaries.js +1 -1
- package/dist/production/lib/rsc/html-stream/browser.js +1 -1
- package/dist/production/lib/rsc/html-stream/server.js +1 -1
- package/dist/production/lib/rsc/route-modules.js +1 -1
- package/dist/production/lib/rsc/server.ssr.js +1 -1
- package/dist/production/lib/server-runtime/cookies.js +1 -1
- package/dist/production/lib/server-runtime/crypto.js +1 -1
- package/dist/production/lib/server-runtime/data.js +1 -1
- package/dist/production/lib/server-runtime/dev.js +1 -1
- package/dist/production/lib/server-runtime/entry.js +1 -1
- package/dist/production/lib/server-runtime/errors.js +1 -1
- package/dist/production/lib/server-runtime/headers.js +1 -1
- package/dist/production/lib/server-runtime/invariant.js +1 -1
- package/dist/production/lib/server-runtime/mode.js +1 -1
- package/dist/production/lib/server-runtime/routeMatching.js +1 -1
- package/dist/production/lib/server-runtime/routes.js +1 -1
- package/dist/production/lib/server-runtime/server.js +13 -5
- package/dist/production/lib/server-runtime/serverHandoff.js +1 -1
- package/dist/production/lib/server-runtime/sessions/cookieStorage.js +1 -1
- package/dist/production/lib/server-runtime/sessions/memoryStorage.js +1 -1
- package/dist/production/lib/server-runtime/sessions.js +2 -2
- package/dist/production/lib/server-runtime/single-fetch.js +1 -1
- package/dist/production/lib/server-runtime/urls.js +1 -1
- package/dist/production/lib/server-runtime/warnings.js +1 -1
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/route-pattern.js +1 -1
- package/dist/production/vendor/turbo-stream-v2/flatten.js +1 -1
- package/dist/production/vendor/turbo-stream-v2/turbo-stream.js +1 -1
- package/dist/production/vendor/turbo-stream-v2/unflatten.js +23 -3
- package/dist/production/vendor/turbo-stream-v2/utils.js +1 -1
- package/docs/explanation/backend-for-frontend.md +0 -3
- package/docs/explanation/code-splitting.md +0 -3
- package/docs/explanation/concurrency.md +0 -3
- package/docs/explanation/hot-module-replacement.md +0 -3
- package/docs/explanation/lazy-route-discovery.md +0 -3
- package/docs/explanation/progressive-enhancement.md +0 -3
- package/docs/explanation/race-conditions.md +0 -3
- package/docs/explanation/react-transitions.md +0 -3
- package/docs/explanation/sessions-and-cookies.md +1 -1
- package/docs/explanation/state-management.md +0 -3
- package/docs/explanation/styling.md +0 -3
- package/docs/explanation/type-safety.md +0 -3
- package/docs/how-to/accessibility.md +0 -6
- package/docs/how-to/client-data.md +0 -3
- package/docs/how-to/data-strategy.md +0 -3
- package/docs/how-to/error-boundary.md +0 -3
- package/docs/how-to/error-reporting.md +0 -3
- package/docs/how-to/fetchers.md +0 -3
- package/docs/how-to/file-route-conventions.md +0 -3
- package/docs/how-to/file-uploads.md +0 -3
- package/docs/how-to/form-validation.md +0 -3
- package/docs/how-to/headers.md +0 -3
- package/docs/how-to/instrumentation.md +0 -3
- package/docs/how-to/middleware.md +6 -3
- package/docs/how-to/navigation-blocking.md +0 -3
- package/docs/how-to/optimize-revalidation.md +0 -3
- package/docs/how-to/pre-rendering.md +0 -3
- package/docs/how-to/presets.md +0 -3
- package/docs/how-to/react-server-components.md +0 -3
- package/docs/how-to/resource-routes.md +0 -3
- package/docs/how-to/route-discovery.md +4 -2
- package/docs/how-to/route-module-type-safety.md +0 -3
- package/docs/how-to/security.md +0 -3
- package/docs/how-to/server-bundles.md +0 -3
- package/docs/how-to/spa.md +0 -3
- package/docs/how-to/status.md +0 -3
- package/docs/how-to/suspense.md +22 -6
- package/docs/how-to/using-handle.md +0 -3
- package/docs/how-to/view-transitions.md +0 -3
- package/docs/start/framework/data-loading.md +9 -0
- package/docs/upgrading/future.md +0 -12
- package/docs/upgrading/v7.md +3 -33
- package/package.json +1 -1
- package/dist/development/lib/dom/global.d.ts +0 -35
- package/dist/production/lib/dom/global.d.ts +0 -35
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
+
## v8.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix `URIError: URI malformed` when an API-only (`ssr: "unstable_api-only"`) server or an `ssr: false` dev server receives a URL path with a malformed percent-encoding ([#15649](https://github.com/remix-run/react-router/pull/15649))
|
|
8
|
+
- Bound server route manifest processing for paths with expensive route expansion ([#15703](https://github.com/remix-run/react-router/pull/15703))
|
|
9
|
+
- Fall back to initial route discovery during server rendering and RSC document/data requests
|
|
10
|
+
- Account for the number and depth of candidate branches when using regex matching
|
|
11
|
+
- Encode commas within paths sent to the lazy route discovery manifest endpoint so routes with commas in their paths are discovered correctly ([#15640](https://github.com/remix-run/react-router/pull/15640))
|
|
12
|
+
- Fix fetcher revalidation errors bubbling to the root error boundary instead of the nearest boundary above the route that owns the fetcher ([#15676](https://github.com/remix-run/react-router/pull/15676))
|
|
13
|
+
- Avoid duplicate history entries when posting a `<Form>` to the current URL with an encoded `action` ([#15679](https://github.com/remix-run/react-router/pull/15679))
|
|
14
|
+
- Replace the current history entry when the `action` contains characters that get percent-encoded, such as spaces or non-ASCII characters
|
|
15
|
+
- Fix an unhandled promise rejection when the browser skips a `viewTransition` navigation, for example in a hidden tab ([#15582](https://github.com/remix-run/react-router/pull/15582))
|
|
16
|
+
- Bubble rejected `lazy.Component` imports on loader-less routes to the nearest error boundary ([#15658](https://github.com/remix-run/react-router/pull/15658))
|
|
17
|
+
- Render the error boundary instead of a blank page
|
|
18
|
+
- Preserve pending fetcher mutation revalidation when an older navigation or background reload completes to prevent stale loader data ([#15686](https://github.com/remix-run/react-router/pull/15686))
|
|
19
|
+
- Keep newer fetcher loads cancellable and preserve them when earlier revalidations finish or abort, preventing older responses from overwriting fresh fetcher data
|
|
20
|
+
- Retry rejected `lazy` route imports instead of caching failures permanently ([#15689](https://github.com/remix-run/react-router/pull/15689))
|
|
21
|
+
- Revalidate loader data when a fetcher action redirect is not followed ([#15557](https://github.com/remix-run/react-router/pull/15557))
|
|
22
|
+
- Revalidate when an action redirect is ignored because a newer navigation started or the fetcher unmounted while the action was running
|
|
23
|
+
- Include shared parent loaders when another navigation completed while the action was running
|
|
24
|
+
- Continue to respect `shouldRevalidate`
|
|
25
|
+
- Return fetchers to `idle` when a revalidation completes a pending navigation started by another fetcher's redirect
|
|
26
|
+
- Avoid adding an incompatible `document.startViewTransition()` overload to the global `Document` type ([#15680](https://github.com/remix-run/react-router/pull/15680))
|
|
27
|
+
- Allow transition results to be assigned to the DOM `ViewTransition` type
|
|
28
|
+
- Fix duplicate headers when throwing a redirect from an RSC server function ([#15667](https://github.com/remix-run/react-router/pull/15667))
|
|
29
|
+
- Skip `deleteData` in `destroySession` when the session has no ID ([#15639](https://github.com/remix-run/react-router/pull/15639))
|
|
30
|
+
- Avoid failures when destroying a session without a cookie on storage that rejects an empty key
|
|
31
|
+
- Surface the host's 404 response when a SPA fallback route has no prerendered data ([#15646](https://github.com/remix-run/react-router/pull/15646))
|
|
32
|
+
- Request single-fetch `.data` files for hydrating routes with a server `loader` in an `ssr: false` app with a `prerender` config
|
|
33
|
+
- Avoid the internal "No result found for routeId" error for non-prerendered parameterized paths served via the SPA fallback
|
|
34
|
+
- Improve turbo-stream decoding validation and object property handling ([18e1fbd](https://github.com/remix-run/react-router/commit/18e1fbd))
|
|
35
|
+
|
|
36
|
+
### Unstable Changes
|
|
37
|
+
|
|
38
|
+
⚠️ _[Unstable features](https://reactrouter.com/community/api-development-strategy#unstable-flags) are not recommended for production use_
|
|
39
|
+
|
|
40
|
+
- Add an opt-in `<Await unstable_promise={promise}>` implementation based on React's `use()` API ([#15678](https://github.com/remix-run/react-router/pull/15678))
|
|
41
|
+
- Use `React.use` instead of React Router's internal promise tracking
|
|
42
|
+
- Accept promise-like values and retain `errorElement`, `useAsyncValue`, and `useAsyncError` support
|
|
43
|
+
- Handle only promise rejections with `errorElement` when using `unstable_promise`, allowing child render errors to bubble to the nearest React error boundary
|
|
44
|
+
- Track streamed promises during decoding so settled server content stays visible during hydration updates with either Await API or direct `React.use()`
|
|
45
|
+
|
|
3
46
|
## v8.5.0
|
|
4
47
|
|
|
5
48
|
### Minor Changes
|
|
@@ -23,7 +66,7 @@
|
|
|
23
66
|
|
|
24
67
|
### Unstable Changes
|
|
25
68
|
|
|
26
|
-
⚠️
|
|
69
|
+
⚠️ _[Unstable features](https://reactrouter.com/community/api-development-strategy#unstable-flags) are not recommended for production use_
|
|
27
70
|
|
|
28
71
|
- Add an `unstable_fetch` prop to `<HydratedRouter>` to customize JavaScript-issued manifest and server data requests in conventional Framework Mode ([#15586](https://github.com/remix-run/react-router/pull/15586))
|
|
29
72
|
- The function receives the intended request as well as context identifying the type of request
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { ComponentType, ReactElement } from "react";
|
|
4
3
|
import { CookieParseOptions, CookieParseOptions as CookieParseOptions$1, CookieSerializeOptions, CookieSerializeOptions as CookieSerializeOptions$1 } from "cookie-es";
|
|
5
4
|
import { BrowserRouter, Form, HashRouter, Link, Links, MemoryRouter, Meta, NavLink, Navigate, Outlet, Route, Router, RouterProvider, Routes, ScrollRestoration, StaticRouter, StaticRouterProvider, unstable_HistoryRouter } from "react-router/internal/react-server-client";
|
|
6
5
|
import { ReactFormState } from "react-dom/client";
|
|
@@ -353,6 +352,13 @@ interface DataFunctionArgs<Context> {
|
|
|
353
352
|
* In Framework mode, this is a normalized URL with React-Router-specific
|
|
354
353
|
* implementation details removed (`.data` suffixes, `index`/`_routes` search
|
|
355
354
|
* params). For the raw incoming URL, use `request.url`.
|
|
355
|
+
*
|
|
356
|
+
* This normalization preserves standard URL pathname encoding and casing.
|
|
357
|
+
* For example, a request to `/%61dmin.data` produces a `url.pathname` of
|
|
358
|
+
* `/%61dmin`. This is not a canonical representation of the matched route.
|
|
359
|
+
* For authorization, attach {@link https://reactrouter.com/how-to/middleware#authentication server middleware}
|
|
360
|
+
* to the protected route or a common ancestor instead of relying on literal
|
|
361
|
+
* pathname-prefix comparisons.
|
|
356
362
|
*/
|
|
357
363
|
url: URL;
|
|
358
364
|
/**
|
|
@@ -837,30 +843,6 @@ interface UIMatch<Data = unknown, Handle = unknown> {
|
|
|
837
843
|
*/
|
|
838
844
|
handle: Handle;
|
|
839
845
|
}
|
|
840
|
-
interface RouteMeta<RouteObjectType extends RouteObject = RouteObject> {
|
|
841
|
-
relativePath: string;
|
|
842
|
-
caseSensitive: boolean;
|
|
843
|
-
childrenIndex: number;
|
|
844
|
-
route: RouteObjectType;
|
|
845
|
-
matcher?: RegExp;
|
|
846
|
-
compiledParams?: CompiledPathParam[];
|
|
847
|
-
}
|
|
848
|
-
/**
|
|
849
|
-
* @private
|
|
850
|
-
* PRIVATE - DO NOT USE
|
|
851
|
-
*
|
|
852
|
-
* A "branch" of routes that match a given route pattern.
|
|
853
|
-
* This is an internal interface not intended for direct external usage.
|
|
854
|
-
*/
|
|
855
|
-
interface RouteBranch<RouteObjectType extends RouteObject = RouteObject> {
|
|
856
|
-
path: string;
|
|
857
|
-
score: number;
|
|
858
|
-
routesMeta: RouteMeta<RouteObjectType>[];
|
|
859
|
-
}
|
|
860
|
-
type CompiledPathParam = {
|
|
861
|
-
paramName: string;
|
|
862
|
-
isOptional?: boolean;
|
|
863
|
-
};
|
|
864
846
|
declare class DataWithResponseInit<D> {
|
|
865
847
|
type: string;
|
|
866
848
|
data: D;
|
|
@@ -1025,18 +1007,6 @@ type ErrorResponse = {
|
|
|
1025
1007
|
declare function isRouteErrorResponse(error: any): error is ErrorResponse;
|
|
1026
1008
|
//#endregion
|
|
1027
1009
|
//#region lib/components.d.ts
|
|
1028
|
-
/**
|
|
1029
|
-
* Function signature for client side error handling for loader/actions errors
|
|
1030
|
-
* and rendering errors via `componentDidCatch`
|
|
1031
|
-
*/
|
|
1032
|
-
interface ClientOnErrorFunction {
|
|
1033
|
-
(error: unknown, info: {
|
|
1034
|
-
location: Location$1;
|
|
1035
|
-
params: Params;
|
|
1036
|
-
pattern: string;
|
|
1037
|
-
errorInfo?: React.ErrorInfo;
|
|
1038
|
-
}): void;
|
|
1039
|
-
}
|
|
1040
1010
|
interface AwaitResolveRenderFunction<Resolve = any> {
|
|
1041
1011
|
(data: Awaited<Resolve>): React.ReactNode;
|
|
1042
1012
|
}
|
|
@@ -1044,6 +1014,8 @@ interface AwaitResolveRenderFunction<Resolve = any> {
|
|
|
1044
1014
|
* @category Types
|
|
1045
1015
|
*/
|
|
1046
1016
|
interface AwaitProps<Resolve> {
|
|
1017
|
+
/** Use either `resolve` or `unstable_promise`, never both. */
|
|
1018
|
+
unstable_promise?: never;
|
|
1047
1019
|
/**
|
|
1048
1020
|
* When using a function, the resolved value is provided as the parameter.
|
|
1049
1021
|
*
|
|
@@ -1145,11 +1117,46 @@ interface AwaitProps<Resolve> {
|
|
|
1145
1117
|
*/
|
|
1146
1118
|
resolve: Resolve;
|
|
1147
1119
|
}
|
|
1120
|
+
interface AwaitPromiseProps<Resolve> extends Omit<AwaitProps<Resolve>, "resolve" | "unstable_promise"> {
|
|
1121
|
+
resolve?: never;
|
|
1122
|
+
/**
|
|
1123
|
+
* A promise (or value) to read using React's `use()` API in client components.
|
|
1124
|
+
* Unlike `resolve` in client components, this accepts promise-like values
|
|
1125
|
+
* without modifying the source promise.
|
|
1126
|
+
*
|
|
1127
|
+
* `errorElement` handles promise rejections. Errors thrown while rendering
|
|
1128
|
+
* children bubble to the nearest React error boundary.
|
|
1129
|
+
*
|
|
1130
|
+
* ```tsx
|
|
1131
|
+
* <Await unstable_promise={reviewsPromise} errorElement={<ReviewsError />}>
|
|
1132
|
+
* {(reviews) => <Reviews items={reviews} />}
|
|
1133
|
+
* </Await>
|
|
1134
|
+
* ```
|
|
1135
|
+
*
|
|
1136
|
+
* Pass exactly one of `unstable_promise` or `resolve`.
|
|
1137
|
+
*/
|
|
1138
|
+
unstable_promise: Resolve;
|
|
1139
|
+
}
|
|
1148
1140
|
/**
|
|
1149
1141
|
* Used to render promise values with automatic error handling.
|
|
1150
1142
|
*
|
|
1151
1143
|
* **Note:** `<Await>` expects to be rendered inside a [`<React.Suspense>`](https://react.dev/reference/react/Suspense)
|
|
1152
1144
|
*
|
|
1145
|
+
* Pass `unstable_promise` instead of `resolve` to opt into React's
|
|
1146
|
+
* [`use()`](https://react.dev/reference/react/use) implementation. With
|
|
1147
|
+
* `unstable_promise`, `errorElement` handles promise rejections, while errors
|
|
1148
|
+
* thrown by children bubble to the nearest React error boundary.
|
|
1149
|
+
*
|
|
1150
|
+
* In React Server Components, `resolve` already has this error-handling behavior:
|
|
1151
|
+
* `errorElement` handles only input rejections, while child render errors
|
|
1152
|
+
* propagate to the surrounding error boundary. Both props accept promise-like
|
|
1153
|
+
* values without modifying the source promise. Both props treat a falsy
|
|
1154
|
+
* `errorElement` as absent and propagate the rejection. Pass an empty fragment
|
|
1155
|
+
* to handle a rejection without rendering any content.
|
|
1156
|
+
*
|
|
1157
|
+
* <docs-warning>The `unstable_promise` prop is experimental and may change in
|
|
1158
|
+
* minor or patch releases.</docs-warning>
|
|
1159
|
+
*
|
|
1153
1160
|
* @example
|
|
1154
1161
|
* import { Await, useLoaderData } from "react-router";
|
|
1155
1162
|
*
|
|
@@ -1190,294 +1197,12 @@ interface AwaitProps<Resolve> {
|
|
|
1190
1197
|
* @param {AwaitProps.children} props.children n/a
|
|
1191
1198
|
* @param {AwaitProps.errorElement} props.errorElement n/a
|
|
1192
1199
|
* @param {AwaitProps.resolve} props.resolve n/a
|
|
1200
|
+
* @param props.unstable_promise A promise (or value) to read using React's `use()`
|
|
1201
|
+
* API in client components. Accepts promise-like values without modifying the
|
|
1202
|
+
* source promise. Pass exactly one of `unstable_promise` or `resolve`.
|
|
1193
1203
|
* @returns React element for the rendered awaited value
|
|
1194
1204
|
*/
|
|
1195
|
-
declare function Await$1<Resolve>(
|
|
1196
|
-
children,
|
|
1197
|
-
errorElement,
|
|
1198
|
-
resolve
|
|
1199
|
-
}: AwaitProps<Resolve>): React.JSX.Element;
|
|
1200
|
-
//#endregion
|
|
1201
|
-
//#region lib/server-runtime/serverHandoff.d.ts
|
|
1202
|
-
type ServerHandoff = {
|
|
1203
|
-
criticalCss?: CriticalCss;
|
|
1204
|
-
basename: string | undefined;
|
|
1205
|
-
future: FutureConfig$1;
|
|
1206
|
-
ssr: boolean;
|
|
1207
|
-
isSpaMode: boolean;
|
|
1208
|
-
unstable_apiOnly?: boolean;
|
|
1209
|
-
unstable_apiServerOrigin?: string;
|
|
1210
|
-
routeDiscovery: ServerBuild["routeDiscovery"];
|
|
1211
|
-
};
|
|
1212
|
-
//#endregion
|
|
1213
|
-
//#region lib/dom/global.d.ts
|
|
1214
|
-
type WindowReactRouterContext = ServerHandoff & {
|
|
1215
|
-
state: HydrationState;
|
|
1216
|
-
stream: ReadableStream<Uint8Array> | undefined;
|
|
1217
|
-
streamController: ReadableStreamDefaultController<Uint8Array>;
|
|
1218
|
-
};
|
|
1219
|
-
interface ViewTransition {
|
|
1220
|
-
finished: Promise<void>;
|
|
1221
|
-
ready: Promise<void>;
|
|
1222
|
-
updateCallbackDone: Promise<void>;
|
|
1223
|
-
skipTransition(): void;
|
|
1224
|
-
}
|
|
1225
|
-
declare global {
|
|
1226
|
-
var __staticRouterHydrationData: HydrationState | undefined;
|
|
1227
|
-
var __reactRouterVersion: string;
|
|
1228
|
-
interface Document {
|
|
1229
|
-
startViewTransition(cb: () => Promise<void> | void): ViewTransition;
|
|
1230
|
-
}
|
|
1231
|
-
var __reactRouterContext: WindowReactRouterContext | undefined;
|
|
1232
|
-
var __reactRouterManifest: AssetsManifest | undefined;
|
|
1233
|
-
var __reactRouterRouteModules: RouteModules | undefined;
|
|
1234
|
-
var __reactRouterDataRouter: Router$1 | undefined;
|
|
1235
|
-
var __reactRouterHdrActive: boolean;
|
|
1236
|
-
var $RefreshRuntime$: {
|
|
1237
|
-
performReactRefresh: () => void;
|
|
1238
|
-
} | undefined;
|
|
1239
|
-
}
|
|
1240
|
-
//#endregion
|
|
1241
|
-
//#region lib/dom/ssr/single-fetch.d.ts
|
|
1242
|
-
/**
|
|
1243
|
-
* Describes the operation that initiated an internal router request.
|
|
1244
|
-
*
|
|
1245
|
-
* Requests that reload fetchers as part of a navigation, revalidation, or
|
|
1246
|
-
* initialization redirect keep that initiating `type`. `fetcherKey` identifies
|
|
1247
|
-
* the fetcher being loaded, or is `null` when the request targets route loaders
|
|
1248
|
-
* or actions.
|
|
1249
|
-
*
|
|
1250
|
-
* `navigationType` is the history action (`"PUSH"`, `"REPLACE"`, or `"POP"`)
|
|
1251
|
-
* for navigation-initiated data requests, including reloaded fetchers. It is
|
|
1252
|
-
* `null` for initialization, fetcher, and revalidation requests. Manifest
|
|
1253
|
-
* requests have no navigation type.
|
|
1254
|
-
*/
|
|
1255
|
-
type RouterFetchContext = {
|
|
1256
|
-
type: "manifest";
|
|
1257
|
-
} | {
|
|
1258
|
-
type: "navigation";
|
|
1259
|
-
fetcherKey: string | null;
|
|
1260
|
-
navigationType: Action;
|
|
1261
|
-
} | {
|
|
1262
|
-
type: "initialization" | "fetcher" | "revalidation";
|
|
1263
|
-
fetcherKey: string | null;
|
|
1264
|
-
navigationType: null;
|
|
1265
|
-
};
|
|
1266
|
-
type RouterFetch = (request: Request, context: RouterFetchContext) => Promise<Response>;
|
|
1267
|
-
//#endregion
|
|
1268
|
-
//#region lib/dom/ssr/route-discovery.d.ts
|
|
1269
|
-
/** A discovery response from a different build. */
|
|
1270
|
-
type ManifestMismatchEvent = {
|
|
1271
|
-
source: "eager" | "navigation" | "fetcher" | "imperative";
|
|
1272
|
-
version: string;
|
|
1273
|
-
reloadUrl: string | null;
|
|
1274
|
-
loadAllRoutes(): Promise<void>;
|
|
1275
|
-
stopPropagation(): void; /** Run built-in recovery for this source, at most once per mismatch event. */
|
|
1276
|
-
defaultBehavior(): Promise<void>;
|
|
1277
|
-
};
|
|
1278
|
-
/** The result of imperative route discovery. */
|
|
1279
|
-
type DiscoveryResult = {
|
|
1280
|
-
type: "success";
|
|
1281
|
-
} | {
|
|
1282
|
-
type: "version-mismatch";
|
|
1283
|
-
} | {
|
|
1284
|
-
type: "aborted";
|
|
1285
|
-
};
|
|
1286
|
-
/** Options for {@link unstable_useRouteDiscovery}. */
|
|
1287
|
-
type RouteDiscoveryOptions = {
|
|
1288
|
-
onManifestMismatch?: (event: ManifestMismatchEvent) => void | Promise<void>;
|
|
1289
|
-
};
|
|
1290
|
-
type Registration = {
|
|
1291
|
-
current: RouteDiscoveryOptions;
|
|
1292
|
-
};
|
|
1293
|
-
type DiscoveryState = "partial" | "loading" | "complete";
|
|
1294
|
-
type RouteDiscoverySsrInfo = {
|
|
1295
|
-
manifest: AssetsManifest;
|
|
1296
|
-
routeModules: RouteModules;
|
|
1297
|
-
router: Router$1 | undefined;
|
|
1298
|
-
context: Pick<WindowReactRouterContext, "ssr" | "routeDiscovery" | "isSpaMode" | "basename" | "unstable_apiServerOrigin" | "unstable_apiOnly">;
|
|
1299
|
-
};
|
|
1300
|
-
declare class RouteDiscoveryRuntime {
|
|
1301
|
-
private ssrInfo;
|
|
1302
|
-
readonly enabled: boolean;
|
|
1303
|
-
readonly discoveredPaths: Set<string>;
|
|
1304
|
-
readonly nextPaths: Set<string>;
|
|
1305
|
-
state: DiscoveryState;
|
|
1306
|
-
ready: boolean;
|
|
1307
|
-
private registrations;
|
|
1308
|
-
private listeners;
|
|
1309
|
-
private fullLoadErrorListeners;
|
|
1310
|
-
private fullLoad?;
|
|
1311
|
-
private loadedManifest?;
|
|
1312
|
-
private mismatch?;
|
|
1313
|
-
private fetchImplementation;
|
|
1314
|
-
private loadManifest;
|
|
1315
|
-
onError?: ClientOnErrorFunction;
|
|
1316
|
-
constructor(ssrInfo: RouteDiscoverySsrInfo, {
|
|
1317
|
-
fetch: fetchImplementation,
|
|
1318
|
-
loadManifest
|
|
1319
|
-
}?: {
|
|
1320
|
-
fetch?: RouterFetch;
|
|
1321
|
-
loadManifest?: () => Promise<AssetsManifest>;
|
|
1322
|
-
});
|
|
1323
|
-
private get router();
|
|
1324
|
-
private loadManifestAsset;
|
|
1325
|
-
subscribe: (listener: () => void) => () => void;
|
|
1326
|
-
private update;
|
|
1327
|
-
markReady: () => void;
|
|
1328
|
-
register(registration: Registration): () => void;
|
|
1329
|
-
private isComplete;
|
|
1330
|
-
loadAllRoutes: () => Promise<void>;
|
|
1331
|
-
reportError(error: unknown): void;
|
|
1332
|
-
private dispatchMismatch;
|
|
1333
|
-
private requestUrl;
|
|
1334
|
-
discoverRoutes: (paths: string[], options?: {
|
|
1335
|
-
signal?: AbortSignal;
|
|
1336
|
-
}) => Promise<DiscoveryResult>;
|
|
1337
|
-
discover(paths: string[], source: ManifestMismatchEvent["source"], reloadUrl: string | null, signal?: AbortSignal, patch?: (routeId: string | null, children: RouteObject[], unstable_allowElementMutations?: boolean) => void): Promise<DiscoveryResult>;
|
|
1338
|
-
}
|
|
1339
|
-
//#endregion
|
|
1340
|
-
//#region lib/dom/ssr/entry.d.ts
|
|
1341
|
-
type SerializedError = {
|
|
1342
|
-
message: string;
|
|
1343
|
-
stack?: string;
|
|
1344
|
-
};
|
|
1345
|
-
interface FrameworkContextObject {
|
|
1346
|
-
routeDiscoveryRuntime?: RouteDiscoveryRuntime;
|
|
1347
|
-
routeDiscoveryState?: DiscoveryState;
|
|
1348
|
-
manifest: AssetsManifest;
|
|
1349
|
-
routeModules: RouteModules;
|
|
1350
|
-
criticalCss?: CriticalCss;
|
|
1351
|
-
serverHandoffString?: string;
|
|
1352
|
-
future: FutureConfig$1;
|
|
1353
|
-
ssr: boolean;
|
|
1354
|
-
isSpaMode: boolean;
|
|
1355
|
-
unstable_apiOnly?: boolean;
|
|
1356
|
-
unstable_apiServerOrigin?: string;
|
|
1357
|
-
routeDiscovery: ServerBuild["routeDiscovery"];
|
|
1358
|
-
nonce?: string;
|
|
1359
|
-
serializeError?(error: Error): SerializedError;
|
|
1360
|
-
renderMeta?: {
|
|
1361
|
-
didRenderScripts?: boolean;
|
|
1362
|
-
streamCache?: Record<number, Promise<void> & {
|
|
1363
|
-
result?: {
|
|
1364
|
-
done: boolean;
|
|
1365
|
-
value: string;
|
|
1366
|
-
};
|
|
1367
|
-
error?: unknown;
|
|
1368
|
-
}>;
|
|
1369
|
-
};
|
|
1370
|
-
}
|
|
1371
|
-
interface EntryContext extends FrameworkContextObject {
|
|
1372
|
-
/**
|
|
1373
|
-
* @deprecated This property was an internal implementation detail and was
|
|
1374
|
-
* never intended for use in `entry.server.tsx`. It is always an empty array.
|
|
1375
|
-
*/
|
|
1376
|
-
branches: RouteBranch<DataRouteObject>[];
|
|
1377
|
-
staticHandlerContext: StaticHandlerContext;
|
|
1378
|
-
serverHandoffStream?: ReadableStream<Uint8Array>;
|
|
1379
|
-
}
|
|
1380
|
-
interface FutureConfig$1 {
|
|
1381
|
-
unstable_customRouteDiscovery?: boolean;
|
|
1382
|
-
}
|
|
1383
|
-
type CriticalCss = string | {
|
|
1384
|
-
rel: "stylesheet";
|
|
1385
|
-
href: string;
|
|
1386
|
-
};
|
|
1387
|
-
interface AssetsManifest {
|
|
1388
|
-
entry: {
|
|
1389
|
-
imports: string[];
|
|
1390
|
-
module: string;
|
|
1391
|
-
};
|
|
1392
|
-
routes: RouteManifest<EntryRoute>;
|
|
1393
|
-
url: string;
|
|
1394
|
-
version: string;
|
|
1395
|
-
hmr?: {
|
|
1396
|
-
timestamp?: number;
|
|
1397
|
-
runtime: string;
|
|
1398
|
-
};
|
|
1399
|
-
sri?: Record<string, string> | true;
|
|
1400
|
-
}
|
|
1401
|
-
//#endregion
|
|
1402
|
-
//#region lib/server-runtime/routes.d.ts
|
|
1403
|
-
type ServerRouteManifest = RouteManifest<Omit<ServerRoute, "children">>;
|
|
1404
|
-
interface ServerRoute extends Route$1 {
|
|
1405
|
-
children: ServerRoute[];
|
|
1406
|
-
module: ServerRouteModule;
|
|
1407
|
-
}
|
|
1408
|
-
//#endregion
|
|
1409
|
-
//#region lib/server-runtime/build.d.ts
|
|
1410
|
-
type OptionalCriticalCss = CriticalCss | undefined;
|
|
1411
|
-
/**
|
|
1412
|
-
* The output of the compiler for the server build.
|
|
1413
|
-
*/
|
|
1414
|
-
interface ServerBuild {
|
|
1415
|
-
entry: {
|
|
1416
|
-
module: ServerEntryModule;
|
|
1417
|
-
};
|
|
1418
|
-
routes: ServerRouteManifest;
|
|
1419
|
-
assets: AssetsManifest;
|
|
1420
|
-
basename?: string;
|
|
1421
|
-
publicPath: string;
|
|
1422
|
-
assetsBuildDirectory: string;
|
|
1423
|
-
future: FutureConfig$1;
|
|
1424
|
-
/**
|
|
1425
|
-
* Whether runtime server requests are supported, including API-only builds.
|
|
1426
|
-
*/
|
|
1427
|
-
ssr: boolean;
|
|
1428
|
-
/**
|
|
1429
|
-
* The origin to use for server requests in API-only mode.
|
|
1430
|
-
* @internal
|
|
1431
|
-
*/
|
|
1432
|
-
unstable_apiServerOrigin?: string;
|
|
1433
|
-
/**
|
|
1434
|
-
* Whether production document rendering is disabled while data and route
|
|
1435
|
-
* discovery requests remain supported.
|
|
1436
|
-
* @internal
|
|
1437
|
-
*/
|
|
1438
|
-
unstable_apiOnly?: boolean;
|
|
1439
|
-
unstable_getCriticalCss?: (args: {
|
|
1440
|
-
pathname: string;
|
|
1441
|
-
}) => OptionalCriticalCss | Promise<OptionalCriticalCss>;
|
|
1442
|
-
/**
|
|
1443
|
-
* @deprecated This is now done via a custom header during prerendering
|
|
1444
|
-
*/
|
|
1445
|
-
isSpaMode: boolean;
|
|
1446
|
-
prerender: string[];
|
|
1447
|
-
routeDiscovery: {
|
|
1448
|
-
mode: "lazy" | "initial";
|
|
1449
|
-
manifestPath: string;
|
|
1450
|
-
};
|
|
1451
|
-
allowedActionOrigins?: string[] | false;
|
|
1452
|
-
}
|
|
1453
|
-
interface HandleDocumentRequestFunction {
|
|
1454
|
-
(request: Request, responseStatusCode: number, responseHeaders: Headers, context: EntryContext, loadContext: RouterContextProvider): Promise<Response> | Response;
|
|
1455
|
-
}
|
|
1456
|
-
interface HandleDataRequestFunction {
|
|
1457
|
-
(response: Response, args: {
|
|
1458
|
-
request: LoaderFunctionArgs["request"] | ActionFunctionArgs["request"];
|
|
1459
|
-
context: LoaderFunctionArgs["context"] | ActionFunctionArgs["context"];
|
|
1460
|
-
params: LoaderFunctionArgs["params"] | ActionFunctionArgs["params"];
|
|
1461
|
-
}): Promise<Response> | Response;
|
|
1462
|
-
}
|
|
1463
|
-
interface HandleErrorFunction {
|
|
1464
|
-
(error: unknown, args: {
|
|
1465
|
-
request: LoaderFunctionArgs["request"] | ActionFunctionArgs["request"];
|
|
1466
|
-
context: LoaderFunctionArgs["context"] | ActionFunctionArgs["context"];
|
|
1467
|
-
params: LoaderFunctionArgs["params"] | ActionFunctionArgs["params"];
|
|
1468
|
-
}): void;
|
|
1469
|
-
}
|
|
1470
|
-
/**
|
|
1471
|
-
* A module that serves as the entry point for a Remix app during server
|
|
1472
|
-
* rendering.
|
|
1473
|
-
*/
|
|
1474
|
-
interface ServerEntryModule {
|
|
1475
|
-
default: HandleDocumentRequestFunction;
|
|
1476
|
-
handleDataRequest?: HandleDataRequestFunction;
|
|
1477
|
-
handleError?: HandleErrorFunction;
|
|
1478
|
-
instrumentations?: ServerInstrumentation[];
|
|
1479
|
-
streamTimeout?: number;
|
|
1480
|
-
}
|
|
1205
|
+
declare function Await$1<Resolve>(props: AwaitProps<Resolve> | AwaitPromiseProps<Resolve>): React.JSX.Element;
|
|
1481
1206
|
//#endregion
|
|
1482
1207
|
//#region lib/router/instrumentation.d.ts
|
|
1483
1208
|
type ServerInstrumentation = {
|
|
@@ -1937,6 +1662,8 @@ interface StaticHandler {
|
|
|
1937
1662
|
* The set of data routes managed by this handler
|
|
1938
1663
|
*/
|
|
1939
1664
|
dataRoutes: DataRouteObject[];
|
|
1665
|
+
/** @private Estimated route metadata visits per regex match. */
|
|
1666
|
+
readonly _matchCost?: number;
|
|
1940
1667
|
/**
|
|
1941
1668
|
* @private
|
|
1942
1669
|
* PRIVATE - DO NOT USE
|
|
@@ -2257,31 +1984,6 @@ interface CreateStaticHandlerOptions {
|
|
|
2257
1984
|
*/
|
|
2258
1985
|
declare function createStaticHandler(routes: RouteObject[], opts?: CreateStaticHandlerOptions): StaticHandler;
|
|
2259
1986
|
//#endregion
|
|
2260
|
-
//#region lib/dom/ssr/routes.d.ts
|
|
2261
|
-
interface Route$1 {
|
|
2262
|
-
index?: boolean;
|
|
2263
|
-
caseSensitive?: boolean;
|
|
2264
|
-
id: string;
|
|
2265
|
-
parentId?: string;
|
|
2266
|
-
path?: string;
|
|
2267
|
-
}
|
|
2268
|
-
interface EntryRoute extends Route$1 {
|
|
2269
|
-
hasAction: boolean;
|
|
2270
|
-
hasLoader: boolean;
|
|
2271
|
-
hasClientAction: boolean;
|
|
2272
|
-
hasClientLoader: boolean;
|
|
2273
|
-
hasClientMiddleware: boolean;
|
|
2274
|
-
hasErrorBoundary: boolean;
|
|
2275
|
-
imports?: string[];
|
|
2276
|
-
css?: string[];
|
|
2277
|
-
module: string;
|
|
2278
|
-
clientActionModule: string | undefined;
|
|
2279
|
-
clientLoaderModule: string | undefined;
|
|
2280
|
-
clientMiddlewareModule: string | undefined;
|
|
2281
|
-
hydrateFallbackModule: string | undefined;
|
|
2282
|
-
parentId?: string;
|
|
2283
|
-
}
|
|
2284
|
-
//#endregion
|
|
2285
1987
|
//#region lib/router/links.d.ts
|
|
2286
1988
|
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
2287
1989
|
type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
|
|
@@ -2469,36 +2171,6 @@ type ClientDataFunctionArgs<Params> = {
|
|
|
2469
2171
|
type SerializeFrom<T> = T extends ((...args: infer Args) => unknown) ? Args extends [ClientLoaderFunctionArgs | ClientActionFunctionArgs | ClientDataFunctionArgs<unknown>] ? ClientDataFrom<T> : ServerDataFrom<T> : T;
|
|
2470
2172
|
//#endregion
|
|
2471
2173
|
//#region lib/dom/ssr/routeModules.d.ts
|
|
2472
|
-
interface RouteModules {
|
|
2473
|
-
[routeId: string]: RouteModule | undefined;
|
|
2474
|
-
}
|
|
2475
|
-
/**
|
|
2476
|
-
* The shape of a route module shipped to the client
|
|
2477
|
-
*/
|
|
2478
|
-
interface RouteModule {
|
|
2479
|
-
clientAction?: ClientActionFunction;
|
|
2480
|
-
clientLoader?: ClientLoaderFunction;
|
|
2481
|
-
clientMiddleware?: MiddlewareFunction<Record<string, DataStrategyResult>>[];
|
|
2482
|
-
ErrorBoundary?: ErrorBoundaryComponent;
|
|
2483
|
-
HydrateFallback?: HydrateFallbackComponent;
|
|
2484
|
-
Layout?: LayoutComponent;
|
|
2485
|
-
default: RouteComponent;
|
|
2486
|
-
handle?: RouteHandle;
|
|
2487
|
-
links?: LinksFunction;
|
|
2488
|
-
meta?: MetaFunction;
|
|
2489
|
-
shouldRevalidate?: ShouldRevalidateFunction;
|
|
2490
|
-
}
|
|
2491
|
-
/**
|
|
2492
|
-
* The shape of a route module on the server
|
|
2493
|
-
*/
|
|
2494
|
-
interface ServerRouteModule extends RouteModule {
|
|
2495
|
-
action?: ActionFunction;
|
|
2496
|
-
headers?: HeadersFunction | {
|
|
2497
|
-
[name: string]: string;
|
|
2498
|
-
};
|
|
2499
|
-
loader?: LoaderFunction;
|
|
2500
|
-
middleware?: MiddlewareFunction<Response>[];
|
|
2501
|
-
}
|
|
2502
2174
|
/**
|
|
2503
2175
|
* A function that handles data mutations for a route on the client
|
|
2504
2176
|
*/
|
|
@@ -2521,10 +2193,6 @@ type ClientLoaderFunction = ((args: ClientLoaderFunctionArgs) => ReturnType<Load
|
|
|
2521
2193
|
type ClientLoaderFunctionArgs = LoaderFunctionArgs & {
|
|
2522
2194
|
serverLoader: <T = unknown>() => Promise<SerializeFrom<T>>;
|
|
2523
2195
|
};
|
|
2524
|
-
/**
|
|
2525
|
-
* ErrorBoundary to display for this route
|
|
2526
|
-
*/
|
|
2527
|
-
type ErrorBoundaryComponent = ComponentType;
|
|
2528
2196
|
type HeadersArgs = {
|
|
2529
2197
|
loaderHeaders: Headers;
|
|
2530
2198
|
parentHeaders: Headers;
|
|
@@ -2538,19 +2206,6 @@ type HeadersArgs = {
|
|
|
2538
2206
|
interface HeadersFunction {
|
|
2539
2207
|
(args: HeadersArgs): Headers | HeadersInit;
|
|
2540
2208
|
}
|
|
2541
|
-
/**
|
|
2542
|
-
* `<Route HydrateFallback>` component to render on initial loads
|
|
2543
|
-
* when client loaders are present
|
|
2544
|
-
*/
|
|
2545
|
-
type HydrateFallbackComponent = ComponentType;
|
|
2546
|
-
/**
|
|
2547
|
-
* Optional, root-only `<Route Layout>` component to wrap the root content in.
|
|
2548
|
-
* Useful for defining the <html>/<head>/<body> document shell shared by the
|
|
2549
|
-
* Component, HydrateFallback, and ErrorBoundary
|
|
2550
|
-
*/
|
|
2551
|
-
type LayoutComponent = ComponentType<{
|
|
2552
|
-
children: ReactElement<unknown, ErrorBoundaryComponent | HydrateFallbackComponent | RouteComponent>;
|
|
2553
|
-
}>;
|
|
2554
2209
|
/**
|
|
2555
2210
|
* A function that defines `<link>` tags to be inserted into the `<head>` of
|
|
2556
2211
|
* the document on route transitions.
|
|
@@ -2658,7 +2313,6 @@ type LdJsonValue = LdJsonPrimitive | LdJsonObject | LdJsonArray;
|
|
|
2658
2313
|
/**
|
|
2659
2314
|
* A React component that is rendered for a route.
|
|
2660
2315
|
*/
|
|
2661
|
-
type RouteComponent = ComponentType<{}>;
|
|
2662
2316
|
/**
|
|
2663
2317
|
* An arbitrary object that is associated with a route.
|
|
2664
2318
|
*
|