react-router 0.0.0-experimental-3fe27584d → 0.0.0-experimental-e067e5e52

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 (68) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/dist/{production/browser-6rd7uvUd.d.ts → development/browser-Cloic07w.d.ts} +6 -3
  3. package/dist/development/{browser-6rd7uvUd.d.ts → browser-JuMzyCK4.d.mts} +6 -3
  4. package/dist/development/{chunk-U7KG5GS5.js → chunk-5UECWI5A.js} +120 -115
  5. package/dist/development/{chunk-BRYTFMCI.js → chunk-DGNRX45Q.js} +7 -7
  6. package/dist/development/{chunk-3X3SWQZD.mjs → chunk-EZE2A5EE.mjs} +188 -140
  7. package/dist/development/{chunk-45X7UCLL.js → chunk-NQI6347W.js} +228 -182
  8. package/dist/development/{chunk-PAJE52U2.mjs → chunk-SWPURLNP.mjs} +106 -4
  9. package/dist/development/dom-export.d.mts +2 -2
  10. package/dist/development/dom-export.d.ts +2 -2
  11. package/dist/development/dom-export.js +27 -27
  12. package/dist/development/dom-export.mjs +3 -3
  13. package/dist/development/{index-react-server-client-DqD3kPgO.d.mts → index-react-server-client-CFThihEp.d.mts} +27 -17
  14. package/dist/{production/index-react-server-client-BzOzOJp1.d.ts → development/index-react-server-client-CtMh0QTM.d.ts} +27 -17
  15. package/dist/development/index-react-server-client.d.mts +2 -2
  16. package/dist/development/index-react-server-client.d.ts +2 -2
  17. package/dist/development/index-react-server-client.js +4 -4
  18. package/dist/development/index-react-server-client.mjs +2 -2
  19. package/dist/development/index-react-server.d.mts +10 -7
  20. package/dist/development/index-react-server.d.ts +10 -7
  21. package/dist/development/index-react-server.js +162 -59
  22. package/dist/development/index-react-server.mjs +162 -60
  23. package/dist/development/index.d.mts +10 -9
  24. package/dist/development/index.d.ts +10 -9
  25. package/dist/development/index.js +198 -96
  26. package/dist/development/index.mjs +3 -3
  27. package/dist/{production/instrumentation-oYD0_Scs.d.ts → development/instrumentation-C7Lh_MjH.d.ts} +7 -7
  28. package/dist/development/lib/types/internal.d.mts +2 -2
  29. package/dist/development/lib/types/internal.d.ts +2 -2
  30. package/dist/development/lib/types/internal.js +1 -1
  31. package/dist/development/lib/types/internal.mjs +1 -1
  32. package/dist/development/{register-KxI4kXyI.d.ts → register-B86pZKib.d.ts} +1 -1
  33. package/dist/development/{register-Csy-W7ti.d.mts → register-DA0Mb5jF.d.mts} +1 -1
  34. package/dist/development/{router-BbC-RkLv.d.mts → router-CFkT48p_.d.mts} +7 -7
  35. package/dist/production/{browser-dYr_BhiC.d.mts → browser-Cloic07w.d.ts} +6 -3
  36. package/dist/{development/browser-dYr_BhiC.d.mts → production/browser-JuMzyCK4.d.mts} +6 -3
  37. package/dist/production/{chunk-7ZLG3KF4.js → chunk-AHQTEAQI.js} +120 -115
  38. package/dist/production/{chunk-74CL4ICW.js → chunk-DMRAUID3.js} +228 -182
  39. package/dist/production/{chunk-54FXD3KZ.js → chunk-KMR3DDYK.js} +7 -7
  40. package/dist/production/{chunk-NIDGWN2C.mjs → chunk-T33PNRK2.mjs} +188 -140
  41. package/dist/production/{chunk-FOI4SMBB.mjs → chunk-T4I6FMSB.mjs} +106 -4
  42. package/dist/production/dom-export.d.mts +2 -2
  43. package/dist/production/dom-export.d.ts +2 -2
  44. package/dist/production/dom-export.js +27 -27
  45. package/dist/production/dom-export.mjs +3 -3
  46. package/dist/production/{index-react-server-client-DqD3kPgO.d.mts → index-react-server-client-CFThihEp.d.mts} +27 -17
  47. package/dist/{development/index-react-server-client-BzOzOJp1.d.ts → production/index-react-server-client-CtMh0QTM.d.ts} +27 -17
  48. package/dist/production/index-react-server-client.d.mts +2 -2
  49. package/dist/production/index-react-server-client.d.ts +2 -2
  50. package/dist/production/index-react-server-client.js +4 -4
  51. package/dist/production/index-react-server-client.mjs +2 -2
  52. package/dist/production/index-react-server.d.mts +10 -7
  53. package/dist/production/index-react-server.d.ts +10 -7
  54. package/dist/production/index-react-server.js +162 -59
  55. package/dist/production/index-react-server.mjs +162 -60
  56. package/dist/production/index.d.mts +10 -9
  57. package/dist/production/index.d.ts +10 -9
  58. package/dist/production/index.js +198 -96
  59. package/dist/production/index.mjs +3 -3
  60. package/dist/{development/instrumentation-oYD0_Scs.d.ts → production/instrumentation-C7Lh_MjH.d.ts} +7 -7
  61. package/dist/production/lib/types/internal.d.mts +2 -2
  62. package/dist/production/lib/types/internal.d.ts +2 -2
  63. package/dist/production/lib/types/internal.js +1 -1
  64. package/dist/production/lib/types/internal.mjs +1 -1
  65. package/dist/production/{register-KxI4kXyI.d.ts → register-B86pZKib.d.ts} +1 -1
  66. package/dist/production/{register-Csy-W7ti.d.mts → register-DA0Mb5jF.d.mts} +1 -1
  67. package/dist/production/{router-BbC-RkLv.d.mts → router-CFkT48p_.d.mts} +7 -7
  68. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,68 @@
