@react-router/dev 7.12.0-pre.0 → 7.13.0-pre.0
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.
- package/CHANGELOG.md +33 -21
- package/dist/cli/index.js +2 -5
- package/dist/config.d.ts +38 -2
- package/dist/config.js +1 -1
- package/dist/routes.js +1 -1
- package/dist/vite/cloudflare.js +7 -9
- package/dist/vite.js +10 -9
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
# `@react-router/dev`
|
|
2
2
|
|
|
3
|
-
## 7.
|
|
3
|
+
## 7.13.0-pre.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Bump @remix-run/node-fetch-server dep ([#14704](https://github.com/remix-run/react-router/pull/14704))
|
|
8
|
+
- Updated dependencies:
|
|
9
|
+
- `react-router@7.13.0-pre.0`
|
|
10
|
+
- `@react-router/node@7.13.0-pre.0`
|
|
11
|
+
- `@react-router/serve@7.13.0-pre.0`
|
|
12
|
+
|
|
13
|
+
## 7.12.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
6
16
|
|
|
@@ -9,41 +19,43 @@
|
|
|
9
19
|
### Patch Changes
|
|
10
20
|
|
|
11
21
|
- Fix `Maximum call stack size exceeded` errors when HMR is triggered against code with cyclic imports ([#14522](https://github.com/remix-run/react-router/pull/14522))
|
|
22
|
+
|
|
12
23
|
- fix(vite): Skip SSR middleware in preview server for SPA mode ([#14673](https://github.com/remix-run/react-router/pull/14673))
|
|
13
|
-
|
|
24
|
+
|
|
25
|
+
- \[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))
|
|
14
26
|
|
|
15
27
|
Currently, your HTTP and `request` pathnames would be as follows for `/a/b/c` and `/a/b/c/`
|
|
16
28
|
|
|
17
|
-
| URL `/a/b/c` | **HTTP pathname** | **`request` pathname
|
|
18
|
-
| ------------ | ----------------- |
|
|
19
|
-
| **Document** | `/a/b/c` | `/a/b/c` ✅
|
|
20
|
-
| **Data** | `/a/b/c.data` | `/a/b/c` ✅
|
|
29
|
+
| URL `/a/b/c` | **HTTP pathname** | **`request` pathname\`** |
|
|
30
|
+
| ------------ | ----------------- | ------------------------ |
|
|
31
|
+
| **Document** | `/a/b/c` | `/a/b/c` ✅ |
|
|
32
|
+
| **Data** | `/a/b/c.data` | `/a/b/c` ✅ |
|
|
21
33
|
|
|
22
|
-
| URL `/a/b/c/` | **HTTP pathname** | **`request` pathname
|
|
23
|
-
| ------------- | ----------------- |
|
|
24
|
-
| **Document** | `/a/b/c/` | `/a/b/c/` ✅
|
|
25
|
-
| **Data** | `/a/b/c.data` | `/a/b/c` ⚠️
|
|
34
|
+
| URL `/a/b/c/` | **HTTP pathname** | **`request` pathname\`** |
|
|
35
|
+
| ------------- | ----------------- | ------------------------ |
|
|
36
|
+
| **Document** | `/a/b/c/` | `/a/b/c/` ✅ |
|
|
37
|
+
| **Data** | `/a/b/c.data` | `/a/b/c` ⚠️ |
|
|
26
38
|
|
|
27
39
|
With this flag enabled, these pathnames will be made consistent though a new `_.data` format for client-side `.data` requests:
|
|
28
40
|
|
|
29
|
-
| URL `/a/b/c` | **HTTP pathname** | **`request` pathname
|
|
30
|
-
| ------------ | ----------------- |
|
|
31
|
-
| **Document** | `/a/b/c` | `/a/b/c` ✅
|
|
32
|
-
| **Data** | `/a/b/c.data` | `/a/b/c` ✅
|
|
41
|
+
| URL `/a/b/c` | **HTTP pathname** | **`request` pathname\`** |
|
|
42
|
+
| ------------ | ----------------- | ------------------------ |
|
|
43
|
+
| **Document** | `/a/b/c` | `/a/b/c` ✅ |
|
|
44
|
+
| **Data** | `/a/b/c.data` | `/a/b/c` ✅ |
|
|
33
45
|
|
|
34
|
-
| URL `/a/b/c/` | **HTTP pathname** | **`request` pathname
|
|
35
|
-
| ------------- | ------------------ |
|
|
36
|
-
| **Document** | `/a/b/c/` | `/a/b/c/` ✅
|
|
37
|
-
| **Data** | `/a/b/c/_.data` ⬅️ | `/a/b/c/` ✅
|
|
46
|
+
| URL `/a/b/c/` | **HTTP pathname** | **`request` pathname\`** |
|
|
47
|
+
| ------------- | ------------------ | ------------------------ |
|
|
48
|
+
| **Document** | `/a/b/c/` | `/a/b/c/` ✅ |
|
|
49
|
+
| **Data** | `/a/b/c/_.data` ⬅️ | `/a/b/c/` ✅ |
|
|
38
50
|
|
|
39
51
|
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.
|
|
40
52
|
|
|
41
53
|
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.
|
|
42
54
|
|
|
43
55
|
- Updated dependencies:
|
|
44
|
-
- `react-router@7.12.0
|
|
45
|
-
- `@react-router/node@7.12.0
|
|
46
|
-
- `@react-router/serve@7.12.0
|
|
56
|
+
- `react-router@7.12.0`
|
|
57
|
+
- `@react-router/node@7.12.0`
|
|
58
|
+
- `@react-router/serve@7.12.0`
|
|
47
59
|
|
|
48
60
|
## 7.11.0
|
|
49
61
|
|
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @react-router/dev v7.
|
|
3
|
+
* @react-router/dev v7.13.0-pre.0
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) Remix Software Inc.
|
|
6
6
|
*
|
|
@@ -1377,11 +1377,9 @@ var init_has_rsc_plugin = __esm({
|
|
|
1377
1377
|
});
|
|
1378
1378
|
|
|
1379
1379
|
// vite/node-adapter.ts
|
|
1380
|
-
var import_node_fetch_server;
|
|
1381
1380
|
var init_node_adapter = __esm({
|
|
1382
1381
|
"vite/node-adapter.ts"() {
|
|
1383
1382
|
"use strict";
|
|
1384
|
-
import_node_fetch_server = require("@remix-run/node-fetch-server");
|
|
1385
1383
|
init_invariant();
|
|
1386
1384
|
}
|
|
1387
1385
|
});
|
|
@@ -1794,7 +1792,7 @@ function resolveEnvironmentsOptions(environmentResolvers, resolverOptions) {
|
|
|
1794
1792
|
function isNonNullable(x) {
|
|
1795
1793
|
return x != null;
|
|
1796
1794
|
}
|
|
1797
|
-
var import_node_crypto, import_node_fs3, import_promises2, path7, url, babel2,
|
|
1795
|
+
var import_node_crypto, import_node_fs3, import_promises2, path7, url, babel2, import_react_router2, import_es_module_lexer, import_pick3, import_jsesc, import_picocolors5, import_kebabCase, CLIENT_NON_COMPONENT_EXPORTS, CLIENT_ROUTE_EXPORTS, BUILD_CLIENT_ROUTE_QUERY_STRING, SSR_BUNDLE_PREFIX, virtualHmrRuntime, virtualInjectHmrRuntime, virtual, getServerBuildDirectory, getClientBuildDirectory, defaultEntriesDir, defaultEntries, REACT_REFRESH_HEADER;
|
|
1798
1796
|
var init_plugin = __esm({
|
|
1799
1797
|
"vite/plugin.ts"() {
|
|
1800
1798
|
"use strict";
|
|
@@ -1804,7 +1802,6 @@ var init_plugin = __esm({
|
|
|
1804
1802
|
path7 = __toESM(require("path"));
|
|
1805
1803
|
url = __toESM(require("url"));
|
|
1806
1804
|
babel2 = __toESM(require("@babel/core"));
|
|
1807
|
-
import_node_fetch_server2 = require("@remix-run/node-fetch-server");
|
|
1808
1805
|
import_react_router2 = require("react-router");
|
|
1809
1806
|
import_es_module_lexer = require("es-module-lexer");
|
|
1810
1807
|
import_pick3 = __toESM(require("lodash/pick"));
|
package/dist/config.d.ts
CHANGED
|
@@ -149,8 +149,44 @@ type ReactRouterConfig = {
|
|
|
149
149
|
*/
|
|
150
150
|
ssr?: boolean;
|
|
151
151
|
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
152
|
+
* An array of allowed origin hosts for action submissions to UI routes (does not apply
|
|
153
|
+
* to resource routes). Supports micromatch glob patterns (`*` to match one segment,
|
|
154
|
+
* `**` to match multiple).
|
|
155
|
+
*
|
|
156
|
+
* ```tsx
|
|
157
|
+
* export default {
|
|
158
|
+
* allowedActionOrigins: [
|
|
159
|
+
* "example.com",
|
|
160
|
+
* "*.example.com", // sub.example.com
|
|
161
|
+
* "**.example.com", // sub.domain.example.com
|
|
162
|
+
* ],
|
|
163
|
+
* } satisfies Config;
|
|
164
|
+
* ```
|
|
165
|
+
*
|
|
166
|
+
* If you need to set this value at runtime, you can do in by setting the value
|
|
167
|
+
* on the server build in your custom server. For example, when using `express`:
|
|
168
|
+
*
|
|
169
|
+
* ```ts
|
|
170
|
+
* import express from "express";
|
|
171
|
+
* import { createRequestHandler } from "@react-router/express";
|
|
172
|
+
* import type { ServerBuild } from "react-router";
|
|
173
|
+
*
|
|
174
|
+
* export const app = express();
|
|
175
|
+
*
|
|
176
|
+
* async function getBuild() {
|
|
177
|
+
* let build: ServerBuild = await import(
|
|
178
|
+
* "virtual:react-router/server-build"
|
|
179
|
+
* );
|
|
180
|
+
* return {
|
|
181
|
+
* ...build,
|
|
182
|
+
* allowedActionOrigins:
|
|
183
|
+
* process.env.NODE_ENV === "development"
|
|
184
|
+
* ? undefined
|
|
185
|
+
* : ["staging.example.com", "www.example.com"],
|
|
186
|
+
* };
|
|
187
|
+
* }
|
|
188
|
+
*
|
|
189
|
+
* app.use(createRequestHandler({ build: getBuild }));
|
|
154
190
|
*/
|
|
155
191
|
allowedActionOrigins?: string[];
|
|
156
192
|
};
|
package/dist/config.js
CHANGED
package/dist/routes.js
CHANGED
package/dist/vite/cloudflare.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/dev v7.
|
|
2
|
+
* @react-router/dev v7.13.0-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -45,12 +45,8 @@ __export(cloudflare_exports, {
|
|
|
45
45
|
module.exports = __toCommonJS(cloudflare_exports);
|
|
46
46
|
|
|
47
47
|
// vite/cloudflare-dev-proxy.ts
|
|
48
|
-
var import_node_fetch_server2 = require("@remix-run/node-fetch-server");
|
|
49
48
|
var import_react_router = require("react-router");
|
|
50
49
|
|
|
51
|
-
// vite/node-adapter.ts
|
|
52
|
-
var import_node_fetch_server = require("@remix-run/node-fetch-server");
|
|
53
|
-
|
|
54
50
|
// invariant.ts
|
|
55
51
|
function invariant(value, message) {
|
|
56
52
|
if (value === false || value === null || typeof value === "undefined") {
|
|
@@ -62,13 +58,14 @@ function invariant(value, message) {
|
|
|
62
58
|
}
|
|
63
59
|
|
|
64
60
|
// vite/node-adapter.ts
|
|
65
|
-
function fromNodeRequest(nodeReq, nodeRes) {
|
|
61
|
+
async function fromNodeRequest(nodeReq, nodeRes) {
|
|
66
62
|
invariant(
|
|
67
63
|
nodeReq.originalUrl,
|
|
68
64
|
"Expected `nodeReq.originalUrl` to be defined"
|
|
69
65
|
);
|
|
70
66
|
nodeReq.url = nodeReq.originalUrl;
|
|
71
|
-
|
|
67
|
+
const { createRequest } = await import("@remix-run/node-fetch-server");
|
|
68
|
+
return createRequest(nodeReq, nodeRes);
|
|
72
69
|
}
|
|
73
70
|
|
|
74
71
|
// vite/vite.ts
|
|
@@ -820,6 +817,7 @@ var cloudflareDevProxyVitePlugin = (options = {}) => {
|
|
|
820
817
|
}
|
|
821
818
|
},
|
|
822
819
|
configureServer: async (viteDevServer) => {
|
|
820
|
+
const { sendResponse } = await import("@remix-run/node-fetch-server");
|
|
823
821
|
let context;
|
|
824
822
|
let getContext = async () => {
|
|
825
823
|
let { getPlatformProxy } = await importWrangler();
|
|
@@ -836,11 +834,11 @@ var cloudflareDevProxyVitePlugin = (options = {}) => {
|
|
|
836
834
|
serverBuildId
|
|
837
835
|
);
|
|
838
836
|
let handler = (0, import_react_router.createRequestHandler)(build, "development");
|
|
839
|
-
let req = fromNodeRequest(nodeReq, nodeRes);
|
|
837
|
+
let req = await fromNodeRequest(nodeReq, nodeRes);
|
|
840
838
|
context ??= await getContext();
|
|
841
839
|
let loadContext = getLoadContext ? await getLoadContext({ request: req, context }) : context;
|
|
842
840
|
let res = await handler(req, loadContext);
|
|
843
|
-
await
|
|
841
|
+
await sendResponse(nodeRes, res);
|
|
844
842
|
} catch (error) {
|
|
845
843
|
next(error);
|
|
846
844
|
}
|
package/dist/vite.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/dev v7.
|
|
2
|
+
* @react-router/dev v7.13.0-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -52,7 +52,6 @@ var import_promises2 = require("fs/promises");
|
|
|
52
52
|
var path6 = __toESM(require("path"));
|
|
53
53
|
var url = __toESM(require("url"));
|
|
54
54
|
var babel = __toESM(require("@babel/core"));
|
|
55
|
-
var import_node_fetch_server2 = require("@remix-run/node-fetch-server");
|
|
56
55
|
var import_react_router2 = require("react-router");
|
|
57
56
|
var import_es_module_lexer = require("es-module-lexer");
|
|
58
57
|
var import_pick3 = __toESM(require("lodash/pick"));
|
|
@@ -1325,14 +1324,14 @@ async function watch(rootDirectory, { mode, logger, rsc }) {
|
|
|
1325
1324
|
}
|
|
1326
1325
|
|
|
1327
1326
|
// vite/node-adapter.ts
|
|
1328
|
-
|
|
1329
|
-
function fromNodeRequest(nodeReq, nodeRes) {
|
|
1327
|
+
async function fromNodeRequest(nodeReq, nodeRes) {
|
|
1330
1328
|
invariant(
|
|
1331
1329
|
nodeReq.originalUrl,
|
|
1332
1330
|
"Expected `nodeReq.originalUrl` to be defined"
|
|
1333
1331
|
);
|
|
1334
1332
|
nodeReq.url = nodeReq.originalUrl;
|
|
1335
|
-
|
|
1333
|
+
const { createRequest } = await import("@remix-run/node-fetch-server");
|
|
1334
|
+
return createRequest(nodeReq, nodeRes);
|
|
1336
1335
|
}
|
|
1337
1336
|
|
|
1338
1337
|
// vite/styles.ts
|
|
@@ -3525,12 +3524,13 @@ var reactRouterVitePlugin = () => {
|
|
|
3525
3524
|
}
|
|
3526
3525
|
let handler = (0, import_react_router2.createRequestHandler)(build, "development");
|
|
3527
3526
|
let nodeHandler = async (nodeReq, nodeRes) => {
|
|
3528
|
-
let req2 = fromNodeRequest(nodeReq, nodeRes);
|
|
3527
|
+
let req2 = await fromNodeRequest(nodeReq, nodeRes);
|
|
3529
3528
|
let res2 = await handler(
|
|
3530
3529
|
req2,
|
|
3531
3530
|
await reactRouterDevLoadContext(req2)
|
|
3532
3531
|
);
|
|
3533
|
-
|
|
3532
|
+
const { sendResponse } = await import("@remix-run/node-fetch-server");
|
|
3533
|
+
await sendResponse(nodeRes, res2);
|
|
3534
3534
|
};
|
|
3535
3535
|
await nodeHandler(req, res);
|
|
3536
3536
|
} catch (error) {
|
|
@@ -3557,12 +3557,13 @@ var reactRouterVitePlugin = () => {
|
|
|
3557
3557
|
let build = await import(url.pathToFileURL(serverBuildFile).href);
|
|
3558
3558
|
let handler = (0, import_react_router2.createRequestHandler)(build, "production");
|
|
3559
3559
|
let nodeHandler = async (nodeReq, nodeRes) => {
|
|
3560
|
-
let req2 = fromNodeRequest(nodeReq, nodeRes);
|
|
3560
|
+
let req2 = await fromNodeRequest(nodeReq, nodeRes);
|
|
3561
3561
|
let res2 = await handler(
|
|
3562
3562
|
req2,
|
|
3563
3563
|
await reactRouterDevLoadContext(req2)
|
|
3564
3564
|
);
|
|
3565
|
-
|
|
3565
|
+
const { sendResponse } = await import("@remix-run/node-fetch-server");
|
|
3566
|
+
await sendResponse(nodeRes, res2);
|
|
3566
3567
|
};
|
|
3567
3568
|
await nodeHandler(req, res);
|
|
3568
3569
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-router/dev",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.13.0-pre.0",
|
|
4
4
|
"description": "Dev tools and CLI for React Router",
|
|
5
5
|
"homepage": "https://reactrouter.com",
|
|
6
6
|
"bugs": {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@babel/preset-typescript": "^7.27.1",
|
|
73
73
|
"@babel/traverse": "^7.27.7",
|
|
74
74
|
"@babel/types": "^7.27.7",
|
|
75
|
-
"@remix-run/node-fetch-server": "^0.
|
|
75
|
+
"@remix-run/node-fetch-server": "^0.13.0",
|
|
76
76
|
"arg": "^5.0.1",
|
|
77
77
|
"babel-dead-code-elimination": "^1.0.6",
|
|
78
78
|
"chokidar": "^4.0.0",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"tinyglobby": "^0.2.14",
|
|
93
93
|
"valibot": "^1.2.0",
|
|
94
94
|
"vite-node": "^3.2.2",
|
|
95
|
-
"@react-router/node": "7.
|
|
95
|
+
"@react-router/node": "7.13.0-pre.0"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@types/babel__core": "^7.20.5",
|
|
@@ -116,8 +116,8 @@
|
|
|
116
116
|
"vite": "^6.3.0",
|
|
117
117
|
"wireit": "0.14.9",
|
|
118
118
|
"wrangler": "^4.23.0",
|
|
119
|
-
"@react-router/serve": "7.
|
|
120
|
-
"react-router": "^7.
|
|
119
|
+
"@react-router/serve": "7.13.0-pre.0",
|
|
120
|
+
"react-router": "^7.13.0-pre.0"
|
|
121
121
|
},
|
|
122
122
|
"peerDependencies": {
|
|
123
123
|
"@vitejs/plugin-rsc": "~0.5.7",
|
|
@@ -125,8 +125,8 @@
|
|
|
125
125
|
"typescript": "^5.1.0",
|
|
126
126
|
"vite": "^5.1.0 || ^6.0.0 || ^7.0.0",
|
|
127
127
|
"wrangler": "^3.28.2 || ^4.0.0",
|
|
128
|
-
"@react-router/serve": "^7.
|
|
129
|
-
"react-router": "^7.
|
|
128
|
+
"@react-router/serve": "^7.13.0-pre.0",
|
|
129
|
+
"react-router": "^7.13.0-pre.0"
|
|
130
130
|
},
|
|
131
131
|
"peerDependenciesMeta": {
|
|
132
132
|
"@vitejs/plugin-rsc": {
|