react-router 0.0.0-experimental-b588f7e → 0.0.0-experimental-23decd7bc

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/development/browser-CmIT056Z.d.mts +154 -0
  3. package/dist/development/chunk-3E3CD4NY.mjs +2669 -0
  4. package/dist/development/{chunk-3HOZPCHX.mjs → chunk-GJVCYY62.mjs} +1445 -3021
  5. package/dist/development/chunk-H2M6MMUH.js +10007 -0
  6. package/dist/development/chunk-I3MHZ4NU.js +21 -0
  7. package/dist/development/components-CwtESh53.d.mts +816 -0
  8. package/dist/development/dom-export.d.mts +4 -2
  9. package/dist/development/dom-export.js +53 -72
  10. package/dist/development/dom-export.mjs +7 -4
  11. package/dist/development/index-react-server-client-CzKQ01cq.d.mts +1360 -0
  12. package/dist/development/{lib-oW7CoPA6.d.mts → index-react-server-client-unV28389.d.ts} +39 -39
  13. package/dist/development/index-react-server-client.d.mts +4 -0
  14. package/dist/development/index-react-server-client.d.ts +3 -0
  15. package/dist/development/index-react-server-client.js +54 -0
  16. package/dist/development/index-react-server-client.mjs +53 -0
  17. package/dist/development/index-react-server.d.mts +1861 -0
  18. package/dist/development/index-react-server.d.ts +1861 -0
  19. package/dist/development/index-react-server.js +3137 -0
  20. package/dist/development/index-react-server.mjs +3025 -0
  21. package/dist/development/index.d.mts +32 -46
  22. package/dist/development/index.d.ts +191 -2223
  23. package/dist/development/index.js +2577 -11464
  24. package/dist/development/index.mjs +33 -22
  25. package/dist/development/lib/types/internal.d.mts +8 -72
  26. package/dist/development/lib/types/internal.d.ts +8 -71
  27. package/dist/development/lib/types/internal.js +2 -20
  28. package/dist/development/lib/types/internal.mjs +1 -1
  29. package/dist/{production/register-DeIo2iHO.d.mts → development/register-DiOIlEq5.d.mts} +1 -1
  30. package/dist/development/{register-DeIo2iHO.d.mts → register-DiOIlEq5.d.ts} +1 -1
  31. package/dist/development/{route-data-ByAYLHuM.d.mts → route-data-Csr8hE3v.d.mts} +80 -3
  32. package/dist/{production/register-DCE0tH5m.d.ts → development/route-data-x_b_BLCv.d.ts} +90 -36
  33. package/dist/production/browser-CmIT056Z.d.mts +154 -0
  34. package/dist/production/chunk-7TUGB72O.js +10007 -0
  35. package/dist/production/chunk-I3MHZ4NU.js +21 -0
  36. package/dist/production/chunk-XNTCWHOK.mjs +2669 -0
  37. package/dist/production/{chunk-UROK22QK.mjs → chunk-YWCG2M57.mjs} +1445 -3021
  38. package/dist/production/components-CwtESh53.d.mts +816 -0
  39. package/dist/production/dom-export.d.mts +4 -2
  40. package/dist/production/dom-export.js +53 -72
  41. package/dist/production/dom-export.mjs +7 -4
  42. package/dist/production/index-react-server-client-CzKQ01cq.d.mts +1360 -0
  43. package/dist/production/{lib-oW7CoPA6.d.mts → index-react-server-client-unV28389.d.ts} +39 -39
  44. package/dist/production/index-react-server-client.d.mts +4 -0
  45. package/dist/production/index-react-server-client.d.ts +3 -0
  46. package/dist/production/index-react-server-client.js +54 -0
  47. package/dist/production/index-react-server-client.mjs +53 -0
  48. package/dist/production/index-react-server.d.mts +1861 -0
  49. package/dist/production/index-react-server.d.ts +1861 -0
  50. package/dist/production/index-react-server.js +3137 -0
  51. package/dist/production/index-react-server.mjs +3025 -0
  52. package/dist/production/index.d.mts +32 -46
  53. package/dist/production/index.d.ts +191 -2223
  54. package/dist/production/index.js +2577 -11464
  55. package/dist/production/index.mjs +33 -22
  56. package/dist/production/lib/types/internal.d.mts +8 -72
  57. package/dist/production/lib/types/internal.d.ts +8 -71
  58. package/dist/production/lib/types/internal.js +2 -20
  59. package/dist/production/lib/types/internal.mjs +1 -1
  60. package/dist/production/register-DiOIlEq5.d.mts +24 -0
  61. package/dist/production/register-DiOIlEq5.d.ts +24 -0
  62. package/dist/{development/register-DCE0tH5m.d.ts → production/route-data-Csr8hE3v.d.mts} +80 -26
  63. package/dist/production/{route-data-ByAYLHuM.d.mts → route-data-x_b_BLCv.d.ts} +90 -13
  64. package/package.json +49 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # `react-router`
