react-router 0.0.0-experimental-3d7dcee → 0.0.0-experimental-7ed11be
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 +15 -2
- package/dist/development/{chunk-QMIAKNRH.mjs → chunk-2OYLVAZB.mjs} +2 -2
- package/dist/development/{chunk-S2WJDCRE.js → chunk-BELBAVMB.js} +193 -254
- package/dist/development/{chunk-WJ2QP6HN.mjs → chunk-MUVPFEOF.mjs} +154 -210
- package/dist/development/{chunk-LSB26UC6.js → chunk-X5OYM2ET.js} +137 -132
- package/dist/{production/context-DnZM5brG.d.mts → development/context-CRZ6DK7I.d.mts} +11 -1
- package/dist/development/dom-export.d.mts +1 -1
- package/dist/development/dom-export.js +3 -3
- package/dist/development/dom-export.mjs +3 -3
- package/dist/development/{index-react-server-client-zr5eNeut.d.ts → index-react-server-client-DM3R9ovf.d.ts} +39 -23
- package/dist/{production/index-react-server-client-9rHNv-U3.d.mts → development/index-react-server-client-DbUtZHNh.d.mts} +40 -24
- package/dist/development/index-react-server-client.d.mts +3 -3
- package/dist/development/index-react-server-client.d.ts +2 -2
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.d.mts +49 -2
- package/dist/development/index-react-server.d.ts +49 -2
- package/dist/development/index-react-server.js +72 -81
- package/dist/development/index-react-server.mjs +72 -82
- package/dist/development/index.d.mts +44 -6
- package/dist/development/index.d.ts +42 -4
- package/dist/development/index.js +102 -102
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.d.mts +8 -5
- package/dist/development/lib/types/internal.d.ts +7 -4
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{route-data-C24VEkoE.d.mts → route-data-gwXJPIqL.d.mts} +3 -3
- package/dist/development/{routeModules-FY5IBiA_.d.ts → routeModules-Dz64j-T-.d.ts} +12 -2
- package/dist/production/{chunk-OFC37UQM.mjs → chunk-7A6GBCQS.mjs} +2 -2
- package/dist/production/{chunk-7CWVKQLP.js → chunk-A4J35SEJ.js} +193 -254
- package/dist/production/{chunk-2BFZ6QQU.mjs → chunk-IC5TORKA.mjs} +154 -210
- package/dist/production/{chunk-NIW37A6Q.js → chunk-W6BB3ISI.js} +137 -132
- package/dist/{development/context-DnZM5brG.d.mts → production/context-CRZ6DK7I.d.mts} +11 -1
- package/dist/production/dom-export.d.mts +1 -1
- package/dist/production/dom-export.js +3 -3
- package/dist/production/dom-export.mjs +3 -3
- package/dist/production/{index-react-server-client-zr5eNeut.d.ts → index-react-server-client-DM3R9ovf.d.ts} +39 -23
- package/dist/{development/index-react-server-client-9rHNv-U3.d.mts → production/index-react-server-client-DbUtZHNh.d.mts} +40 -24
- package/dist/production/index-react-server-client.d.mts +3 -3
- package/dist/production/index-react-server-client.d.ts +2 -2
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.d.mts +49 -2
- package/dist/production/index-react-server.d.ts +49 -2
- package/dist/production/index-react-server.js +72 -81
- package/dist/production/index-react-server.mjs +72 -82
- package/dist/production/index.d.mts +44 -6
- package/dist/production/index.d.ts +42 -4
- package/dist/production/index.js +102 -102
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.d.mts +8 -5
- package/dist/production/lib/types/internal.d.ts +7 -4
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{route-data-C24VEkoE.d.mts → route-data-gwXJPIqL.d.mts} +3 -3
- package/dist/production/{routeModules-FY5IBiA_.d.ts → routeModules-Dz64j-T-.d.ts} +12 -2
- package/package.json +1 -1
|
@@ -1161,6 +1161,16 @@ interface Router$1 {
|
|
|
1161
1161
|
* @param key
|
|
1162
1162
|
*/
|
|
1163
1163
|
getFetcher<TData = any>(key: string): Fetcher<TData>;
|
|
1164
|
+
/**
|
|
1165
|
+
* @internal
|
|
1166
|
+
* PRIVATE - DO NOT USE
|
|
1167
|
+
*
|
|
1168
|
+
* Reset the fetcher for a given key
|
|
1169
|
+
* @param key
|
|
1170
|
+
*/
|
|
1171
|
+
resetFetcher(key: string, opts?: {
|
|
1172
|
+
reason?: unknown;
|
|
1173
|
+
}): void;
|
|
1164
1174
|
/**
|
|
1165
1175
|
* @private
|
|
1166
1176
|
* PRIVATE - DO NOT USE
|
|
@@ -2537,4 +2547,4 @@ interface RouteContextObject {
|
|
|
2537
2547
|
}
|
|
2538
2548
|
declare const RouteContext: React.Context<RouteContextObject>;
|
|
2539
2549
|
|
|
2540
|
-
export { type
|
|
2550
|
+
export { type DataStrategyMatch as $, type ActionFunctionArgs as A, type BlockerFunction as B, type PatchRoutesOnNavigationFunction as C, type DataStrategyResult as D, type ErrorBoundaryType as E, type DataRouteObject as F, type StaticHandler as G, type HydrationState as H, type InitialEntry as I, type GetScrollPositionFunction as J, type GetScrollRestorationKeyFunction as K, type Location as L, type MiddlewareEnabled as M, type NavigateOptions as N, type StaticHandlerContext as O, type Params as P, type Fetcher as Q, type RouterProviderProps as R, type ShouldRevalidateFunction as S, type To as T, type UIMatch as U, type NavigationStates as V, type RouterSubscriber as W, type RouterNavigateOptions as X, type RouterFetchOptions as Y, type RevalidationState as Z, type DataStrategyFunctionArgs as _, type RouterInit as a, mapRouteProperties as a$, type ErrorResponse as a0, type FormEncType as a1, type FormMethod as a2, type HTMLFormMethod as a3, type LazyRouteFunction as a4, type PathParam as a5, type RedirectFunction as a6, type unstable_RouterContext as a7, type ShouldRevalidateFunctionArgs as a8, unstable_createContext as a9, type RouterProps as aA, type RoutesProps as aB, Await as aC, MemoryRouter as aD, Navigate as aE, Outlet as aF, Route as aG, Router as aH, RouterProvider as aI, Routes as aJ, createMemoryRouter as aK, createRoutesFromChildren as aL, createRoutesFromElements as aM, renderMatches as aN, type Future as aO, createBrowserHistory as aP, invariant as aQ, createRouter as aR, ErrorResponseImpl as aS, DataRouterContext as aT, DataRouterStateContext as aU, FetchersContext as aV, LocationContext as aW, NavigationContext as aX, RouteContext as aY, ViewTransitionContext as aZ, hydrationRouteProperties as a_, createPath as aa, parsePath as ab, IDLE_NAVIGATION as ac, IDLE_FETCHER as ad, IDLE_BLOCKER as ae, data as af, generatePath as ag, isRouteErrorResponse as ah, matchPath as ai, matchRoutes as aj, redirect as ak, redirectDocument as al, replace as am, resolvePath as an, type Navigator as ao, type PatchRoutesOnNavigationFunctionArgs as ap, type RouteMatch as aq, type AwaitProps as ar, type IndexRouteProps as as, type LayoutRouteProps as at, type MemoryRouterOpts as au, type MemoryRouterProps as av, type NavigateProps as aw, type OutletProps as ax, type PathRouteProps as ay, type RouteProps as az, type unstable_MiddlewareNextFunction as b, WithComponentProps as b0, withComponentProps as b1, WithHydrateFallbackProps as b2, withHydrateFallbackProps as b3, WithErrorBoundaryProps as b4, withErrorBoundaryProps as b5, type RouteManifest as b6, type History as b7, type FutureConfig as b8, type CreateStaticHandlerOptions as b9, type LoaderFunctionArgs as c, type ActionFunction as d, type LoaderFunction as e, type DataRouteMatch as f, type unstable_MiddlewareFunction as g, unstable_RouterContextProvider as h, DataWithResponseInit as i, type Router$1 as j, type DataStrategyFunction as k, type Blocker as l, type RelativeRoutingType as m, type ParamParseKey as n, type Path as o, type PathPattern as p, type PathMatch as q, type Navigation as r, Action as s, type RouteObject as t, type unstable_ClientOnErrorFunction as u, type IndexRouteObject as v, type RouteComponentType as w, type HydrateFallbackType as x, type NonIndexRouteObject as y, type RouterState as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterProviderProps$1, a as RouterInit, u as unstable_ClientOnErrorFunction } from './context-
|
|
2
|
+
import { R as RouterProviderProps$1, a as RouterInit, u as unstable_ClientOnErrorFunction } from './context-CRZ6DK7I.mjs';
|
|
3
3
|
import './browser-z32v5KVN.mjs';
|
|
4
4
|
|
|
5
5
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-7ed11be
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"use client";
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkBELBAVMBjs = require('./chunk-BELBAVMB.js');
|
|
15
15
|
|
|
16
16
|
// lib/dom-export/dom-router-provider.tsx
|
|
17
17
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react);
|
|
@@ -180,7 +180,7 @@ function HydratedRouter(props) {
|
|
|
180
180
|
}, []);
|
|
181
181
|
React2.useEffect(() => {
|
|
182
182
|
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
|
|
183
|
-
document.querySelectorAll(`[${
|
|
183
|
+
document.querySelectorAll(`[${_chunkBELBAVMBjs.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
|
184
184
|
}
|
|
185
185
|
}, [criticalCss]);
|
|
186
186
|
let [location, setLocation] = React2.useState(router.state.location);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-7ed11be
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import {
|
|
13
13
|
deserializeErrors,
|
|
14
14
|
getHydrationData
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2OYLVAZB.mjs";
|
|
16
16
|
import {
|
|
17
17
|
CRITICAL_CSS_DATA_ATTRIBUTE,
|
|
18
18
|
FrameworkContext,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
invariant,
|
|
30
30
|
mapRouteProperties,
|
|
31
31
|
useFogOFWarDiscovery
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-MUVPFEOF.mjs";
|
|
33
33
|
|
|
34
34
|
// lib/dom-export/dom-router-provider.tsx
|
|
35
35
|
import * as React from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ai as HTMLFormMethod, ag as FormEncType, j as RelativeRoutingType, bx as RouteManifest, by as ServerRouteModule, O as MiddlewareEnabled, K as unstable_RouterContextProvider, J as AppLoadContext, ak as LoaderFunctionArgs, ab as ActionFunctionArgs, e as RouteModules, H as HydrationState, a0 as DataRouteObject, W as ClientLoaderFunction, a4 as StaticHandlerContext, ba as PageLinkDescriptor, T as To, bz as History, a3 as GetScrollRestorationKeyFunction, Z as RouterInit, bA as FutureConfig$1, f as DataStrategyFunction, $ as PatchRoutesOnNavigationFunction, g as NavigateOptions, a5 as Fetcher, q as RouteObject, d as Router, i as SerializeFrom, B as BlockerFunction, a as Location, bB as CreateStaticHandlerOptions$1, a1 as StaticHandler } from './routeModules-Dz64j-T-.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
type ParamKeyValuePair = [string, string];
|
|
@@ -2075,6 +2075,41 @@ type FetcherWithComponents<TData> = Fetcher<TData> & {
|
|
|
2075
2075
|
* ```
|
|
2076
2076
|
*/
|
|
2077
2077
|
Form: React.ForwardRefExoticComponent<FetcherFormProps & React.RefAttributes<HTMLFormElement>>;
|
|
2078
|
+
/**
|
|
2079
|
+
* Loads data from a route. Useful for loading data imperatively inside user
|
|
2080
|
+
* events outside a normal button or form, like a combobox or search input.
|
|
2081
|
+
*
|
|
2082
|
+
* ```tsx
|
|
2083
|
+
* let fetcher = useFetcher()
|
|
2084
|
+
*
|
|
2085
|
+
* <input onChange={e => {
|
|
2086
|
+
* fetcher.load(`/search?q=${e.target.value}`)
|
|
2087
|
+
* }} />
|
|
2088
|
+
* ```
|
|
2089
|
+
*/
|
|
2090
|
+
load: (href: string, opts?: {
|
|
2091
|
+
/**
|
|
2092
|
+
* Wraps the initial state update for this `fetcher.load` in a
|
|
2093
|
+
* [`ReactDOM.flushSync`](https://react.dev/reference/react-dom/flushSync)
|
|
2094
|
+
* call instead of the default [`React.startTransition`](https://react.dev/reference/react/startTransition).
|
|
2095
|
+
* This allows you to perform synchronous DOM actions immediately after the
|
|
2096
|
+
* update is flushed to the DOM.
|
|
2097
|
+
*/
|
|
2098
|
+
flushSync?: boolean;
|
|
2099
|
+
}) => Promise<void>;
|
|
2100
|
+
/**
|
|
2101
|
+
* Reset a fetcher back to an empty/idle state.
|
|
2102
|
+
*
|
|
2103
|
+
* If the fetcher is currently in-flight, the
|
|
2104
|
+
* [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController)
|
|
2105
|
+
* will be aborted with the `reason`, if provided.
|
|
2106
|
+
*
|
|
2107
|
+
* @param reason Optional `reason` to provide to [`AbortController.abort()`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)
|
|
2108
|
+
* @returns void
|
|
2109
|
+
*/
|
|
2110
|
+
unstable_reset: (opts?: {
|
|
2111
|
+
reason?: unknown;
|
|
2112
|
+
}) => void;
|
|
2078
2113
|
/**
|
|
2079
2114
|
* Submits form data to a route. While multiple nested routes can match a URL, only the leaf route will be called.
|
|
2080
2115
|
*
|
|
@@ -2128,28 +2163,6 @@ type FetcherWithComponents<TData> = Fetcher<TData> & {
|
|
|
2128
2163
|
* ```
|
|
2129
2164
|
*/
|
|
2130
2165
|
submit: FetcherSubmitFunction;
|
|
2131
|
-
/**
|
|
2132
|
-
* Loads data from a route. Useful for loading data imperatively inside user
|
|
2133
|
-
* events outside a normal button or form, like a combobox or search input.
|
|
2134
|
-
*
|
|
2135
|
-
* ```tsx
|
|
2136
|
-
* let fetcher = useFetcher()
|
|
2137
|
-
*
|
|
2138
|
-
* <input onChange={e => {
|
|
2139
|
-
* fetcher.load(`/search?q=${e.target.value}`)
|
|
2140
|
-
* }} />
|
|
2141
|
-
* ```
|
|
2142
|
-
*/
|
|
2143
|
-
load: (href: string, opts?: {
|
|
2144
|
-
/**
|
|
2145
|
-
* Wraps the initial state update for this `fetcher.load` in a
|
|
2146
|
-
* [`ReactDOM.flushSync`](https://react.dev/reference/react-dom/flushSync)
|
|
2147
|
-
* call instead of the default [`React.startTransition`](https://react.dev/reference/react/startTransition).
|
|
2148
|
-
* This allows you to perform synchronous DOM actions immediately after the
|
|
2149
|
-
* update is flushed to the DOM.
|
|
2150
|
-
*/
|
|
2151
|
-
flushSync?: boolean;
|
|
2152
|
-
}) => Promise<void>;
|
|
2153
2166
|
};
|
|
2154
2167
|
/**
|
|
2155
2168
|
* Useful for creating complex, dynamic user interfaces that require multiple,
|
|
@@ -2181,6 +2194,9 @@ type FetcherWithComponents<TData> = Fetcher<TData> & {
|
|
|
2181
2194
|
* method: "post",
|
|
2182
2195
|
* encType: "application/json"
|
|
2183
2196
|
* })
|
|
2197
|
+
*
|
|
2198
|
+
* // reset fetcher
|
|
2199
|
+
* fetcher.unstable_reset()
|
|
2184
2200
|
* }
|
|
2185
2201
|
*
|
|
2186
2202
|
* @public
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b6 as RouteManifest, M as MiddlewareEnabled,
|
|
1
|
+
import { b6 as RouteManifest, M as MiddlewareEnabled, h as unstable_RouterContextProvider, c as LoaderFunctionArgs, A as ActionFunctionArgs, O as StaticHandlerContext, H as HydrationState, F as DataRouteObject, a3 as HTMLFormMethod, a1 as FormEncType, m as RelativeRoutingType, T as To, b7 as History, K as GetScrollRestorationKeyFunction, a as RouterInit, b8 as FutureConfig$1, k as DataStrategyFunction, C as PatchRoutesOnNavigationFunction, N as NavigateOptions, Q as Fetcher, t as RouteObject, j as Router, B as BlockerFunction, L as Location, b9 as CreateStaticHandlerOptions$1, G as StaticHandler } from './context-CRZ6DK7I.mjs';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { o as ServerRouteModule, A as AppLoadContext, c as RouteModules, h as ClientLoaderFunction, m as PageLinkDescriptor, d as SerializeFrom } from './route-data-
|
|
3
|
+
import { o as ServerRouteModule, A as AppLoadContext, c as RouteModules, h as ClientLoaderFunction, m as PageLinkDescriptor, d as SerializeFrom } from './route-data-gwXJPIqL.mjs';
|
|
4
4
|
|
|
5
5
|
type ServerRouteManifest = RouteManifest<Omit<ServerRoute, "children">>;
|
|
6
6
|
interface ServerRoute extends Route {
|
|
@@ -2076,6 +2076,41 @@ type FetcherWithComponents<TData> = Fetcher<TData> & {
|
|
|
2076
2076
|
* ```
|
|
2077
2077
|
*/
|
|
2078
2078
|
Form: React.ForwardRefExoticComponent<FetcherFormProps & React.RefAttributes<HTMLFormElement>>;
|
|
2079
|
+
/**
|
|
2080
|
+
* Loads data from a route. Useful for loading data imperatively inside user
|
|
2081
|
+
* events outside a normal button or form, like a combobox or search input.
|
|
2082
|
+
*
|
|
2083
|
+
* ```tsx
|
|
2084
|
+
* let fetcher = useFetcher()
|
|
2085
|
+
*
|
|
2086
|
+
* <input onChange={e => {
|
|
2087
|
+
* fetcher.load(`/search?q=${e.target.value}`)
|
|
2088
|
+
* }} />
|
|
2089
|
+
* ```
|
|
2090
|
+
*/
|
|
2091
|
+
load: (href: string, opts?: {
|
|
2092
|
+
/**
|
|
2093
|
+
* Wraps the initial state update for this `fetcher.load` in a
|
|
2094
|
+
* [`ReactDOM.flushSync`](https://react.dev/reference/react-dom/flushSync)
|
|
2095
|
+
* call instead of the default [`React.startTransition`](https://react.dev/reference/react/startTransition).
|
|
2096
|
+
* This allows you to perform synchronous DOM actions immediately after the
|
|
2097
|
+
* update is flushed to the DOM.
|
|
2098
|
+
*/
|
|
2099
|
+
flushSync?: boolean;
|
|
2100
|
+
}) => Promise<void>;
|
|
2101
|
+
/**
|
|
2102
|
+
* Reset a fetcher back to an empty/idle state.
|
|
2103
|
+
*
|
|
2104
|
+
* If the fetcher is currently in-flight, the
|
|
2105
|
+
* [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController)
|
|
2106
|
+
* will be aborted with the `reason`, if provided.
|
|
2107
|
+
*
|
|
2108
|
+
* @param reason Optional `reason` to provide to [`AbortController.abort()`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)
|
|
2109
|
+
* @returns void
|
|
2110
|
+
*/
|
|
2111
|
+
unstable_reset: (opts?: {
|
|
2112
|
+
reason?: unknown;
|
|
2113
|
+
}) => void;
|
|
2079
2114
|
/**
|
|
2080
2115
|
* Submits form data to a route. While multiple nested routes can match a URL, only the leaf route will be called.
|
|
2081
2116
|
*
|
|
@@ -2129,28 +2164,6 @@ type FetcherWithComponents<TData> = Fetcher<TData> & {
|
|
|
2129
2164
|
* ```
|
|
2130
2165
|
*/
|
|
2131
2166
|
submit: FetcherSubmitFunction;
|
|
2132
|
-
/**
|
|
2133
|
-
* Loads data from a route. Useful for loading data imperatively inside user
|
|
2134
|
-
* events outside a normal button or form, like a combobox or search input.
|
|
2135
|
-
*
|
|
2136
|
-
* ```tsx
|
|
2137
|
-
* let fetcher = useFetcher()
|
|
2138
|
-
*
|
|
2139
|
-
* <input onChange={e => {
|
|
2140
|
-
* fetcher.load(`/search?q=${e.target.value}`)
|
|
2141
|
-
* }} />
|
|
2142
|
-
* ```
|
|
2143
|
-
*/
|
|
2144
|
-
load: (href: string, opts?: {
|
|
2145
|
-
/**
|
|
2146
|
-
* Wraps the initial state update for this `fetcher.load` in a
|
|
2147
|
-
* [`ReactDOM.flushSync`](https://react.dev/reference/react-dom/flushSync)
|
|
2148
|
-
* call instead of the default [`React.startTransition`](https://react.dev/reference/react/startTransition).
|
|
2149
|
-
* This allows you to perform synchronous DOM actions immediately after the
|
|
2150
|
-
* update is flushed to the DOM.
|
|
2151
|
-
*/
|
|
2152
|
-
flushSync?: boolean;
|
|
2153
|
-
}) => Promise<void>;
|
|
2154
2167
|
};
|
|
2155
2168
|
/**
|
|
2156
2169
|
* Useful for creating complex, dynamic user interfaces that require multiple,
|
|
@@ -2182,6 +2195,9 @@ type FetcherWithComponents<TData> = Fetcher<TData> & {
|
|
|
2182
2195
|
* method: "post",
|
|
2183
2196
|
* encType: "application/json"
|
|
2184
2197
|
* })
|
|
2198
|
+
*
|
|
2199
|
+
* // reset fetcher
|
|
2200
|
+
* fetcher.unstable_reset()
|
|
2185
2201
|
* }
|
|
2186
2202
|
*
|
|
2187
2203
|
* @public
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { aC as Await, aD as MemoryRouter, aE as Navigate, aF as Outlet, aG as Route, aH as Router, aI as RouterProvider, aJ as Routes, b0 as UNSAFE_WithComponentProps, b4 as UNSAFE_WithErrorBoundaryProps, b2 as UNSAFE_WithHydrateFallbackProps } from './context-
|
|
2
|
-
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-
|
|
1
|
+
export { aC as Await, aD as MemoryRouter, aE as Navigate, aF as Outlet, aG as Route, aH as Router, aI as RouterProvider, aJ as Routes, b0 as UNSAFE_WithComponentProps, b4 as UNSAFE_WithErrorBoundaryProps, b2 as UNSAFE_WithHydrateFallbackProps } from './context-CRZ6DK7I.mjs';
|
|
2
|
+
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-DbUtZHNh.mjs';
|
|
3
3
|
import 'react';
|
|
4
|
-
import './route-data-
|
|
4
|
+
import './route-data-gwXJPIqL.mjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-
|
|
1
|
+
export { aW as Await, aX as MemoryRouter, aY as Navigate, aZ as Outlet, a_ as Route, a$ as Router, b0 as RouterProvider, b1 as Routes, br as UNSAFE_WithComponentProps, bv as UNSAFE_WithErrorBoundaryProps, bt as UNSAFE_WithHydrateFallbackProps } from './routeModules-Dz64j-T-.js';
|
|
2
|
+
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-DM3R9ovf.js';
|
|
3
3
|
import 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-7ed11be
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkX5OYM2ETjs = require('./chunk-X5OYM2ET.js');
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkBELBAVMBjs = require('./chunk-BELBAVMB.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -58,4 +58,4 @@ var _chunkS2WJDCREjs = require('./chunk-S2WJDCRE.js');
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
exports.Await =
|
|
61
|
+
exports.Await = _chunkX5OYM2ETjs.Await; exports.BrowserRouter = _chunkX5OYM2ETjs.BrowserRouter; exports.Form = _chunkX5OYM2ETjs.Form; exports.HashRouter = _chunkX5OYM2ETjs.HashRouter; exports.Link = _chunkX5OYM2ETjs.Link; exports.Links = _chunkBELBAVMBjs.Links; exports.MemoryRouter = _chunkX5OYM2ETjs.MemoryRouter; exports.Meta = _chunkBELBAVMBjs.Meta; exports.NavLink = _chunkX5OYM2ETjs.NavLink; exports.Navigate = _chunkX5OYM2ETjs.Navigate; exports.Outlet = _chunkX5OYM2ETjs.Outlet; exports.Route = _chunkX5OYM2ETjs.Route; exports.Router = _chunkX5OYM2ETjs.Router; exports.RouterProvider = _chunkX5OYM2ETjs.RouterProvider; exports.Routes = _chunkX5OYM2ETjs.Routes; exports.ScrollRestoration = _chunkX5OYM2ETjs.ScrollRestoration; exports.StaticRouter = _chunkX5OYM2ETjs.StaticRouter; exports.StaticRouterProvider = _chunkX5OYM2ETjs.StaticRouterProvider; exports.UNSAFE_WithComponentProps = _chunkX5OYM2ETjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkX5OYM2ETjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkX5OYM2ETjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkX5OYM2ETjs.HistoryRouter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-7ed11be
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
WithComponentProps,
|
|
33
33
|
WithErrorBoundaryProps,
|
|
34
34
|
WithHydrateFallbackProps
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-MUVPFEOF.mjs";
|
|
36
36
|
export {
|
|
37
37
|
Await,
|
|
38
38
|
BrowserRouter,
|
|
@@ -849,6 +849,43 @@ declare const redirectDocument$1: RedirectFunction;
|
|
|
849
849
|
* header.
|
|
850
850
|
*/
|
|
851
851
|
declare const replace$1: RedirectFunction;
|
|
852
|
+
type ErrorResponse = {
|
|
853
|
+
status: number;
|
|
854
|
+
statusText: string;
|
|
855
|
+
data: any;
|
|
856
|
+
};
|
|
857
|
+
/**
|
|
858
|
+
* Check if the given error is an {@link ErrorResponse} generated from a 4xx/5xx
|
|
859
|
+
* [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
|
|
860
|
+
* thrown from an [`action`](../../start/framework/route-module#action)/[`loader`](../../start/framework/route-module#loader)
|
|
861
|
+
*
|
|
862
|
+
* @example
|
|
863
|
+
* import { isRouteErrorResponse } from "react-router";
|
|
864
|
+
*
|
|
865
|
+
* export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
|
|
866
|
+
* if (isRouteErrorResponse(error)) {
|
|
867
|
+
* return (
|
|
868
|
+
* <>
|
|
869
|
+
* <p>Error: `${error.status}: ${error.statusText}`</p>
|
|
870
|
+
* <p>{error.data}</p>
|
|
871
|
+
* </>
|
|
872
|
+
* );
|
|
873
|
+
* }
|
|
874
|
+
*
|
|
875
|
+
* return (
|
|
876
|
+
* <p>Error: {error instanceof Error ? error.message : "Unknown Error"}</p>
|
|
877
|
+
* );
|
|
878
|
+
* }
|
|
879
|
+
*
|
|
880
|
+
* @public
|
|
881
|
+
* @category Utils
|
|
882
|
+
* @mode framework
|
|
883
|
+
* @mode data
|
|
884
|
+
* @param error The error to check.
|
|
885
|
+
* @returns `true` if the error is an {@link ErrorResponse}, `false` otherwise.
|
|
886
|
+
*
|
|
887
|
+
*/
|
|
888
|
+
declare function isRouteErrorResponse(error: any): error is ErrorResponse;
|
|
852
889
|
|
|
853
890
|
/**
|
|
854
891
|
* A Router instance manages all navigation and data loading/mutations
|
|
@@ -977,6 +1014,16 @@ interface Router {
|
|
|
977
1014
|
* @param key
|
|
978
1015
|
*/
|
|
979
1016
|
getFetcher<TData = any>(key: string): Fetcher<TData>;
|
|
1017
|
+
/**
|
|
1018
|
+
* @internal
|
|
1019
|
+
* PRIVATE - DO NOT USE
|
|
1020
|
+
*
|
|
1021
|
+
* Reset the fetcher for a given key
|
|
1022
|
+
* @param key
|
|
1023
|
+
*/
|
|
1024
|
+
resetFetcher(key: string, opts?: {
|
|
1025
|
+
reason?: unknown;
|
|
1026
|
+
}): void;
|
|
980
1027
|
/**
|
|
981
1028
|
* @private
|
|
982
1029
|
* PRIVATE - DO NOT USE
|
|
@@ -1571,7 +1618,7 @@ type unstable_SerializesTo<T> = {
|
|
|
1571
1618
|
unstable__ReactRouter_SerializesTo: [T];
|
|
1572
1619
|
};
|
|
1573
1620
|
|
|
1574
|
-
type Serialize<T> = T extends unstable_SerializesTo<infer To> ? To : T extends Serializable ? T : T extends (...args: any[]) => unknown ? undefined : T extends Promise<infer U> ? Promise<Serialize<U>> : T extends Map<infer K, infer V> ? Map<Serialize<K>, Serialize<V>> : T extends Set<infer U> ? Set<Serialize<U>> : T extends [] ? [] : T extends readonly [infer F, ...infer R] ? [Serialize<F>, ...Serialize<R>] : T extends Array<infer U> ? Array<Serialize<U>> : T extends readonly unknown[] ? readonly Serialize<T[number]>[] : T extends Record<any, any> ? {
|
|
1621
|
+
type Serialize<T> = T extends unstable_SerializesTo<infer To> ? To : T extends Serializable ? T : T extends (...args: any[]) => unknown ? undefined : T extends Promise<infer U> ? Promise<Serialize<U>> : T extends Map<infer K, infer V> ? Map<Serialize<K>, Serialize<V>> : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<Serialize<K>, Serialize<V>> : T extends Set<infer U> ? Set<Serialize<U>> : T extends ReadonlySet<infer U> ? ReadonlySet<Serialize<U>> : T extends [] ? [] : T extends readonly [infer F, ...infer R] ? [Serialize<F>, ...Serialize<R>] : T extends Array<infer U> ? Array<Serialize<U>> : T extends readonly unknown[] ? readonly Serialize<T[number]>[] : T extends Record<any, any> ? {
|
|
1575
1622
|
[K in keyof T]: Serialize<T[K]>;
|
|
1576
1623
|
} : undefined;
|
|
1577
1624
|
type VoidToUndefined<T> = Equal<T, void> extends true ? undefined : T;
|
|
@@ -2187,4 +2234,4 @@ interface MemorySessionStorageOptions {
|
|
|
2187
2234
|
*/
|
|
2188
2235
|
declare function createMemorySessionStorage<Data = SessionData, FlashData = Data>({ cookie }?: MemorySessionStorageOptions): SessionStorage<Data, FlashData>;
|
|
2189
2236
|
|
|
2190
|
-
export { type Cookie, type CookieOptions, type CookieSignatureOptions, type FlashSessionData, type IsCookieFunction, type IsSessionFunction, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, createCookie, createCookieSessionStorage, createMemorySessionStorage, createSession, createSessionStorage, createStaticHandler, data, isCookie, isSession, matchRoutes, redirect, redirectDocument, replace, type DecodeActionFunction as unstable_DecodeActionFunction, type DecodeFormStateFunction as unstable_DecodeFormStateFunction, type DecodeReplyFunction as unstable_DecodeReplyFunction, type LoadServerActionFunction as unstable_LoadServerActionFunction, type unstable_MiddlewareFunction, type unstable_MiddlewareNextFunction, type RSCManifestPayload as unstable_RSCManifestPayload, type RSCMatch as unstable_RSCMatch, type RSCPayload as unstable_RSCPayload, type RSCRenderPayload as unstable_RSCRenderPayload, type RSCRouteConfig as unstable_RSCRouteConfig, type RSCRouteConfigEntry as unstable_RSCRouteConfigEntry, type RSCRouteManifest as unstable_RSCRouteManifest, type RSCRouteMatch as unstable_RSCRouteMatch, type unstable_RouterContext, unstable_RouterContextProvider, unstable_createContext, matchRSCServerRequest as unstable_matchRSCServerRequest };
|
|
2237
|
+
export { type Cookie, type CookieOptions, type CookieSignatureOptions, type FlashSessionData, type IsCookieFunction, type IsSessionFunction, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, createCookie, createCookieSessionStorage, createMemorySessionStorage, createSession, createSessionStorage, createStaticHandler, data, isCookie, isRouteErrorResponse, isSession, matchRoutes, redirect, redirectDocument, replace, type DecodeActionFunction as unstable_DecodeActionFunction, type DecodeFormStateFunction as unstable_DecodeFormStateFunction, type DecodeReplyFunction as unstable_DecodeReplyFunction, type LoadServerActionFunction as unstable_LoadServerActionFunction, type unstable_MiddlewareFunction, type unstable_MiddlewareNextFunction, type RSCManifestPayload as unstable_RSCManifestPayload, type RSCMatch as unstable_RSCMatch, type RSCPayload as unstable_RSCPayload, type RSCRenderPayload as unstable_RSCRenderPayload, type RSCRouteConfig as unstable_RSCRouteConfig, type RSCRouteConfigEntry as unstable_RSCRouteConfigEntry, type RSCRouteManifest as unstable_RSCRouteManifest, type RSCRouteMatch as unstable_RSCRouteMatch, type unstable_RouterContext, unstable_RouterContextProvider, unstable_createContext, matchRSCServerRequest as unstable_matchRSCServerRequest };
|
|
@@ -849,6 +849,43 @@ declare const redirectDocument$1: RedirectFunction;
|
|
|
849
849
|
* header.
|
|
850
850
|
*/
|
|
851
851
|
declare const replace$1: RedirectFunction;
|
|
852
|
+
type ErrorResponse = {
|
|
853
|
+
status: number;
|
|
854
|
+
statusText: string;
|
|
855
|
+
data: any;
|
|
856
|
+
};
|
|
857
|
+
/**
|
|
858
|
+
* Check if the given error is an {@link ErrorResponse} generated from a 4xx/5xx
|
|
859
|
+
* [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
|
|
860
|
+
* thrown from an [`action`](../../start/framework/route-module#action)/[`loader`](../../start/framework/route-module#loader)
|
|
861
|
+
*
|
|
862
|
+
* @example
|
|
863
|
+
* import { isRouteErrorResponse } from "react-router";
|
|
864
|
+
*
|
|
865
|
+
* export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
|
|
866
|
+
* if (isRouteErrorResponse(error)) {
|
|
867
|
+
* return (
|
|
868
|
+
* <>
|
|
869
|
+
* <p>Error: `${error.status}: ${error.statusText}`</p>
|
|
870
|
+
* <p>{error.data}</p>
|
|
871
|
+
* </>
|
|
872
|
+
* );
|
|
873
|
+
* }
|
|
874
|
+
*
|
|
875
|
+
* return (
|
|
876
|
+
* <p>Error: {error instanceof Error ? error.message : "Unknown Error"}</p>
|
|
877
|
+
* );
|
|
878
|
+
* }
|
|
879
|
+
*
|
|
880
|
+
* @public
|
|
881
|
+
* @category Utils
|
|
882
|
+
* @mode framework
|
|
883
|
+
* @mode data
|
|
884
|
+
* @param error The error to check.
|
|
885
|
+
* @returns `true` if the error is an {@link ErrorResponse}, `false` otherwise.
|
|
886
|
+
*
|
|
887
|
+
*/
|
|
888
|
+
declare function isRouteErrorResponse(error: any): error is ErrorResponse;
|
|
852
889
|
|
|
853
890
|
/**
|
|
854
891
|
* A Router instance manages all navigation and data loading/mutations
|
|
@@ -977,6 +1014,16 @@ interface Router {
|
|
|
977
1014
|
* @param key
|
|
978
1015
|
*/
|
|
979
1016
|
getFetcher<TData = any>(key: string): Fetcher<TData>;
|
|
1017
|
+
/**
|
|
1018
|
+
* @internal
|
|
1019
|
+
* PRIVATE - DO NOT USE
|
|
1020
|
+
*
|
|
1021
|
+
* Reset the fetcher for a given key
|
|
1022
|
+
* @param key
|
|
1023
|
+
*/
|
|
1024
|
+
resetFetcher(key: string, opts?: {
|
|
1025
|
+
reason?: unknown;
|
|
1026
|
+
}): void;
|
|
980
1027
|
/**
|
|
981
1028
|
* @private
|
|
982
1029
|
* PRIVATE - DO NOT USE
|
|
@@ -1571,7 +1618,7 @@ type unstable_SerializesTo<T> = {
|
|
|
1571
1618
|
unstable__ReactRouter_SerializesTo: [T];
|
|
1572
1619
|
};
|
|
1573
1620
|
|
|
1574
|
-
type Serialize<T> = T extends unstable_SerializesTo<infer To> ? To : T extends Serializable ? T : T extends (...args: any[]) => unknown ? undefined : T extends Promise<infer U> ? Promise<Serialize<U>> : T extends Map<infer K, infer V> ? Map<Serialize<K>, Serialize<V>> : T extends Set<infer U> ? Set<Serialize<U>> : T extends [] ? [] : T extends readonly [infer F, ...infer R] ? [Serialize<F>, ...Serialize<R>] : T extends Array<infer U> ? Array<Serialize<U>> : T extends readonly unknown[] ? readonly Serialize<T[number]>[] : T extends Record<any, any> ? {
|
|
1621
|
+
type Serialize<T> = T extends unstable_SerializesTo<infer To> ? To : T extends Serializable ? T : T extends (...args: any[]) => unknown ? undefined : T extends Promise<infer U> ? Promise<Serialize<U>> : T extends Map<infer K, infer V> ? Map<Serialize<K>, Serialize<V>> : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<Serialize<K>, Serialize<V>> : T extends Set<infer U> ? Set<Serialize<U>> : T extends ReadonlySet<infer U> ? ReadonlySet<Serialize<U>> : T extends [] ? [] : T extends readonly [infer F, ...infer R] ? [Serialize<F>, ...Serialize<R>] : T extends Array<infer U> ? Array<Serialize<U>> : T extends readonly unknown[] ? readonly Serialize<T[number]>[] : T extends Record<any, any> ? {
|
|
1575
1622
|
[K in keyof T]: Serialize<T[K]>;
|
|
1576
1623
|
} : undefined;
|
|
1577
1624
|
type VoidToUndefined<T> = Equal<T, void> extends true ? undefined : T;
|
|
@@ -2187,4 +2234,4 @@ interface MemorySessionStorageOptions {
|
|
|
2187
2234
|
*/
|
|
2188
2235
|
declare function createMemorySessionStorage<Data = SessionData, FlashData = Data>({ cookie }?: MemorySessionStorageOptions): SessionStorage<Data, FlashData>;
|
|
2189
2236
|
|
|
2190
|
-
export { type Cookie, type CookieOptions, type CookieSignatureOptions, type FlashSessionData, type IsCookieFunction, type IsSessionFunction, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, createCookie, createCookieSessionStorage, createMemorySessionStorage, createSession, createSessionStorage, createStaticHandler, data, isCookie, isSession, matchRoutes, redirect, redirectDocument, replace, type DecodeActionFunction as unstable_DecodeActionFunction, type DecodeFormStateFunction as unstable_DecodeFormStateFunction, type DecodeReplyFunction as unstable_DecodeReplyFunction, type LoadServerActionFunction as unstable_LoadServerActionFunction, type unstable_MiddlewareFunction, type unstable_MiddlewareNextFunction, type RSCManifestPayload as unstable_RSCManifestPayload, type RSCMatch as unstable_RSCMatch, type RSCPayload as unstable_RSCPayload, type RSCRenderPayload as unstable_RSCRenderPayload, type RSCRouteConfig as unstable_RSCRouteConfig, type RSCRouteConfigEntry as unstable_RSCRouteConfigEntry, type RSCRouteManifest as unstable_RSCRouteManifest, type RSCRouteMatch as unstable_RSCRouteMatch, type unstable_RouterContext, unstable_RouterContextProvider, unstable_createContext, matchRSCServerRequest as unstable_matchRSCServerRequest };
|
|
2237
|
+
export { type Cookie, type CookieOptions, type CookieSignatureOptions, type FlashSessionData, type IsCookieFunction, type IsSessionFunction, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, createCookie, createCookieSessionStorage, createMemorySessionStorage, createSession, createSessionStorage, createStaticHandler, data, isCookie, isRouteErrorResponse, isSession, matchRoutes, redirect, redirectDocument, replace, type DecodeActionFunction as unstable_DecodeActionFunction, type DecodeFormStateFunction as unstable_DecodeFormStateFunction, type DecodeReplyFunction as unstable_DecodeReplyFunction, type LoadServerActionFunction as unstable_LoadServerActionFunction, type unstable_MiddlewareFunction, type unstable_MiddlewareNextFunction, type RSCManifestPayload as unstable_RSCManifestPayload, type RSCMatch as unstable_RSCMatch, type RSCPayload as unstable_RSCPayload, type RSCRenderPayload as unstable_RSCRenderPayload, type RSCRouteConfig as unstable_RSCRouteConfig, type RSCRouteConfigEntry as unstable_RSCRouteConfigEntry, type RSCRouteManifest as unstable_RSCRouteManifest, type RSCRouteMatch as unstable_RSCRouteMatch, type unstable_RouterContext, unstable_RouterContextProvider, unstable_createContext, matchRSCServerRequest as unstable_matchRSCServerRequest };
|