react-router 0.0.0-experimental-48de8bb91 → 0.0.0-experimental-28357fd2a

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 (60) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/dist/development/{chunk-JLJMSTGA.js → chunk-5CCVAEBF.js} +130 -130
  3. package/dist/development/{chunk-7ULAAIFE.js → chunk-EU7MB5YT.js} +242 -138
  4. package/dist/{production/chunk-EDQPXCTL.mjs → development/chunk-QT7WPDUY.mjs} +28 -5
  5. package/dist/development/{chunk-N2RLIAVL.mjs → chunk-Z4HFX7Q2.mjs} +210 -106
  6. package/dist/development/{components-BkK38HPd.d.mts → components-CuPfnyiZ.d.mts} +6 -3
  7. package/dist/development/{context-CphUWOpx.d.mts → context-DohQKLID.d.mts} +86 -62
  8. package/dist/development/dom-export.d.mts +2 -2
  9. package/dist/development/dom-export.js +3 -3
  10. package/dist/development/dom-export.mjs +3 -3
  11. package/dist/{production/index-react-server-client-D-lyvxf_.d.ts → development/index-react-server-client-CMphySRb.d.ts} +48 -21
  12. package/dist/development/{index-react-server-client-pe1TAKAq.d.mts → index-react-server-client-DXb0OgpJ.d.mts} +45 -21
  13. package/dist/development/index-react-server-client.d.mts +4 -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.d.mts +71 -49
  18. package/dist/development/index-react-server.d.ts +71 -49
  19. package/dist/development/index-react-server.js +140 -111
  20. package/dist/development/index-react-server.mjs +140 -111
  21. package/dist/development/index.d.mts +12 -13
  22. package/dist/development/index.d.ts +8 -9
  23. package/dist/development/index.js +126 -103
  24. package/dist/development/index.mjs +3 -3
  25. package/dist/development/lib/types/internal.d.mts +2 -2
  26. package/dist/development/lib/types/internal.d.ts +1 -1
  27. package/dist/development/lib/types/internal.js +1 -1
  28. package/dist/development/lib/types/internal.mjs +1 -1
  29. package/dist/development/{route-data-DJXZgnJq.d.mts → route-data-CpB5xtMm.d.mts} +1 -1
  30. package/dist/{production/routeModules-DH3xUx4Z.d.ts → development/routeModules-qBivMBjd.d.ts} +86 -62
  31. package/dist/production/{chunk-3LGQIXRU.js → chunk-2DWPJCWX.js} +242 -138
  32. package/dist/production/{chunk-4Y2E7I3Z.js → chunk-DOZCQHLU.js} +130 -130
  33. package/dist/production/{chunk-UYFCS7RD.mjs → chunk-EQ3NKH5J.mjs} +210 -106
  34. package/dist/{development/chunk-RK47KLY3.mjs → production/chunk-GPXYCHV5.mjs} +28 -5
  35. package/dist/production/{components-BkK38HPd.d.mts → components-CuPfnyiZ.d.mts} +6 -3
  36. package/dist/production/{context-CphUWOpx.d.mts → context-DohQKLID.d.mts} +86 -62
  37. package/dist/production/dom-export.d.mts +2 -2
  38. package/dist/production/dom-export.js +3 -3
  39. package/dist/production/dom-export.mjs +3 -3
  40. package/dist/{development/index-react-server-client-D-lyvxf_.d.ts → production/index-react-server-client-CMphySRb.d.ts} +48 -21
  41. package/dist/production/{index-react-server-client-pe1TAKAq.d.mts → index-react-server-client-DXb0OgpJ.d.mts} +45 -21
  42. package/dist/production/index-react-server-client.d.mts +4 -4
  43. package/dist/production/index-react-server-client.d.ts +2 -2
  44. package/dist/production/index-react-server-client.js +4 -4
  45. package/dist/production/index-react-server-client.mjs +2 -2
  46. package/dist/production/index-react-server.d.mts +71 -49
  47. package/dist/production/index-react-server.d.ts +71 -49
  48. package/dist/production/index-react-server.js +140 -111
  49. package/dist/production/index-react-server.mjs +140 -111
  50. package/dist/production/index.d.mts +12 -13
  51. package/dist/production/index.d.ts +8 -9
  52. package/dist/production/index.js +126 -103
  53. package/dist/production/index.mjs +3 -3
  54. package/dist/production/lib/types/internal.d.mts +2 -2
  55. package/dist/production/lib/types/internal.d.ts +1 -1
  56. package/dist/production/lib/types/internal.js +1 -1
  57. package/dist/production/lib/types/internal.mjs +1 -1
  58. package/dist/production/{route-data-DJXZgnJq.d.mts → route-data-CpB5xtMm.d.mts} +1 -1
  59. package/dist/{development/routeModules-DH3xUx4Z.d.ts → production/routeModules-qBivMBjd.d.ts} +86 -62
  60. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,98 @@
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
16
+
17
+ ### Minor Changes
18
+
19
+ - Add `nonce` prop to `Links` & `PrefetchPageLinks` ([#14048](https://github.com/remix-run/react-router/pull/14048))
20
+ - Add `loaderData` arguments/properties alongside existing `data` arguments/properties to provide consistency and clarity between `loaderData` and `actionData` across the board ([#14047](https://github.com/remix-run/react-router/pull/14047))
21
+ - Updated types: `Route.MetaArgs`, `Route.MetaMatch`, `MetaArgs`, `MetaMatch`, `Route.ComponentProps.matches`, `UIMatch`
22
+ - `@deprecated` warnings have been added to the existing `data` properties to point users to new `loaderData` properties, in preparation for removing the `data` properties in a future major release
23
+
24
+ ### Patch Changes
25
+
26
+ - [UNSTABLE] Ensure resource route errors go through `handleError` w/middleware enabled ([#14078](https://github.com/remix-run/react-router/pull/14078))
27
+ - 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))
28
+ - 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))
34
+ - The API has been renamed to `unstable_generateMiddlewareResponse` for clarity
35
+ - 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
+ - The `query` version of the API now has a signature of `(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>`
37
+ - The `queryRoute` version of the API now has a signature of `(queryRoute: (r: Request) => Promise<Response>) => Promise<Response>`
38
+ - This allows for more advanced usages such as running logic before/after calling `query` and direct error handling of errors thrown from query
39
+ - ⚠️ This is a breaking change if you've adopted the `staticHandler` `unstable_respond` API
40
+
41
+ ```tsx
42
+ let response = await staticHandler.query(request, {
43
+ requestContext: new unstable_RouterContextProvider(),
44
+ async unstable_generateMiddlewareResponse(query) {
45
+ try {
46
+ // At this point we've run middleware top-down so we need to call the
47
+ // handlers and generate the Response to bubble back up the middleware
48
+ let result = await query(request);
49
+ if (isResponse(result)) {
50
+ return result; // Redirects, etc.
51
+ }
52
+ return await generateHtmlResponse(result);
53
+ } catch (error: unknown) {
54
+ return generateErrorResponse(error);
55
+ }
56
+ },
57
+ });
58
+ ```
59
+
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))
63
+ - This also removes the `type unstable_InitialContext` export
64
+ - ⚠️ This is a breaking change if you have adopted middleware and are using a custom server with a `getLoadContext` function
65
+
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
+ ```
89
+
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
+ - ⚠️ This is a breaking change if you have adopted the `unstable_getContext` prop
93
+
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
+
3
96
  ## 7.7.1
4
97
 
5
98
  ### Patch Changes