react-router 0.0.0-experimental-28357fd2a → 0.0.0-experimental-3d7dcee

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 (58) hide show
  1. package/CHANGELOG.md +51 -48
  2. package/dist/development/{chunk-5CCVAEBF.js → chunk-LSB26UC6.js} +210 -169
  3. package/dist/development/{chunk-QT7WPDUY.mjs → chunk-QMIAKNRH.mjs} +147 -33
  4. package/dist/development/{chunk-EU7MB5YT.js → chunk-S2WJDCRE.js} +77 -53
  5. package/dist/development/{chunk-Z4HFX7Q2.mjs → chunk-WJ2QP6HN.mjs} +102 -37
  6. package/dist/{production/context-DohQKLID.d.mts → development/context-DnZM5brG.d.mts} +843 -6
  7. package/dist/development/dom-export.d.mts +20 -2
  8. package/dist/development/dom-export.d.ts +20 -1
  9. package/dist/development/dom-export.js +10 -4
  10. package/dist/development/dom-export.mjs +10 -4
  11. package/dist/development/{index-react-server-client-DXb0OgpJ.d.mts → index-react-server-client-9rHNv-U3.d.mts} +2 -3
  12. package/dist/{production/index-react-server-client-CMphySRb.d.ts → development/index-react-server-client-zr5eNeut.d.ts} +6 -816
  13. package/dist/development/index-react-server-client.d.mts +3 -4
  14. package/dist/development/index-react-server-client.d.ts +2 -2
  15. package/dist/development/index-react-server-client.js +4 -4
  16. package/dist/development/index-react-server-client.mjs +2 -2
  17. package/dist/development/index-react-server.js +21 -7
  18. package/dist/development/index-react-server.mjs +21 -7
  19. package/dist/development/index.d.mts +7 -9
  20. package/dist/development/index.d.ts +5 -5
  21. package/dist/development/index.js +242 -128
  22. package/dist/development/index.mjs +3 -3
  23. package/dist/development/lib/types/internal.d.mts +2 -2
  24. package/dist/development/lib/types/internal.d.ts +1 -1
  25. package/dist/development/lib/types/internal.js +1 -1
  26. package/dist/development/lib/types/internal.mjs +1 -1
  27. package/dist/development/{route-data-CpB5xtMm.d.mts → route-data-C24VEkoE.d.mts} +1 -1
  28. package/dist/development/{routeModules-qBivMBjd.d.ts → routeModules-FY5IBiA_.d.ts} +843 -6
  29. package/dist/production/{chunk-EQ3NKH5J.mjs → chunk-2BFZ6QQU.mjs} +102 -37
  30. package/dist/production/{chunk-2DWPJCWX.js → chunk-7CWVKQLP.js} +77 -53
  31. package/dist/production/{chunk-DOZCQHLU.js → chunk-NIW37A6Q.js} +210 -169
  32. package/dist/production/{chunk-GPXYCHV5.mjs → chunk-OFC37UQM.mjs} +147 -33
  33. package/dist/{development/context-DohQKLID.d.mts → production/context-DnZM5brG.d.mts} +843 -6
  34. package/dist/production/dom-export.d.mts +20 -2
  35. package/dist/production/dom-export.d.ts +20 -1
  36. package/dist/production/dom-export.js +10 -4
  37. package/dist/production/dom-export.mjs +10 -4
  38. package/dist/production/{index-react-server-client-DXb0OgpJ.d.mts → index-react-server-client-9rHNv-U3.d.mts} +2 -3
  39. package/dist/{development/index-react-server-client-CMphySRb.d.ts → production/index-react-server-client-zr5eNeut.d.ts} +6 -816
  40. package/dist/production/index-react-server-client.d.mts +3 -4
  41. package/dist/production/index-react-server-client.d.ts +2 -2
  42. package/dist/production/index-react-server-client.js +4 -4
  43. package/dist/production/index-react-server-client.mjs +2 -2
  44. package/dist/production/index-react-server.js +21 -7
  45. package/dist/production/index-react-server.mjs +21 -7
  46. package/dist/production/index.d.mts +7 -9
  47. package/dist/production/index.d.ts +5 -5
  48. package/dist/production/index.js +242 -128
  49. package/dist/production/index.mjs +3 -3
  50. package/dist/production/lib/types/internal.d.mts +2 -2
  51. package/dist/production/lib/types/internal.d.ts +1 -1
  52. package/dist/production/lib/types/internal.js +1 -1
  53. package/dist/production/lib/types/internal.mjs +1 -1
  54. package/dist/production/{route-data-CpB5xtMm.d.mts → route-data-C24VEkoE.d.mts} +1 -1
  55. package/dist/production/{routeModules-qBivMBjd.d.ts → routeModules-FY5IBiA_.d.ts} +843 -6
  56. package/package.json +1 -1
  57. package/dist/development/components-CuPfnyiZ.d.mts +0 -814
  58. package/dist/production/components-CuPfnyiZ.d.mts +0 -814