1
1
  # `react-router`
2
2
 
3
+ ## 7.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add `crossOrigin` prop to `Links` component ([#14687](https://github.com/remix-run/react-router/pull/14687))
8
+
9
+ ### Patch Changes
10
+
11
+ - Fix double slash normalization for useNavigate colon urls ([#14718](https://github.com/remix-run/react-router/pull/14718))
12
+ - Update failed origin checks to return a 400 status instead of a 500 ([#14737](https://github.com/remix-run/react-router/pull/14737))
13
+ - Bugfix #14666: Inline criticalCss is missing nonce ([#14691](https://github.com/remix-run/react-router/pull/14691))
14
+ - Loosen `allowedActionOrigins` glob check so `**` matches all domains ([#14722](https://github.com/remix-run/react-router/pull/14722))
15
+
16
+ ## 7.12.0
17
+
18
+ ### Minor Changes
19
+
20
+ - Add additional layer of CSRF protection by rejecting submissions to UI routes from external origins. If you need to permit access to specific external origins, you can specify them in the `react-router.config.ts` config `allowedActionOrigins` field. ([#14708](https://github.com/remix-run/react-router/pull/14708))
21
+
22
+ ### Patch Changes
23
+
24
+ - Fix `generatePath` when used with suffixed params (i.e., "/books/:id.json") ([#14269](https://github.com/remix-run/react-router/pull/14269))
25
+
26
+ - Export `UNSAFE_createMemoryHistory` and `UNSAFE_createHashHistory` alongside `UNSAFE_createBrowserHistory` for consistency. These are not intended to be used for new apps but intended to help apps usiong `unstable_HistoryRouter` migrate from v6->v7 so they can adopt the newer APIs. ([#14663](https://github.com/remix-run/react-router/pull/14663))
27
+
28
+ - Escape HTML in scroll restoration keys ([#14705](https://github.com/remix-run/react-router/pull/14705))
29
+
30
+ - Validate redirect locations ([#14706](https://github.com/remix-run/react-router/pull/14706))
31
+
32
+ - \[UNSTABLE] Pass `<Scripts nonce>` value through to the underlying `importmap` `script` tag when using `future.unstable_subResourceIntegrity` ([#14675](https://github.com/remix-run/react-router/pull/14675))
33
+
34
+ - \[UNSTABLE] Add a new `future.unstable_trailingSlashAwareDataRequests` flag to provide consistent behavior of `request.pathname` inside `middleware`, `loader`, and `action` functions on document and data requests when a trailing slash is present in the browser URL. ([#14644](https://github.com/remix-run/react-router/pull/14644))
35
+
36
+ Currently, your HTTP and `request` pathnames would be as follows for `/a/b/c` and `/a/b/c/`
37
+
38
+ | URL `/a/b/c` | **HTTP pathname** | **`request` pathname\`** |
39
+ | ------------ | ----------------- | ------------------------ |
40
+ | **Document** | `/a/b/c` | `/a/b/c` ✅ |
41
+ | **Data** | `/a/b/c.data` | `/a/b/c` ✅ |
42
+
43
+ | URL `/a/b/c/` | **HTTP pathname** | **`request` pathname\`** |
44
+ | ------------- | ----------------- | ------------------------ |
45
+ | **Document** | `/a/b/c/` | `/a/b/c/` ✅ |
46
+ | **Data** | `/a/b/c.data` | `/a/b/c` ⚠️ |
47
+
48
+ With this flag enabled, these pathnames will be made consistent though a new `_.data` format for client-side `.data` requests:
49
+
50
+ | URL `/a/b/c` | **HTTP pathname** | **`request` pathname\`** |
51
+ | ------------ | ----------------- | ------------------------ |
52
+ | **Document** | `/a/b/c` | `/a/b/c` ✅ |
53
+ | **Data** | `/a/b/c.data` | `/a/b/c` ✅ |
54
+
55
+ | URL `/a/b/c/` | **HTTP pathname** | **`request` pathname\`** |
56
+ | ------------- | ------------------ | ------------------------ |
57
+ | **Document** | `/a/b/c/` | `/a/b/c/` ✅ |
58
+ | **Data** | `/a/b/c/_.data` ⬅️ | `/a/b/c/` ✅ |
59
+
60
+ This a bug fix but we are putting it behind an opt-in flag because it has the potential to be a "breaking bug fix" if you are relying on the URL format for any other application or caching logic.
61
+
62
+ Enabling this flag also changes the format of client side `.data` requests from `/_root.data` to `/_.data` when navigating to `/` to align with the new format. This does not impact the `request` pathname which is still `/` in all cases.
63
+
64
+ - Preserve `clientLoader.hydrate=true` when using `<HydratedRouter unstable_instrumentations>` ([#14674](https://github.com/remix-run/react-router/pull/14674))
65
+
3
66
  ## 7.11.0
4
67
 
5
68
  ### Minor Changes
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
- import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction, e as RouterInit } from './instrumentation-oYD0_Scs.js';
2
+ import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction, e as RouterInit } from './instrumentation-C7Lh_MjH.js';
3
3
 
4
+ declare function getRequest(): Request;
4
5
  type RSCRouteConfigEntryBase = {
5
6
  action?: ActionFunction;
6
7
  clientAction?: ClientActionFunction;
@@ -138,6 +139,7 @@ type LoadServerActionFunction = (id: string) => Promise<Function>;
138
139
  * @category RSC
139
140
  * @mode data
140
141
  * @param opts Options
142
+ * @param opts.allowedActionOrigins Origin patterns that are allowed to execute actions.
141
143
  * @param opts.basename The basename to use when matching the request.
142
144
  * @param opts.createTemporaryReferenceSet A function that returns a temporary
143
145
  * reference set for the request, used to track temporary references in the [RSC](https://react.dev/reference/rsc/server-components)
@@ -167,7 +169,8 @@ type LoadServerActionFunction = (id: string) => Promise<Function>;
167
169
  * that contains the [RSC](https://react.dev/reference/rsc/server-components)
168
170
  * data for hydration.
169
171
  */
170
- declare function matchRSCServerRequest({ createTemporaryReferenceSet, basename, decodeReply, requestContext, loadServerAction, decodeAction, decodeFormState, onError, request, routes, generateResponse, }: {
172
+ declare function matchRSCServerRequest({ allowedActionOrigins, createTemporaryReferenceSet, basename, decodeReply, requestContext, loadServerAction, decodeAction, decodeFormState, onError, request, routes, generateResponse, }: {
173
+ allowedActionOrigins?: string[];
171
174
  createTemporaryReferenceSet: () => unknown;
172
175
  basename?: string;
173
176
  decodeReply?: DecodeReplyFunction;
@@ -308,4 +311,4 @@ interface RSCHydratedRouterProps {
308
311
  */
309
312
  declare function RSCHydratedRouter({ createFromReadableStream, fetch: fetchImplementation, payload, routeDiscovery, getContext, }: RSCHydratedRouterProps): React.JSX.Element;
310
313
 
311
- export { type BrowserCreateFromReadableStreamFunction as B, type DecodeActionFunction as D, type EncodeReplyFunction as E, type LoadServerActionFunction as L, RSCHydratedRouter as R, type DecodeFormStateFunction as a, type DecodeReplyFunction as b, createCallServer as c, type RSCManifestPayload as d, type RSCPayload as e, type RSCRenderPayload as f, type RSCHydratedRouterProps as g, type RSCMatch as h, type RSCRouteManifest as i, type RSCRouteMatch as j, type RSCRouteConfigEntry as k, type RSCRouteConfig as l, matchRSCServerRequest as m };
314
+ export { type BrowserCreateFromReadableStreamFunction as B, type DecodeActionFunction as D, type EncodeReplyFunction as E, type LoadServerActionFunction as L, RSCHydratedRouter as R, type DecodeFormStateFunction as a, type DecodeReplyFunction as b, createCallServer as c, type RSCManifestPayload as d, type RSCPayload as e, type RSCRenderPayload as f, getRequest as g, type RSCHydratedRouterProps as h, type RSCMatch as i, type RSCRouteManifest as j, type RSCRouteMatch as k, type RSCRouteConfigEntry as l, matchRSCServerRequest as m, type RSCRouteConfig as n };
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
- import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction, e as RouterInit } from './instrumentation-oYD0_Scs.js';
2
+ import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction, e as RouterInit } from './router-CFkT48p_.mjs';
3
3
 
4
+ declare function getRequest(): Request;
4
5
  type RSCRouteConfigEntryBase = {
5
6
  action?: ActionFunction;
6
7
  clientAction?: ClientActionFunction;
@@ -138,6 +139,7 @@ type LoadServerActionFunction = (id: string) => Promise<Function>;
138
139
  * @category RSC
139
140
  * @mode data
140
141
  * @param opts Options
142
+ * @param opts.allowedActionOrigins Origin patterns that are allowed to execute actions.
141
143
  * @param opts.basename The basename to use when matching the request.
142
144
  * @param opts.createTemporaryReferenceSet A function that returns a temporary
143
145
  * reference set for the request, used to track temporary references in the [RSC](https://react.dev/reference/rsc/server-components)
@@ -167,7 +169,8 @@ type LoadServerActionFunction = (id: string) => Promise<Function>;
167
169
  * that contains the [RSC](https://react.dev/reference/rsc/server-components)
168
170
  * data for hydration.
169
171
  */
170
- declare function matchRSCServerRequest({ createTemporaryReferenceSet, basename, decodeReply, requestContext, loadServerAction, decodeAction, decodeFormState, onError, request, routes, generateResponse, }: {
172
+ declare function matchRSCServerRequest({ allowedActionOrigins, createTemporaryReferenceSet, basename, decodeReply, requestContext, loadServerAction, decodeAction, decodeFormState, onError, request, routes, generateResponse, }: {
173
+ allowedActionOrigins?: string[];
171
174
  createTemporaryReferenceSet: () => unknown;
172
175
  basename?: string;
173
176
  decodeReply?: DecodeReplyFunction;
@@ -308,4 +311,4 @@ interface RSCHydratedRouterProps {
308
311
  */
309
312
  declare function RSCHydratedRouter({ createFromReadableStream, fetch: fetchImplementation, payload, routeDiscovery, getContext, }: RSCHydratedRouterProps): React.JSX.Element;
310
313
 
311
- export { type BrowserCreateFromReadableStreamFunction as B, type DecodeActionFunction as D, type EncodeReplyFunction as E, type LoadServerActionFunction as L, RSCHydratedRouter as R, type DecodeFormStateFunction as a, type DecodeReplyFunction as b, createCallServer as c, type RSCManifestPayload as d, type RSCPayload as e, type RSCRenderPayload as f, type RSCHydratedRouterProps as g, type RSCMatch as h, type RSCRouteManifest as i, type RSCRouteMatch as j, type RSCRouteConfigEntry as k, type RSCRouteConfig as l, matchRSCServerRequest as m };
314
+ export { type BrowserCreateFromReadableStreamFunction as B, type DecodeActionFunction as D, type EncodeReplyFunction as E, type LoadServerActionFunction as L, RSCHydratedRouter as R, type DecodeFormStateFunction as a, type DecodeReplyFunction as b, createCallServer as c, type RSCManifestPayload as d, type RSCPayload as e, type RSCRenderPayload as f, getRequest as g, type RSCHydratedRouterProps as h, type RSCMatch as i, type RSCRouteManifest as j, type RSCRouteMatch as k, type RSCRouteConfigEntry as l, matchRSCServerRequest as m, type RSCRouteConfig as n };