Skip to content

Commit 98ebb81

Browse files
committed
Merge branch 'release-next'
2 parents ba7e37e + 5557ba3 commit 98ebb81

File tree

49 files changed

+1255
-251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1255
-251
lines changed

CHANGELOG.md

Lines changed: 161 additions & 139 deletions
Large diffs are not rendered by default.

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
- amitdahan
2828
- AmRo045
2929
- amsal
30+
- AnandShiva
3031
- Andarist
3132
- andreasottosson-polestar
3233
- andreiborza

docs/api/components/Links.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function Root() {
4545
## Signature
4646

4747
```tsx
48-
function Links({ nonce }: LinksProps): React.JSX.Element
48+
function Links({ nonce, crossOrigin }: LinksProps): React.JSX.Element
4949
```
5050

5151
## Props
@@ -56,3 +56,9 @@ A [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_a
5656
attribute to render on the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
5757
element
5858

59+
### crossOrigin
60+
61+
A [`crossOrigin`](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin)
62+
attribute to render on the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
63+
element
64+

docs/api/framework-conventions/react-router.config.ts.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,45 @@ export default {
3030

3131
## Options
3232

33+
### `allowedActionOrigins`
34+
35+
An array of allowed origin hosts for action submissions to UI routes (does not apply to resource routes). Supports micromatch glob patterns (`*` to match one segment, `**` to match multiple).
36+
37+
```tsx filename=react-router.config.ts
38+
export default {
39+
allowedActionOrigins: [
40+
"example.com",
41+
"*.example.com", // sub.example.com
42+
"**.example.com", // sub.domain.example.com
43+
],
44+
} satisfies Config;
45+
```
46+
47+
If you need to set this value at runtime, you can do in by setting the value on the server build in your custom server. For example, when using `express`:
48+
49+
```ts
50+
import express from "express";
51+
import { createRequestHandler } from "@react-router/express";
52+
import type { ServerBuild } from "react-router";
53+
54+
export const app = express();
55+
56+
async function getBuild() {
57+
let build: ServerBuild = await import(
58+
"virtual:react-router/server-build"
59+
);
60+
return {
61+
...build,
62+
allowedActionOrigins:
63+
process.env.NODE_ENV === "development"
64+
? undefined
65+
: ["staging.example.com", "www.example.com"],
66+
};
67+
}
68+
69+
app.use(createRequestHandler({ build: getBuild }));
70+
```
71+
3372
### `appDirectory`
3473

3574
The path to the `app` directory, relative to the root directory. Defaults to `"app"`.
@@ -66,7 +105,11 @@ A function that is called after the full React Router build is complete.
66105

67106
```tsx filename=react-router.config.ts
68107
export default {
69-
buildEnd: async ({ buildManifest, reactRouterConfig, viteConfig }) => {
108+
buildEnd: async ({
109+
buildManifest,
110+
reactRouterConfig,
111+
viteConfig,
112+
}) => {
70113
// Custom build logic here
71114
console.log("Build completed!");
72115
},

docs/api/rsc/matchRSCServerRequest.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ matchRSCServerRequest({
7070

7171
```tsx
7272
async function matchRSCServerRequest({
73+
allowedActionOrigins,
7374
createTemporaryReferenceSet,
7475
basename,
7576
decodeReply,
@@ -82,6 +83,7 @@ async function matchRSCServerRequest({
8283
routes,
8384
generateResponse,
8485
}: {
86+
allowedActionOrigins?: string[];
8587
createTemporaryReferenceSet: () => unknown;
8688
basename?: string;
8789
decodeReply?: DecodeReplyFunction;
@@ -107,6 +109,10 @@ async function matchRSCServerRequest({
107109

108110
## Params
109111

112+
### opts.allowedActionOrigins
113+
114+
Origin patterns that are allowed to execute actions.
115+
110116
### opts.basename
111117

112118
The basename to use when matching the request.

integration/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Minor Changes
66

77
- Unstable Vite support for Node-based Remix apps ([#7590](https://github.com/remix-run/remix/pull/7590))
8+
89
- `remix build` 👉 `vite build && vite build --ssr`
910
- `remix dev` 👉 `vite dev`
1011

packages/create-react-router/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# `create-react-router`
22

3+
## 7.13.0
4+
5+
_No changes_
6+
37
## 7.12.0
48

9+
_No changes_
10+
511
## 7.11.0
612

713
_No changes_

packages/create-react-router/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-react-router",
3-
"version": "7.12.0",
3+
"version": "7.13.0",
44
"description": "Create a new React Router app",
55
"homepage": "https://reactrouter.com",
66
"bugs": {

packages/react-router-architect/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# `@react-router/architect`
22

3+
## 7.13.0
4+
5+
### Patch Changes
6+
7+
- Updated dependencies:
8+
- `react-router@7.13.0`
9+
- `@react-router/node@7.13.0`
10+
311
## 7.12.0
412

513
### Patch Changes
@@ -87,6 +95,7 @@
8795
- Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215))
8896

8997
We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use:
98+
9099
- [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider)
91100
- [`createContext`](https://reactrouter.com/api/utils/createContext)
92101
- `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option
@@ -310,6 +319,7 @@
310319
### Major Changes
311320

312321
- For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837))
322+
313323
- `createCookie`
314324
- `createCookieSessionStorage`
315325
- `createMemorySessionStorage`
@@ -318,6 +328,7 @@
318328
For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html)
319329

320330
Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:
331+
321332
- `createCookieFactory`
322333
- `createSessionStorageFactory`
323334
- `createCookieSessionStorageFactory`

packages/react-router-architect/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@react-router/architect",
3-
"version": "7.12.0",
3+
"version": "7.13.0",
44
"description": "Architect server request handler for React Router",
55
"bugs": {
66
"url": "https://github.com/remix-run/react-router/issues"

0 commit comments

Comments
 (0)