react-router 0.0.0-experimental-e5dac68cb → 0.0.0-experimental-59413d9ab
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/browser-DYcG-QSM.d.mts +141 -0
- package/dist/development/chunk-5D3KTOSM.js +21 -0
- package/dist/development/chunk-6IGRGMSR.js +9993 -0
- package/dist/development/{chunk-USQXBNSR.mjs → chunk-NM2NJ6LO.mjs} +758 -3325
- package/dist/development/chunk-Q4E2T2VL.mjs +2991 -0
- package/dist/development/chunk-SIFL75JK.js +3027 -0
- package/dist/development/chunk-VBH7ULUE.mjs +2652 -0
- package/dist/development/components-CwtESh53.d.mts +816 -0
- package/dist/development/dom-export.d.mts +3 -2
- package/dist/development/dom-export.js +52 -72
- package/dist/development/dom-export.mjs +6 -4
- package/dist/development/index-react-server-client-CzKQ01cq.d.mts +1360 -0
- package/dist/development/{browser-Bh26Omrk.d.mts → index-react-server-client-unV28389.d.ts} +35 -91
- package/dist/development/index-react-server-client.d.mts +4 -0
- package/dist/development/index-react-server-client.d.ts +3 -0
- package/dist/development/index-react-server-client.js +54 -0
- package/dist/development/index-react-server-client.mjs +53 -0
- package/dist/development/index-react-server.d.mts +1853 -0
- package/dist/development/index-react-server.d.ts +1853 -0
- package/dist/development/index-react-server.js +143 -0
- package/dist/development/index-react-server.mjs +2 -0
- package/dist/development/index.d.mts +14 -45
- package/dist/development/index.d.ts +72 -2189
- package/dist/development/index.js +469 -10355
- package/dist/development/index.mjs +26 -24
- package/dist/development/lib/types/internal.d.mts +2 -2
- package/dist/development/lib/types/internal.d.ts +2 -1
- package/dist/development/lib/types/internal.js +2 -20
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/{production/register-DeIo2iHO.d.mts → development/register-DiOIlEq5.d.mts} +1 -1
- package/dist/development/{register-DeIo2iHO.d.mts → register-DiOIlEq5.d.ts} +1 -1
- package/dist/development/{route-data-C8_wxpLo.d.mts → route-data-Csr8hE3v.d.mts} +1 -1
- package/dist/{production/route-data-C8_wxpLo.d.mts → development/route-data-x_b_BLCv.d.ts} +11 -11
- package/dist/development/rsc-export.d.mts +4 -1851
- package/dist/development/rsc-export.d.ts +4 -1851
- package/dist/development/rsc-export.js +60 -3028
- package/dist/development/rsc-export.mjs +1 -2998
- package/dist/production/browser-DYcG-QSM.d.mts +141 -0
- package/dist/production/chunk-5D3KTOSM.js +21 -0
- package/dist/production/chunk-BUCOUPH7.mjs +2652 -0
- package/dist/production/{chunk-SB3D2OAU.mjs → chunk-JTLYHRZM.mjs} +758 -3325
- package/dist/production/chunk-Q4E2T2VL.mjs +2991 -0
- package/dist/production/chunk-SIFL75JK.js +3027 -0
- package/dist/production/chunk-TAPQIP6U.js +9993 -0
- package/dist/production/components-CwtESh53.d.mts +816 -0
- package/dist/production/dom-export.d.mts +3 -2
- package/dist/production/dom-export.js +52 -72
- package/dist/production/dom-export.mjs +6 -4
- package/dist/production/index-react-server-client-CzKQ01cq.d.mts +1360 -0
- package/dist/production/{browser-Bh26Omrk.d.mts → index-react-server-client-unV28389.d.ts} +35 -91
- package/dist/production/index-react-server-client.d.mts +4 -0
- package/dist/production/index-react-server-client.d.ts +3 -0
- package/dist/production/index-react-server-client.js +54 -0
- package/dist/production/index-react-server-client.mjs +53 -0
- package/dist/production/index-react-server.d.mts +1853 -0
- package/dist/production/index-react-server.d.ts +1853 -0
- package/dist/production/index-react-server.js +143 -0
- package/dist/production/index-react-server.mjs +2 -0
- package/dist/production/index.d.mts +14 -45
- package/dist/production/index.d.ts +72 -2189
- package/dist/production/index.js +469 -10355
- package/dist/production/index.mjs +26 -24
- package/dist/production/lib/types/internal.d.mts +2 -2
- package/dist/production/lib/types/internal.d.ts +2 -1
- package/dist/production/lib/types/internal.js +2 -20
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/register-DiOIlEq5.d.mts +24 -0
- package/dist/production/register-DiOIlEq5.d.ts +24 -0
- package/dist/production/{register-BEmY26MO.d.ts → route-data-Csr8hE3v.d.mts} +1 -24
- package/dist/{development/register-BEmY26MO.d.ts → production/route-data-x_b_BLCv.d.ts} +11 -34
- package/dist/production/rsc-export.d.mts +4 -1851
- package/dist/production/rsc-export.d.ts +4 -1851
- package/dist/production/rsc-export.js +60 -3028
- package/dist/production/rsc-export.mjs +1 -2998
- package/package.json +20 -24
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { p as ActionFunction, C as ClientActionFunction, q as ClientLoaderFunction, r as HeadersFunction, s as LinksFunction, t as LoaderFunction, M as MetaFunction, u as ShouldRevalidateFunction, L as Location, g as Params, h as Router } from './route-data-Csr8hE3v.mjs';
|
|
3
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
4
|
+
|
|
5
|
+
type ServerContext = {
|
|
6
|
+
redirect?: Response;
|
|
7
|
+
};
|
|
8
|
+
declare global {
|
|
9
|
+
var ___reactRouterServerStorage___: AsyncLocalStorage<ServerContext> | undefined;
|
|
10
|
+
}
|
|
11
|
+
type ServerRouteObjectBase = {
|
|
12
|
+
action?: ActionFunction;
|
|
13
|
+
clientAction?: ClientActionFunction;
|
|
14
|
+
clientLoader?: ClientLoaderFunction;
|
|
15
|
+
ErrorBoundary?: React.ComponentType<any>;
|
|
16
|
+
handle?: any;
|
|
17
|
+
headers?: HeadersFunction;
|
|
18
|
+
HydrateFallback?: React.ComponentType<any>;
|
|
19
|
+
Layout?: React.ComponentType<any>;
|
|
20
|
+
links?: LinksFunction;
|
|
21
|
+
loader?: LoaderFunction;
|
|
22
|
+
meta?: MetaFunction;
|
|
23
|
+
shouldRevalidate?: ShouldRevalidateFunction;
|
|
24
|
+
};
|
|
25
|
+
type ServerRouteObject = ServerRouteObjectBase & {
|
|
26
|
+
id: string;
|
|
27
|
+
path?: string;
|
|
28
|
+
Component?: React.ComponentType<any>;
|
|
29
|
+
lazy?: () => Promise<ServerRouteObjectBase & ({
|
|
30
|
+
default?: React.ComponentType<any>;
|
|
31
|
+
Component?: never;
|
|
32
|
+
} | {
|
|
33
|
+
default?: never;
|
|
34
|
+
Component?: React.ComponentType<any>;
|
|
35
|
+
})>;
|
|
36
|
+
} & ({
|
|
37
|
+
index: true;
|
|
38
|
+
} | {
|
|
39
|
+
children?: ServerRouteObject[];
|
|
40
|
+
});
|
|
41
|
+
type RenderedRoute = {
|
|
42
|
+
clientAction?: ClientActionFunction;
|
|
43
|
+
clientLoader?: ClientLoaderFunction;
|
|
44
|
+
element?: React.ReactElement | false;
|
|
45
|
+
errorElement?: React.ReactElement;
|
|
46
|
+
handle?: any;
|
|
47
|
+
hasAction: boolean;
|
|
48
|
+
hasComponent: boolean;
|
|
49
|
+
hasErrorBoundary: boolean;
|
|
50
|
+
hasLoader: boolean;
|
|
51
|
+
hydrateFallbackElement?: React.ReactElement;
|
|
52
|
+
id: string;
|
|
53
|
+
index?: boolean;
|
|
54
|
+
links?: LinksFunction;
|
|
55
|
+
meta?: MetaFunction;
|
|
56
|
+
parentId?: string;
|
|
57
|
+
path?: string;
|
|
58
|
+
shouldRevalidate?: ShouldRevalidateFunction;
|
|
59
|
+
};
|
|
60
|
+
type ServerRouteMatch = RenderedRoute & {
|
|
61
|
+
params: Params;
|
|
62
|
+
pathname: string;
|
|
63
|
+
pathnameBase: string;
|
|
64
|
+
};
|
|
65
|
+
type ServerRenderPayload = {
|
|
66
|
+
type: "render";
|
|
67
|
+
actionData: Record<string, any> | null;
|
|
68
|
+
basename?: string;
|
|
69
|
+
errors: Record<string, any> | null;
|
|
70
|
+
loaderData: Record<string, any>;
|
|
71
|
+
location: Location;
|
|
72
|
+
matches: ServerRouteMatch[];
|
|
73
|
+
patches?: RenderedRoute[];
|
|
74
|
+
nonce?: string;
|
|
75
|
+
formState?: unknown;
|
|
76
|
+
};
|
|
77
|
+
type ServerManifestPayload = {
|
|
78
|
+
type: "manifest";
|
|
79
|
+
patches: RenderedRoute[];
|
|
80
|
+
};
|
|
81
|
+
type ServerActionPayload = {
|
|
82
|
+
type: "action";
|
|
83
|
+
actionResult: Promise<unknown>;
|
|
84
|
+
rerender?: Promise<ServerRenderPayload | ServerRedirectPayload>;
|
|
85
|
+
};
|
|
86
|
+
type ServerRedirectPayload = {
|
|
87
|
+
type: "redirect";
|
|
88
|
+
status: number;
|
|
89
|
+
location: string;
|
|
90
|
+
replace: boolean;
|
|
91
|
+
reload: boolean;
|
|
92
|
+
actionResult?: Promise<unknown>;
|
|
93
|
+
};
|
|
94
|
+
type ServerPayload = ServerRenderPayload | ServerManifestPayload | ServerActionPayload | ServerRedirectPayload;
|
|
95
|
+
type ServerMatch = {
|
|
96
|
+
statusCode: number;
|
|
97
|
+
headers: Headers;
|
|
98
|
+
payload: ServerPayload;
|
|
99
|
+
};
|
|
100
|
+
type DecodeCallServerFunction = (id: string, reply: FormData | string) => Promise<() => Promise<unknown>>;
|
|
101
|
+
type DecodeFormActionFunction = (formData: FormData) => Promise<() => Promise<void>>;
|
|
102
|
+
type DecodeFormStateFunction = (result: unknown, formData: FormData) => unknown;
|
|
103
|
+
declare function matchRSCServerRequest({ decodeCallServer, decodeFormAction, decodeFormState, onError, request, routes, generateResponse, }: {
|
|
104
|
+
decodeCallServer?: DecodeCallServerFunction;
|
|
105
|
+
decodeFormAction?: DecodeFormActionFunction;
|
|
106
|
+
decodeFormState?: DecodeFormStateFunction;
|
|
107
|
+
onError?: (error: unknown) => void;
|
|
108
|
+
request: Request;
|
|
109
|
+
routes: ServerRouteObject[];
|
|
110
|
+
generateResponse: (match: ServerMatch) => Response;
|
|
111
|
+
}): Promise<Response>;
|
|
112
|
+
|
|
113
|
+
type DecodeServerResponseFunction = (body: ReadableStream<Uint8Array>) => Promise<ServerPayload>;
|
|
114
|
+
type EncodeActionFunction = (args: unknown[]) => Promise<BodyInit>;
|
|
115
|
+
declare global {
|
|
116
|
+
interface Window {
|
|
117
|
+
__router: Router;
|
|
118
|
+
__routerInitialized: boolean;
|
|
119
|
+
__routerActionID: number;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
declare function createCallServer({ decode, encodeAction, fetch: fetchImplementation, }: {
|
|
123
|
+
decode: DecodeServerResponseFunction;
|
|
124
|
+
encodeAction: EncodeActionFunction;
|
|
125
|
+
fetch?: (request: Request) => Promise<Response>;
|
|
126
|
+
}): (id: string, args: unknown[]) => Promise<unknown>;
|
|
127
|
+
declare function RSCHydratedRouter({ decode, fetch: fetchImplementation, payload, routeDiscovery, }: {
|
|
128
|
+
decode: DecodeServerResponseFunction;
|
|
129
|
+
fetch?: (request: Request) => Promise<Response>;
|
|
130
|
+
payload: ServerPayload;
|
|
131
|
+
routeDiscovery?: "eager" | "lazy";
|
|
132
|
+
}): React.JSX.Element;
|
|
133
|
+
|
|
134
|
+
declare global {
|
|
135
|
+
interface Window {
|
|
136
|
+
__FLIGHT_DATA: any[];
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
declare function getServerStream(): ReadableStream<any>;
|
|
140
|
+
|
|
141
|
+
export { type DecodeServerResponseFunction as D, type EncodeActionFunction as E, RSCHydratedRouter as R, type ServerPayload as S, type DecodeCallServerFunction as a, type DecodeFormActionFunction as b, createCallServer as c, type ServerManifestPayload as d, type ServerMatch as e, type ServerRenderPayload as f, getServerStream as g, type RenderedRoute as h, type ServerRouteMatch as i, type ServerRouteObject as j, matchRSCServerRequest as m };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
|
|
2
|
+
* react-router v0.0.0-experimental-59413d9ab
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Remix Software Inc.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
var __typeError = (msg) => {
|
|
12
|
+
throw TypeError(msg);
|
|
13
|
+
};
|
|
14
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
15
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
16
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd;
|