package/CHANGELOG.md CHANGED
@@ -1,18 +1,6 @@
1
1
  # `react-router`
2
2
 
3
- ## 7.8.0-pre.2
4
-
5
- ### Patch Changes
6
-
7
- - proxy server action side-effect redirects from actions for document and callServer requests ([#14131](https://github.com/remix-run/react-router/pull/14131))
8
-
9
- ## 7.8.0-pre.1
10
-
11
- ### Patch Changes
12
-
13
- - [REMOVE] Few additional fixes for returning/throwing data from middleware - attach to #14093 ([#14128](https://github.com/remix-run/react-router/pull/14128))
14
-
15
- ## 7.8.0-pre.0
3
+ ## 7.8.0
16
4
 
17
5
  ### Minor Changes
18
6
 
@@ -23,14 +11,50 @@
23
11
 
24
12
  ### Patch Changes
25
13
 
26
- - [UNSTABLE] Ensure resource route errors go through `handleError` w/middleware enabled ([#14078](https://github.com/remix-run/react-router/pull/14078))
27
14
  - Prevent _"Did not find corresponding fetcher result"_ console error when navigating during a `fetcher.submit` revalidation ([#14114](https://github.com/remix-run/react-router/pull/14114))
15
+
16
+ - Bubble client-side middleware errors prior to `next` to the appropriate ancestor error boundary ([#14138](https://github.com/remix-run/react-router/pull/14138))
17
+
28
18
  - Switch Lazy Route Discovery manifest URL generation to usea standalone `URLSearchParams` instance instead of `URL.searchParams` to avoid a major performance bottleneck in Chrome ([#14084](https://github.com/remix-run/react-router/pull/14084))
29
- - [UNSTABLE] Propagate returned Response from server middleware if next wasn't called ([#14093](https://github.com/remix-run/react-router/pull/14093))
30
- - [UNSTABLE] Allow server middlewares to return `data()` values which will be converted into a `Response` ([#14093](https://github.com/remix-run/react-router/pull/14093))
31
- - [UNSTABLE] Update middleware error handling so that the `next` function never throws and instead handles any middleware errors at the proper `ErrorBoundary` and returns the `Response` up through the ancestor `next` function ([#14118](https://github.com/remix-run/react-router/pull/14118))
32
- - - [UNSTABLE] When middleware is enabled, make the `context` parameter read-only (via `Readonly<unstable_RouterContextProvider>`) so that TypeScript will not allow you to write arbitrary fields to it in loaders, actions, or middleware. ([#14097](https://github.com/remix-run/react-router/pull/14097))
33
- - [UNSTABLE] Rename and alter the signature/functionality of the `unstable_respond` API in `staticHandler.query`/`staticHandler.queryRoute` ([#14103](https://github.com/remix-run/react-router/pull/14103))
19
+
20
+ - Adjust internal RSC usage of `React.use` to avoid Webpack compilation errors when using React 18 ([#14113](https://github.com/remix-run/react-router/pull/14113))
21
+
22
+ - Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059))
23
+
24
+ - Fix types for `UIMatch` to reflect that the `loaderData`/`data` properties may be `undefined` ([#12206](https://github.com/remix-run/react-router/pull/12206))
25
+ - When an `ErrorBoundary` is being rendered, not all active matches will have loader data available, since it may have been their `loader` that threw to trigger the boundary
26
+ - The `UIMatch.data` type was not correctly handing this and would always reflect the presence of data, leading to the unexpected runtime errors when an `ErrorBoundary` was rendered
27
+ - ⚠️ This may cause some type errors to show up in your code for unguarded `match.data` accesses - you should properly guard for `undefined` values in those scenarios.
28
+
29
+ ```tsx
30
+ // app/root.tsx
31
+ export function loader() {
32
+ someFunctionThatThrows(); // ❌ Throws an Error
33
+ return { title: "My Title" };
34
+ }
35
+
36
+ export function Layout({ children }: { children: React.ReactNode }) {
37
+ let matches = useMatches();
38
+ let rootMatch = matches[0] as UIMatch<Awaited<ReturnType<typeof loader>>>;
39
+ // ^ rootMatch.data is incorrectly typed here, so TypeScript does not
40
+ // complain if you do the following which throws an error at runtime:
41
+ let { title } = rootMatch.data; // 💥
42
+
43
+ return <html>...</html>;
44
+ }
45
+ ```
46
+
47
+ - \[UNSTABLE] Ensure resource route errors go through `handleError` w/middleware enabled ([#14078](https://github.com/remix-run/react-router/pull/14078))
48
+
49
+ - \[UNSTABLE] Propagate returned Response from server middleware if next wasn't called ([#14093](https://github.com/remix-run/react-router/pull/14093))
50
+
51
+ - \[UNSTABLE] Allow server middlewares to return `data()` values which will be converted into a `Response` ([#14093](https://github.com/remix-run/react-router/pull/14093))
52
+
53
+ - \[UNSTABLE] Update middleware error handling so that the `next` function never throws and instead handles any middleware errors at the proper `ErrorBoundary` and returns the `Response` up through the ancestor `next` function ([#14118](https://github.com/remix-run/react-router/pull/14118))
54
+
55
+ - \[UNSTABLE] When middleware is enabled, make the `context` parameter read-only (via `Readonly<unstable_RouterContextProvider>`) so that TypeScript will not allow you to write arbitrary fields to it in loaders, actions, or middleware. ([#14097](https://github.com/remix-run/react-router/pull/14097))
56
+
57
+ - \[UNSTABLE] Rename and alter the signature/functionality of the `unstable_respond` API in `staticHandler.query`/`staticHandler.queryRoute` ([#14103](https://github.com/remix-run/react-router/pull/14103))
34
58
  - The API has been renamed to `unstable_generateMiddlewareResponse` for clarity
35
59
  - The main functional change is that instead of running the loaders/actions before calling `unstable_respond` and handing you the result, we now pass a `query`/`queryRoute` function as a parameter and you execute the loaders/actions inside your callback, giving you full access to pre-processing and error handling
36
60
  - The `query` version of the API now has a signature of `(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>`
@@ -57,41 +81,20 @@
57
81
  });
58
82
  ```
59
83
 
60
- - [UNSTABLE] Convert internal middleware implementations to use the new `unstable_generateMiddlewareResponse` API ([#14103](https://github.com/remix-run/react-router/pull/14103))
61
- - Adjust internal RSC usage of `React.use` to avoid Webpack compilation errors when using React 18 ([#14113](https://github.com/remix-run/react-router/pull/14113))
62
- - [UNSTABLE] Change `getLoadContext` signature (`type GetLoadContextFunction`) when `future.unstable_middleware` is enabled so that it returns an `unstable_RouterContextProvider` instance instead of a `Map` used to contruct the instance internally ([#14097](https://github.com/remix-run/react-router/pull/14097))
84
+ - \[UNSTABLE] Convert internal middleware implementations to use the new `unstable_generateMiddlewareResponse` API ([#14103](https://github.com/remix-run/react-router/pull/14103))
85
+
86
+ - \[UNSTABLE] Change `getLoadContext` signature (`type GetLoadContextFunction`) when `future.unstable_middleware` is enabled so that it returns an `unstable_RouterContextProvider` instance instead of a `Map` used to contruct the instance internally ([#14097](https://github.com/remix-run/react-router/pull/14097))
63
87
  - This also removes the `type unstable_InitialContext` export
64
88
  - ⚠️ This is a breaking change if you have adopted middleware and are using a custom server with a `getLoadContext` function
65
89
 
66
- - Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059))
67
- - Fix types for `UIMatch` to reflect that the `loaderData`/`data` properties may be `undefined` ([#12206](https://github.com/remix-run/react-router/pull/12206))
68
- - When an `ErrorBoundary` is being rendered, not all active matches will have loader data available, since it may have been their `loader` that threw to trigger the boundary
69
- - The `UIMatch.data` type was not correctly handing this and would always reflect the presence of data, leading to the unexpected runtime errors when an `ErrorBoundary` was rendered
70
- - ⚠️ This may cause some type errors to show up in your code for unguarded `match.data` accesses - you should properly guard for `undefined` values in those scenarios.
71
-
72
- ```tsx
73
- // app/root.tsx
74
- export function loader() {
75
- someFunctionThatThrows(); // ❌ Throws an Error
76
- return { title: "My Title" };
77
- }
78
-
79
- export function Layout({ children }: { children: React.ReactNode }) {
80
- let matches = useMatches();
81
- let rootMatch = matches[0] as UIMatch<Awaited<ReturnType<typeof loader>>>;
82
- // ^ rootMatch.data is incorrectly typed here, so TypeScript does not
83
- // complain if you do the following which throws an error at runtime:
84
- let { title } = rootMatch.data; // 💥
85
-
86
- return <html>...</html>;
87
- }
88
- ```
90
+ - \[UNSTABLE] Run client middleware on client navigations even if no loaders exist ([#14106](https://github.com/remix-run/react-router/pull/14106))
89
91
 
90
- - [UNSTABLE] Run client middleware on client navigations even if no loaders exist ([#14106](https://github.com/remix-run/react-router/pull/14106))
91
- - [UNSTABLE] Change the `unstable_getContext` signature on `RouterProvider`/`HydratedRouter`/`unstable_RSCHydratedRouter` so that it returns an `unstable_RouterContextProvider` instance instead of a `Map` used to contruct the instance internally ([#14097](https://github.com/remix-run/react-router/pull/14097))
92
+ - \[UNSTABLE] Change the `unstable_getContext` signature on `RouterProvider`/`HydratedRouter`/`unstable_RSCHydratedRouter` so that it returns an `unstable_RouterContextProvider` instance instead of a `Map` used to contruct the instance internally ([#14097](https://github.com/remix-run/react-router/pull/14097))
92
93
  - ⚠️ This is a breaking change if you have adopted the `unstable_getContext` prop
93
94
 
94
- - Fix RSC Data Mode issue where routes that return `false` from `shouldRevalidate` would be replaced by an `<Outlet />` ([#14071](https://github.com/remix-run/react-router/pull/14071))
95
+ - [UNSTABLE] proxy server action side-effect redirects from actions for document and callServer requests ([#14131](https://github.com/remix-run/react-router/pull/14131))
96
+
97
+ - [UNSTABLE] Fix RSC Data Mode issue where routes that return `false` from `shouldRevalidate` would be replaced by an `<Outlet />` ([#14071](https://github.com/remix-run/react-router/pull/14071))
95
98
 
96
99
  ## 7.7.1
97
100