@react-router/dev 7.12.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 +17 -15
- 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,5 +1,15 @@
|
|
|
1
1
|
# `@react-router/dev`
|
|
2
2
|
|
|
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
|
+
|
|
3
13
|
## 7.12.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -18,25 +28,25 @@
|
|
|
18
28
|
|
|
19
29
|
| URL `/a/b/c` | **HTTP pathname** | **`request` pathname\`** |
|
|
20
30
|
| ------------ | ----------------- | ------------------------ |
|
|
21
|
-
| **Document** | `/a/b/c` | `/a/b/c` ✅
|
|
22
|
-
| **Data** | `/a/b/c.data` | `/a/b/c` ✅
|
|
31
|
+
| **Document** | `/a/b/c` | `/a/b/c` ✅ |
|
|
32
|
+
| **Data** | `/a/b/c.data` | `/a/b/c` ✅ |
|
|
23
33
|
|
|
24
34
|
| URL `/a/b/c/` | **HTTP pathname** | **`request` pathname\`** |
|
|
25
35
|
| ------------- | ----------------- | ------------------------ |
|
|
26
|
-
| **Document** | `/a/b/c/` | `/a/b/c/` ✅
|
|
36
|
+
| **Document** | `/a/b/c/` | `/a/b/c/` ✅ |
|
|
27
37
|
| **Data** | `/a/b/c.data` | `/a/b/c` ⚠️ |
|
|
28
38
|
|
|
29
39
|
With this flag enabled, these pathnames will be made consistent though a new `_.data` format for client-side `.data` requests:
|
|
30
40
|
|
|
31
41
|
| URL `/a/b/c` | **HTTP pathname** | **`request` pathname\`** |
|
|
32
42
|
| ------------ | ----------------- | ------------------------ |
|
|
33
|
-
| **Document** | `/a/b/c` | `/a/b/c` ✅
|
|
34
|
-
| **Data** | `/a/b/c.data` | `/a/b/c` ✅
|
|
43
|
+
| **Document** | `/a/b/c` | `/a/b/c` ✅ |
|
|
44
|
+
| **Data** | `/a/b/c.data` | `/a/b/c` ✅ |
|
|
35
45
|
|
|
36
46
|
| URL `/a/b/c/` | **HTTP pathname** | **`request` pathname\`** |
|
|
37
47
|
| ------------- | ------------------ | ------------------------ |
|
|
38
|
-
| **Document** | `/a/b/c/` | `/a/b/c/` ✅
|
|
39
|
-
| **Data** | `/a/b/c/_.data` ⬅️ | `/a/b/c/` ✅
|
|
48
|
+
| **Document** | `/a/b/c/` | `/a/b/c/` ✅ |
|
|
49
|
+
| **Data** | `/a/b/c/_.data` ⬅️ | `/a/b/c/` ✅ |
|
|
40
50
|
|
|
41
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.
|
|
42
52
|
|
|
@@ -294,7 +304,6 @@
|
|
|
294
304
|
- Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215))
|
|
295
305
|
|
|
296
306
|
We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use:
|
|
297
|
-
|
|
298
307
|
- [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider)
|
|
299
308
|
- [`createContext`](https://reactrouter.com/api/utils/createContext)
|
|
300
309
|
- `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option
|
|
@@ -1037,7 +1046,6 @@
|
|
|
1037
1046
|
```
|
|
1038
1047
|
|
|
1039
1048
|
This initial implementation targets type inference for:
|
|
1040
|
-
|
|
1041
1049
|
- `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
|
|
1042
1050
|
- `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
|
|
1043
1051
|
- `ActionData` : Action data from `action` and/or `clientAction` within your route module
|
|
@@ -1052,7 +1060,6 @@
|
|
|
1052
1060
|
```
|
|
1053
1061
|
|
|
1054
1062
|
Check out our docs for more:
|
|
1055
|
-
|
|
1056
1063
|
- [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
|
|
1057
1064
|
- [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
|
|
1058
1065
|
|
|
@@ -1252,7 +1259,6 @@
|
|
|
1252
1259
|
- Vite: Provide `Unstable_ServerBundlesFunction` and `Unstable_VitePluginConfig` types ([#8654](https://github.com/remix-run/remix/pull/8654))
|
|
1253
1260
|
|
|
1254
1261
|
- Vite: add `--sourcemapClient` and `--sourcemapServer` flags to `remix vite:build` ([#8613](https://github.com/remix-run/remix/pull/8613))
|
|
1255
|
-
|
|
1256
1262
|
- `--sourcemapClient`
|
|
1257
1263
|
|
|
1258
1264
|
- `--sourcemapClient=inline`
|
|
@@ -1589,7 +1595,6 @@
|
|
|
1589
1595
|
- Add support for `clientLoader`/`clientAction`/`HydrateFallback` route exports ([RFC](https://github.com/remix-run/remix/discussions/7634)) ([#8173](https://github.com/remix-run/remix/pull/8173))
|
|
1590
1596
|
|
|
1591
1597
|
Remix now supports loaders/actions that run on the client (in addition to, or instead of the loader/action that runs on the server). While we still recommend server loaders/actions for the majority of your data needs in a Remix app - these provide some levers you can pull for more advanced use-cases such as:
|
|
1592
|
-
|
|
1593
1598
|
- Leveraging a data source local to the browser (i.e., `localStorage`)
|
|
1594
1599
|
- Managing a client-side cache of server data (like `IndexedDB`)
|
|
1595
1600
|
- Bypassing the Remix server in a BFF setup and hitting your API directly from the browser
|
|
@@ -1993,7 +1998,6 @@
|
|
|
1993
1998
|
- Output esbuild metafiles for bundle analysis ([#6772](https://github.com/remix-run/remix/pull/6772))
|
|
1994
1999
|
|
|
1995
2000
|
Written to server build directory (`build/` by default):
|
|
1996
|
-
|
|
1997
2001
|
- `metafile.css.json`
|
|
1998
2002
|
- `metafile.js.json` (browser JS)
|
|
1999
2003
|
- `metafile.server.json` (server JS)
|
|
@@ -2091,7 +2095,6 @@
|
|
|
2091
2095
|
- built-in tls support ([#6483](https://github.com/remix-run/remix/pull/6483))
|
|
2092
2096
|
|
|
2093
2097
|
New options:
|
|
2094
|
-
|
|
2095
2098
|
- `--tls-key` / `tlsKey`: TLS key
|
|
2096
2099
|
- `--tls-cert` / `tlsCert`: TLS Certificate
|
|
2097
2100
|
|
|
@@ -2362,7 +2365,6 @@
|
|
|
2362
2365
|
```
|
|
2363
2366
|
|
|
2364
2367
|
The dev server will:
|
|
2365
|
-
|
|
2366
2368
|
- force `NODE_ENV=development` and warn you if it was previously set to something else
|
|
2367
2369
|
- rebuild your app whenever your Remix app code changes
|
|
2368
2370
|
- restart your app server whenever rebuilds succeed
|
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": {
|