@react-router/dev 7.4.0 → 7.4.1
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 +14 -1
- package/dist/cli/index.js +8 -3
- package/dist/config.js +1 -1
- package/dist/routes.js +1 -1
- package/dist/static/refresh-utils.cjs +6 -1
- package/dist/vite/cloudflare.js +1 -1
- package/dist/vite.js +33 -4
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# `@react-router/dev`
|
|
2
2
|
|
|
3
|
+
## 7.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix path in prerender error messages ([#13257](https://github.com/remix-run/react-router/pull/13257))
|
|
8
|
+
- Fix typegen for virtual modules when `moduleDetection` is set to `force` ([#13267](https://github.com/remix-run/react-router/pull/13267))
|
|
9
|
+
- When both `future.unstable_middleware` and `future.unstable_splitRouteModules` are enabled, split `unstable_clientMiddleware` route exports into separate chunks when possible ([#13210](https://github.com/remix-run/react-router/pull/13210))
|
|
10
|
+
- Improve performance of `future.unstable_middleware` by ensuring that route modules are only blocking during the middleware phase when the `unstable_clientMiddleware` has been defined ([#13210](https://github.com/remix-run/react-router/pull/13210))
|
|
11
|
+
- Updated dependencies:
|
|
12
|
+
- `react-router@7.4.1`
|
|
13
|
+
- `@react-router/node@7.4.1`
|
|
14
|
+
- `@react-router/serve@7.4.1`
|
|
15
|
+
|
|
3
16
|
## 7.4.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -254,7 +267,7 @@
|
|
|
254
267
|
+import { cloudflareDevProxy } from "@react-router/dev/vite/cloudflare";
|
|
255
268
|
```
|
|
256
269
|
|
|
257
|
-
- Remove single
|
|
270
|
+
- Remove single fetch future flag. ([#11522](https://github.com/remix-run/react-router/pull/11522))
|
|
258
271
|
|
|
259
272
|
- update minimum node version to 18 ([#11690](https://github.com/remix-run/react-router/pull/11690))
|
|
260
273
|
|
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @react-router/dev v7.4.
|
|
3
|
+
* @react-router/dev v7.4.1
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) Remix Software Inc.
|
|
6
6
|
*
|
|
@@ -860,7 +860,7 @@ async function writeAll(ctx) {
|
|
|
860
860
|
});
|
|
861
861
|
const registerPath = Path4.join(typegenDir, "+register.ts");
|
|
862
862
|
import_node_fs3.default.writeFileSync(registerPath, register(ctx));
|
|
863
|
-
const virtualPath = Path4.join(typegenDir, "+virtual.ts");
|
|
863
|
+
const virtualPath = Path4.join(typegenDir, "+virtual.d.ts");
|
|
864
864
|
import_node_fs3.default.writeFileSync(virtualPath, virtual);
|
|
865
865
|
}
|
|
866
866
|
function register(ctx) {
|
|
@@ -1047,6 +1047,7 @@ var init_route_chunks = __esm({
|
|
|
1047
1047
|
routeChunkExportNames = [
|
|
1048
1048
|
"clientAction",
|
|
1049
1049
|
"clientLoader",
|
|
1050
|
+
"unstable_clientMiddleware",
|
|
1050
1051
|
"HydrateFallback"
|
|
1051
1052
|
];
|
|
1052
1053
|
mainChunkName = "main";
|
|
@@ -1056,6 +1057,7 @@ var init_route_chunks = __esm({
|
|
|
1056
1057
|
main: `${routeChunkQueryStringPrefix}main`,
|
|
1057
1058
|
clientAction: `${routeChunkQueryStringPrefix}clientAction`,
|
|
1058
1059
|
clientLoader: `${routeChunkQueryStringPrefix}clientLoader`,
|
|
1060
|
+
unstable_clientMiddleware: `${routeChunkQueryStringPrefix}unstable_clientMiddleware`,
|
|
1059
1061
|
HydrateFallback: `${routeChunkQueryStringPrefix}HydrateFallback`
|
|
1060
1062
|
};
|
|
1061
1063
|
}
|
|
@@ -1248,7 +1250,10 @@ async function getEnvironmentOptionsResolvers(ctx, viteCommand) {
|
|
|
1248
1250
|
output: (ctx.reactRouterConfig.future.unstable_viteEnvironmentApi ? viteUserConfig?.environments?.client?.build?.rollupOptions?.output : viteUserConfig?.build?.rollupOptions?.output) ?? {
|
|
1249
1251
|
entryFileNames: ({ moduleIds }) => {
|
|
1250
1252
|
let routeChunkModuleId = moduleIds.find(isRouteChunkModuleId);
|
|
1251
|
-
let routeChunkName = routeChunkModuleId ? getRouteChunkNameFromModuleId(routeChunkModuleId)
|
|
1253
|
+
let routeChunkName = routeChunkModuleId ? getRouteChunkNameFromModuleId(routeChunkModuleId)?.replace(
|
|
1254
|
+
"unstable_",
|
|
1255
|
+
""
|
|
1256
|
+
) : null;
|
|
1252
1257
|
let routeChunkSuffix = routeChunkName ? `-${(0, import_kebabCase.default)(routeChunkName)}` : "";
|
|
1253
1258
|
return path7.posix.join(
|
|
1254
1259
|
(ctx.reactRouterConfig.future.unstable_viteEnvironmentApi ? viteUserConfig?.environments?.client?.build?.assetsDir : viteUserConfig?.build?.assetsDir) ?? "assets",
|
package/dist/config.js
CHANGED
package/dist/routes.js
CHANGED
|
@@ -45,7 +45,12 @@ const enqueueUpdate = debounce(async () => {
|
|
|
45
45
|
|
|
46
46
|
let needsRevalidation = new Set(
|
|
47
47
|
Array.from(routeUpdates.values())
|
|
48
|
-
.filter(
|
|
48
|
+
.filter(
|
|
49
|
+
(route) =>
|
|
50
|
+
route.hasLoader ||
|
|
51
|
+
route.hasClientLoader ||
|
|
52
|
+
route.hasClientMiddleware
|
|
53
|
+
)
|
|
49
54
|
.map((route) => route.id)
|
|
50
55
|
);
|
|
51
56
|
|
package/dist/vite/cloudflare.js
CHANGED
package/dist/vite.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/dev v7.4.
|
|
2
|
+
* @react-router/dev v7.4.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -825,7 +825,7 @@ async function writeAll(ctx) {
|
|
|
825
825
|
});
|
|
826
826
|
const registerPath = Path4.join(typegenDir, "+register.ts");
|
|
827
827
|
import_node_fs2.default.writeFileSync(registerPath, register(ctx));
|
|
828
|
-
const virtualPath = Path4.join(typegenDir, "+virtual.ts");
|
|
828
|
+
const virtualPath = Path4.join(typegenDir, "+virtual.d.ts");
|
|
829
829
|
import_node_fs2.default.writeFileSync(virtualPath, virtual);
|
|
830
830
|
}
|
|
831
831
|
function register(ctx) {
|
|
@@ -1817,6 +1817,7 @@ function detectRouteChunks(code, cache, cacheKey) {
|
|
|
1817
1817
|
var routeChunkExportNames = [
|
|
1818
1818
|
"clientAction",
|
|
1819
1819
|
"clientLoader",
|
|
1820
|
+
"unstable_clientMiddleware",
|
|
1820
1821
|
"HydrateFallback"
|
|
1821
1822
|
];
|
|
1822
1823
|
var mainChunkName = "main";
|
|
@@ -1832,6 +1833,7 @@ var routeChunkQueryStrings = {
|
|
|
1832
1833
|
main: `${routeChunkQueryStringPrefix}main`,
|
|
1833
1834
|
clientAction: `${routeChunkQueryStringPrefix}clientAction`,
|
|
1834
1835
|
clientLoader: `${routeChunkQueryStringPrefix}clientLoader`,
|
|
1836
|
+
unstable_clientMiddleware: `${routeChunkQueryStringPrefix}unstable_clientMiddleware`,
|
|
1835
1837
|
HydrateFallback: `${routeChunkQueryStringPrefix}HydrateFallback`
|
|
1836
1838
|
};
|
|
1837
1839
|
function getRouteChunkModuleId(filePath, chunkName) {
|
|
@@ -2420,6 +2422,9 @@ var reactRouterVitePlugin = () => {
|
|
|
2420
2422
|
let isRootRoute = route.parentId === void 0;
|
|
2421
2423
|
let hasClientAction = sourceExports.includes("clientAction");
|
|
2422
2424
|
let hasClientLoader = sourceExports.includes("clientLoader");
|
|
2425
|
+
let hasClientMiddleware = sourceExports.includes(
|
|
2426
|
+
"unstable_clientMiddleware"
|
|
2427
|
+
);
|
|
2423
2428
|
let hasHydrateFallback = sourceExports.includes("HydrateFallback");
|
|
2424
2429
|
let { hasRouteChunkByExportName } = await detectRouteChunksIfEnabled(
|
|
2425
2430
|
cache,
|
|
@@ -2434,6 +2439,7 @@ var reactRouterVitePlugin = () => {
|
|
|
2434
2439
|
valid: {
|
|
2435
2440
|
clientAction: !hasClientAction || hasRouteChunkByExportName.clientAction,
|
|
2436
2441
|
clientLoader: !hasClientLoader || hasRouteChunkByExportName.clientLoader,
|
|
2442
|
+
unstable_clientMiddleware: !hasClientMiddleware || hasRouteChunkByExportName.unstable_clientMiddleware,
|
|
2437
2443
|
HydrateFallback: !hasHydrateFallback || hasRouteChunkByExportName.HydrateFallback
|
|
2438
2444
|
}
|
|
2439
2445
|
});
|
|
@@ -2448,6 +2454,7 @@ var reactRouterVitePlugin = () => {
|
|
|
2448
2454
|
hasLoader: sourceExports.includes("loader"),
|
|
2449
2455
|
hasClientAction,
|
|
2450
2456
|
hasClientLoader,
|
|
2457
|
+
hasClientMiddleware,
|
|
2451
2458
|
hasErrorBoundary: sourceExports.includes("ErrorBoundary"),
|
|
2452
2459
|
...getReactRouterManifestBuildAssets(
|
|
2453
2460
|
ctx,
|
|
@@ -2468,6 +2475,11 @@ var reactRouterVitePlugin = () => {
|
|
|
2468
2475
|
viteManifest,
|
|
2469
2476
|
getRouteChunkModuleId(routeFile, "clientLoader")
|
|
2470
2477
|
) : void 0,
|
|
2478
|
+
clientMiddlewareModule: hasRouteChunkByExportName.unstable_clientMiddleware ? getPublicModulePathForEntry(
|
|
2479
|
+
ctx,
|
|
2480
|
+
viteManifest,
|
|
2481
|
+
getRouteChunkModuleId(routeFile, "unstable_clientMiddleware")
|
|
2482
|
+
) : void 0,
|
|
2471
2483
|
hydrateFallbackModule: hasRouteChunkByExportName.HydrateFallback ? getPublicModulePathForEntry(
|
|
2472
2484
|
ctx,
|
|
2473
2485
|
viteManifest,
|
|
@@ -2519,6 +2531,9 @@ var reactRouterVitePlugin = () => {
|
|
|
2519
2531
|
let sourceExports = routeManifestExports[key];
|
|
2520
2532
|
let hasClientAction = sourceExports.includes("clientAction");
|
|
2521
2533
|
let hasClientLoader = sourceExports.includes("clientLoader");
|
|
2534
|
+
let hasClientMiddleware = sourceExports.includes(
|
|
2535
|
+
"unstable_clientMiddleware"
|
|
2536
|
+
);
|
|
2522
2537
|
let hasHydrateFallback = sourceExports.includes("HydrateFallback");
|
|
2523
2538
|
let routeModulePath = combineURLs(
|
|
2524
2539
|
ctx.publicPath,
|
|
@@ -2540,6 +2555,7 @@ var reactRouterVitePlugin = () => {
|
|
|
2540
2555
|
valid: {
|
|
2541
2556
|
clientAction: !hasClientAction || hasRouteChunkByExportName.clientAction,
|
|
2542
2557
|
clientLoader: !hasClientLoader || hasRouteChunkByExportName.clientLoader,
|
|
2558
|
+
unstable_clientMiddleware: !hasClientMiddleware || hasRouteChunkByExportName.unstable_clientMiddleware,
|
|
2543
2559
|
HydrateFallback: !hasHydrateFallback || hasRouteChunkByExportName.HydrateFallback
|
|
2544
2560
|
}
|
|
2545
2561
|
});
|
|
@@ -2554,11 +2570,13 @@ var reactRouterVitePlugin = () => {
|
|
|
2554
2570
|
// Split route modules are a build-time optimization
|
|
2555
2571
|
clientActionModule: void 0,
|
|
2556
2572
|
clientLoaderModule: void 0,
|
|
2573
|
+
clientMiddlewareModule: void 0,
|
|
2557
2574
|
hydrateFallbackModule: void 0,
|
|
2558
2575
|
hasAction: sourceExports.includes("action"),
|
|
2559
2576
|
hasLoader: sourceExports.includes("loader"),
|
|
2560
2577
|
hasClientAction,
|
|
2561
2578
|
hasClientLoader,
|
|
2579
|
+
hasClientMiddleware,
|
|
2562
2580
|
hasErrorBoundary: sourceExports.includes("ErrorBoundary"),
|
|
2563
2581
|
imports: []
|
|
2564
2582
|
};
|
|
@@ -3191,6 +3209,9 @@ var reactRouterVitePlugin = () => {
|
|
|
3191
3209
|
valid: {
|
|
3192
3210
|
clientAction: !exportNames.includes("clientAction"),
|
|
3193
3211
|
clientLoader: !exportNames.includes("clientLoader"),
|
|
3212
|
+
unstable_clientMiddleware: !exportNames.includes(
|
|
3213
|
+
"unstable_clientMiddleware"
|
|
3214
|
+
),
|
|
3194
3215
|
HydrateFallback: !exportNames.includes("HydrateFallback")
|
|
3195
3216
|
}
|
|
3196
3217
|
});
|
|
@@ -3463,6 +3484,8 @@ var reactRouterVitePlugin = () => {
|
|
|
3463
3484
|
"hasAction",
|
|
3464
3485
|
"hasClientAction",
|
|
3465
3486
|
"clientActionModule",
|
|
3487
|
+
"hasClientMiddleware",
|
|
3488
|
+
"clientMiddlewareModule",
|
|
3466
3489
|
"hasErrorBoundary",
|
|
3467
3490
|
"hydrateFallbackModule"
|
|
3468
3491
|
].some((key) => oldRouteMetadata[key] !== newRouteMetadata[key])) {
|
|
@@ -3616,11 +3639,13 @@ async function getRouteMetadata(cache, ctx, viteChildCompiler, route, readRouteF
|
|
|
3616
3639
|
// Ensure the Vite dev server responds with a JS module
|
|
3617
3640
|
clientActionModule: hasRouteChunkByExportName.clientAction ? `${getRouteChunkModuleId(moduleUrl, "clientAction")}` : void 0,
|
|
3618
3641
|
clientLoaderModule: hasRouteChunkByExportName.clientLoader ? `${getRouteChunkModuleId(moduleUrl, "clientLoader")}` : void 0,
|
|
3642
|
+
clientMiddlewareModule: hasRouteChunkByExportName.unstable_clientMiddleware ? `${getRouteChunkModuleId(moduleUrl, "unstable_clientMiddleware")}` : void 0,
|
|
3619
3643
|
hydrateFallbackModule: hasRouteChunkByExportName.HydrateFallback ? `${getRouteChunkModuleId(moduleUrl, "HydrateFallback")}` : void 0,
|
|
3620
3644
|
hasAction: sourceExports.includes("action"),
|
|
3621
3645
|
hasClientAction: sourceExports.includes("clientAction"),
|
|
3622
3646
|
hasLoader: sourceExports.includes("loader"),
|
|
3623
3647
|
hasClientLoader: sourceExports.includes("clientLoader"),
|
|
3648
|
+
hasClientMiddleware: sourceExports.includes("unstable_clientMiddleware"),
|
|
3624
3649
|
hasErrorBoundary: sourceExports.includes("ErrorBoundary"),
|
|
3625
3650
|
imports: []
|
|
3626
3651
|
};
|
|
@@ -3809,7 +3834,7 @@ async function prerenderData(handler, prerenderPath, onlyRoutes, clientBuildDire
|
|
|
3809
3834
|
let data = await response.text();
|
|
3810
3835
|
if (response.status !== 200) {
|
|
3811
3836
|
throw new Error(
|
|
3812
|
-
`Prerender (data): Received a ${response.status} status code from \`entry.server.tsx\` while prerendering the \`${
|
|
3837
|
+
`Prerender (data): Received a ${response.status} status code from \`entry.server.tsx\` while prerendering the \`${prerenderPath}\` path.
|
|
3813
3838
|
${normalizedPath}`
|
|
3814
3839
|
);
|
|
3815
3840
|
}
|
|
@@ -4054,6 +4079,7 @@ async function detectRouteChunksIfEnabled(cache, ctx, id, input) {
|
|
|
4054
4079
|
hasRouteChunkByExportName: {
|
|
4055
4080
|
clientAction: false,
|
|
4056
4081
|
clientLoader: false,
|
|
4082
|
+
unstable_clientMiddleware: false,
|
|
4057
4083
|
HydrateFallback: false
|
|
4058
4084
|
}
|
|
4059
4085
|
};
|
|
@@ -4309,7 +4335,10 @@ async function getEnvironmentOptionsResolvers(ctx, viteCommand) {
|
|
|
4309
4335
|
output: (ctx.reactRouterConfig.future.unstable_viteEnvironmentApi ? viteUserConfig?.environments?.client?.build?.rollupOptions?.output : viteUserConfig?.build?.rollupOptions?.output) ?? {
|
|
4310
4336
|
entryFileNames: ({ moduleIds }) => {
|
|
4311
4337
|
let routeChunkModuleId = moduleIds.find(isRouteChunkModuleId);
|
|
4312
|
-
let routeChunkName = routeChunkModuleId ? getRouteChunkNameFromModuleId(routeChunkModuleId)
|
|
4338
|
+
let routeChunkName = routeChunkModuleId ? getRouteChunkNameFromModuleId(routeChunkModuleId)?.replace(
|
|
4339
|
+
"unstable_",
|
|
4340
|
+
""
|
|
4341
|
+
) : null;
|
|
4313
4342
|
let routeChunkSuffix = routeChunkName ? `-${(0, import_kebabCase.default)(routeChunkName)}` : "";
|
|
4314
4343
|
return path6.posix.join(
|
|
4315
4344
|
(ctx.reactRouterConfig.future.unstable_viteEnvironmentApi ? viteUserConfig?.environments?.client?.build?.assetsDir : viteUserConfig?.build?.assetsDir) ?? "assets",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-router/dev",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.1",
|
|
4
4
|
"description": "Dev tools and CLI for React Router",
|
|
5
5
|
"homepage": "https://reactrouter.com",
|
|
6
6
|
"bugs": {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"set-cookie-parser": "^2.6.0",
|
|
87
87
|
"valibot": "^0.41.0",
|
|
88
88
|
"vite-node": "3.0.0-beta.2",
|
|
89
|
-
"@react-router/node": "7.4.
|
|
89
|
+
"@react-router/node": "7.4.1"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@types/babel__core": "^7.20.5",
|
|
@@ -110,15 +110,15 @@
|
|
|
110
110
|
"vite": "^6.1.0",
|
|
111
111
|
"wireit": "0.14.9",
|
|
112
112
|
"wrangler": "^3.109.2",
|
|
113
|
-
"@react-router/serve": "7.4.
|
|
114
|
-
"react-router": "^7.4.
|
|
113
|
+
"@react-router/serve": "7.4.1",
|
|
114
|
+
"react-router": "^7.4.1"
|
|
115
115
|
},
|
|
116
116
|
"peerDependencies": {
|
|
117
117
|
"typescript": "^5.1.0",
|
|
118
118
|
"vite": "^5.1.0 || ^6.0.0",
|
|
119
119
|
"wrangler": "^3.28.2",
|
|
120
|
-
"@react-router/serve": "^7.4.
|
|
121
|
-
"react-router": "^7.4.
|
|
120
|
+
"@react-router/serve": "^7.4.1",
|
|
121
|
+
"react-router": "^7.4.1"
|
|
122
122
|
},
|
|
123
123
|
"peerDependenciesMeta": {
|
|
124
124
|
"@react-router/serve": {
|