2
2
 
3
+ ## 7.6.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Do not serialize types for `useRouteLoaderData<typeof clientLoader>` ([#13752](https://github.com/remix-run/react-router/pull/13752))
8
+
9
+ For types to distinguish a `clientLoader` from a `serverLoader`, you MUST annotate `clientLoader` args:
10
+
11
+ ```ts
12
+ // 👇 annotation required to skip serializing types
13
+ export function clientLoader({}: Route.ClientLoaderArgs) {
14
+ return { fn: () => "earth" };
15
+ }
16
+
17
+ function SomeComponent() {
18
+ const data = useRouteLoaderData<typeof clientLoader>("routes/this-route");
19
+ const planet = data?.fn() ?? "world";
20
+ return <h1>Hello, {planet}!</h1>;
21
+ }
22
+ ```
23
+
24
+ ## 7.6.2
25
+
26
+ ### Patch Changes
27
+
28
+ - Avoid additional `with-props` chunk in Framework Mode by moving route module component prop logic from the Vite plugin to `react-router` ([#13650](https://github.com/remix-run/react-router/pull/13650))
29
+ - Slight refactor of internal `headers()` function processing for use with RSC ([#13639](https://github.com/remix-run/react-router/pull/13639))
30
+
3
31
  ## 7.6.1
4
32
 
5
33
  ### Patch Changes
@@ -0,0 +1,154 @@
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 RSCRouteConfigEntryBase = {
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 RSCRouteConfigEntry = RSCRouteConfigEntryBase & {
26
+ id: string;
27
+ path?: string;
28
+ Component?: React.ComponentType<any>;
29
+ lazy?: () => Promise<RSCRouteConfigEntryBase & ({
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?: RSCRouteConfigEntry[];
40
+ });
41
+ type RSCRouteConfig = Array<RSCRouteConfigEntry>;
42
+ type RSCRouteManifest = {
43
+ clientAction?: ClientActionFunction;
44
+ clientLoader?: ClientLoaderFunction;
45
+ element?: React.ReactElement | false;
46
+ errorElement?: React.ReactElement;
47
+ handle?: any;
48
+ hasAction: boolean;
49
+ hasComponent: boolean;
50
+ hasErrorBoundary: boolean;
51
+ hasLoader: boolean;
52
+ hydrateFallbackElement?: React.ReactElement;
53
+ id: string;
54
+ index?: boolean;
55
+ links?: LinksFunction;
56
+ meta?: MetaFunction;
57
+ parentId?: string;
58
+ path?: string;
59
+ shouldRevalidate?: ShouldRevalidateFunction;
60
+ };
61
+ type RSCRouteMatch = RSCRouteManifest & {
62
+ params: Params;
63
+ pathname: string;
64
+ pathnameBase: string;
65
+ };
66
+ type RSCRenderPayload = {
67
+ type: "render";
68
+ actionData: Record<string, any> | null;
69
+ basename?: string;
70
+ errors: Record<string, any> | null;
71
+ loaderData: Record<string, any>;
72
+ location: Location;
73
+ matches: RSCRouteMatch[];
74
+ patches?: RSCRouteManifest[];
75
+ nonce?: string;
76
+ formState?: unknown;
77
+ };
78
+ type RSCManifestPayload = {
79
+ type: "manifest";
80
+ patches: RSCRouteManifest[];
81
+ };
82
+ type RSCActionPayload = {
83
+ type: "action";
84
+ actionResult: Promise<unknown>;
85
+ rerender?: Promise<RSCRenderPayload | RSCRedirectPayload>;
86
+ };
87
+ type RSCRedirectPayload = {
88
+ type: "redirect";
89
+ status: number;
90
+ location: string;
91
+ replace: boolean;
92
+ reload: boolean;
93
+ actionResult?: Promise<unknown>;
94
+ };
95
+ type RSCPayload = RSCRenderPayload | RSCManifestPayload | RSCActionPayload | RSCRedirectPayload;
96
+ type RSCMatch = {
97
+ statusCode: number;
98
+ headers: Headers;
99
+ payload: RSCPayload;
100
+ };
101
+ type DecodeActionFunction = (formData: FormData) => Promise<() => Promise<void>>;
102
+ type DecodeFormStateFunction = (result: unknown, formData: FormData) => unknown;
103
+ type DecodeReplyFunction = (reply: FormData | string, { temporaryReferences }: {
104
+ temporaryReferences: unknown;
105
+ }) => Promise<unknown[]>;
106
+ type LoadServerActionFunction = (id: string) => Promise<Function>;
107
+ declare function matchRSCServerRequest({ createTemporaryReferenceSet, decodeReply, loadServerAction, decodeAction, decodeFormState, onError, request, routes, generateResponse, }: {
108
+ createTemporaryReferenceSet: () => unknown;
109
+ decodeReply?: DecodeReplyFunction;
110
+ decodeAction?: DecodeActionFunction;
111
+ decodeFormState?: DecodeFormStateFunction;
112
+ loadServerAction?: LoadServerActionFunction;
113
+ onError?: (error: unknown) => void;
114
+ request: Request;
115
+ routes: RSCRouteConfigEntry[];
116
+ generateResponse: (match: RSCMatch, { temporaryReferences, }: {
117
+ temporaryReferences: unknown;
118
+ }) => Response;
119
+ }): Promise<Response>;
120
+
121
+ type BrowserCreateFromReadableStreamFunction = (body: ReadableStream<Uint8Array>, { temporaryReferences, }: {
122
+ temporaryReferences: unknown;
123
+ }) => Promise<unknown>;
124
+ type EncodeReplyFunction = (args: unknown[], options: {
125
+ temporaryReferences: unknown;
126
+ }) => Promise<BodyInit>;
127
+ declare global {
128
+ interface Window {
129
+ __router: Router;
130
+ __routerInitialized: boolean;
131
+ __routerActionID: number;
132
+ }
133
+ }
134
+ declare function createCallServer({ createFromReadableStream, createTemporaryReferenceSet, encodeReply, fetch: fetchImplementation, }: {
135
+ createFromReadableStream: BrowserCreateFromReadableStreamFunction;
136
+ createTemporaryReferenceSet: () => unknown;
137
+ encodeReply: EncodeReplyFunction;
138
+ fetch?: (request: Request) => Promise<Response>;
139
+ }): (id: string, args: unknown[]) => Promise<unknown>;
140
+ declare function RSCHydratedRouter({ createFromReadableStream, fetch: fetchImplementation, payload, routeDiscovery, }: {
141
+ createFromReadableStream: BrowserCreateFromReadableStreamFunction;
142
+ fetch?: (request: Request) => Promise<Response>;
143
+ payload: RSCPayload;
144
+ routeDiscovery?: "eager" | "lazy";
145
+ }): React.JSX.Element;
146
+
147
+ declare global {
148
+ interface Window {
149
+ __FLIGHT_DATA: any[];
150
+ }
151
+ }
152
+ declare function getRSCStream(): ReadableStream<any>;
153
+
154
+ export { type BrowserCreateFromReadableStreamFunction as B, type DecodeActionFunction as D, type EncodeReplyFunction as E, type LoadServerActionFunction as L, type RSCPayload as R, RSCHydratedRouter as a, type DecodeFormStateFunction as b, createCallServer as c, type DecodeReplyFunction as d, type RSCManifestPayload as e, type RSCMatch as f, getRSCStream as g, type RSCRenderPayload as h, type RSCRouteManifest as i, type RSCRouteMatch as j, type RSCRouteConfigEntry as k, type RSCRouteConfig as l, matchRSCServerRequest as m };