@react-router/dev 0.0.0-experimental-689d76079 → 0.0.0-experimental-34996874d
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 +21 -0
- package/dist/cli/index.js +11 -5
- package/dist/config.d.ts +12 -4
- package/dist/config.js +1 -1
- package/dist/routes.js +1 -1
- package/dist/vite/cloudflare.js +11 -5
- package/dist/vite.js +532 -436
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# `@react-router/dev`
|
|
2
2
|
|
|
3
|
+
## v7.14.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix typegen for layouts without pages ([[aabf4a1](https://github.com/remix-run/react-router/commit/aabf4a1))
|
|
8
|
+
|
|
9
|
+
Previously, typegen could produce `pages: ;` in `.react-router/types/+routes.ts` when a route corresponded to 0 pages.
|
|
10
|
+
Now, `pages: never;` is correctly generated for those cases.
|
|
11
|
+
|
|
12
|
+
### Unstable Changes
|
|
13
|
+
|
|
14
|
+
⚠️ _[Unstable features](https://reactrouter.com/community/api-development-strategy#unstable-flags) are not recommended for production use_
|
|
15
|
+
|
|
16
|
+
- For `unstable_reactRouterRSC` Vite plugin consumers, require `@vitejs/plugin-react` in user Vite config, and more reliably split route modules. ([#14965](https://github.com/remix-run/react-router/pull/14965)) ([[aabf4a1](https://github.com/remix-run/react-router/commit/aabf4a1))
|
|
17
|
+
- ⚠️ This is a breaking change if you have begun using the `unstable_reactRouterRSC` Vite plugin - please install `@vitejs/plugin-react` and add the `react` plugin to your Vite plugins array.
|
|
18
|
+
|
|
19
|
+
- Updated dependencies:
|
|
20
|
+
- [`react-router@7.14.2`](https://github.com/remix-run/react-router/releases/tag/react-router@7.14.2)
|
|
21
|
+
- [`@react-router/node@7.14.2`](https://github.com/remix-run/react-router/releases/tag/@react-router/node@7.14.2)
|
|
22
|
+
- [`@react-router/serve@7.14.2`](https://github.com/remix-run/react-router/releases/tag/@react-router/serve@7.14.2)
|
|
23
|
+
|
|
3
24
|
## v7.14.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @react-router/dev v0.0.0-experimental-
|
|
3
|
+
* @react-router/dev v0.0.0-experimental-34996874d
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) Remix Software Inc.
|
|
6
6
|
*
|
|
@@ -398,10 +398,10 @@ async function resolveConfig({
|
|
|
398
398
|
"The `prerender`/`prerender.paths` config must be a boolean, an array of string paths, or a function returning a boolean or array of string paths."
|
|
399
399
|
);
|
|
400
400
|
}
|
|
401
|
-
let isValidConcurrencyConfig = typeof prerender2 != "object" || !("
|
|
401
|
+
let isValidConcurrencyConfig = typeof prerender2 != "object" || !("concurrency" in prerender2) || typeof prerender2.concurrency === "number" && Number.isInteger(prerender2.concurrency) && prerender2.concurrency > 0;
|
|
402
402
|
if (!isValidConcurrencyConfig) {
|
|
403
403
|
return err(
|
|
404
|
-
"The `prerender.
|
|
404
|
+
"The `prerender.concurrency` config must be a positive integer if specified."
|
|
405
405
|
);
|
|
406
406
|
}
|
|
407
407
|
}
|
|
@@ -503,10 +503,14 @@ async function resolveConfig({
|
|
|
503
503
|
'The "future.unstable_viteEnvironmentApi" flag has been stabilized as "future.v8_viteEnvironmentApi"'
|
|
504
504
|
);
|
|
505
505
|
}
|
|
506
|
+
if (futureConfig?.unstable_passThroughRequests !== void 0) {
|
|
507
|
+
return err(
|
|
508
|
+
'The "future.unstable_passThroughRequests" flag has been stabilized as "future.v8_passThroughRequests"'
|
|
509
|
+
);
|
|
510
|
+
}
|
|
506
511
|
let future = {
|
|
507
512
|
unstable_optimizeDeps: userAndPresetConfigs.future?.unstable_optimizeDeps ?? false,
|
|
508
|
-
|
|
509
|
-
unstable_subResourceIntegrity: userAndPresetConfigs.future?.unstable_subResourceIntegrity ?? false,
|
|
513
|
+
v8_passThroughRequests: userAndPresetConfigs.future?.v8_passThroughRequests ?? false,
|
|
510
514
|
unstable_trailingSlashAwareDataRequests: userAndPresetConfigs.future?.unstable_trailingSlashAwareDataRequests ?? false,
|
|
511
515
|
unstable_previewServerPrerendering: userAndPresetConfigs.future?.unstable_previewServerPrerendering ?? false,
|
|
512
516
|
v8_middleware: userAndPresetConfigs.future?.v8_middleware ?? false,
|
|
@@ -514,6 +518,7 @@ async function resolveConfig({
|
|
|
514
518
|
v8_viteEnvironmentApi: (userAndPresetConfigs.future?.v8_viteEnvironmentApi || userAndPresetConfigs.future?.unstable_previewServerPrerendering) ?? false
|
|
515
519
|
};
|
|
516
520
|
let allowedActionOrigins = userAndPresetConfigs.allowedActionOrigins ?? false;
|
|
521
|
+
let subResourceIntegrity = userAndPresetConfigs.subResourceIntegrity ?? false;
|
|
517
522
|
let reactRouterConfig = deepFreeze({
|
|
518
523
|
appDirectory,
|
|
519
524
|
basename: basename3,
|
|
@@ -527,6 +532,7 @@ async function resolveConfig({
|
|
|
527
532
|
serverBundles,
|
|
528
533
|
serverModuleFormat,
|
|
529
534
|
ssr,
|
|
535
|
+
subResourceIntegrity,
|
|
530
536
|
allowedActionOrigins,
|
|
531
537
|
unstable_routeConfig: routeConfig
|
|
532
538
|
});
|
package/dist/config.d.ts
CHANGED
|
@@ -38,8 +38,7 @@ type ServerBundlesBuildManifest = BaseBuildManifest & {
|
|
|
38
38
|
type ServerModuleFormat = "esm" | "cjs";
|
|
39
39
|
interface FutureConfig {
|
|
40
40
|
unstable_optimizeDeps: boolean;
|
|
41
|
-
|
|
42
|
-
unstable_subResourceIntegrity: boolean;
|
|
41
|
+
v8_passThroughRequests: boolean;
|
|
43
42
|
unstable_trailingSlashAwareDataRequests: boolean;
|
|
44
43
|
/**
|
|
45
44
|
* Prerender with Vite Preview server
|
|
@@ -103,7 +102,7 @@ type ReactRouterConfig = {
|
|
|
103
102
|
* An array of URLs to prerender to HTML files at build time. Can also be a
|
|
104
103
|
* function returning an array to dynamically generate URLs.
|
|
105
104
|
*
|
|
106
|
-
* `
|
|
105
|
+
* `concurrency` defaults to 1, which means "no concurrency" - fully serial execution.
|
|
107
106
|
* Setting it to a value more than 1 enables concurrent prerendering.
|
|
108
107
|
* Setting it to a value higher than one can increase the speed of the build,
|
|
109
108
|
* but may consume more resources, and send more concurrent requests to the
|
|
@@ -111,7 +110,7 @@ type ReactRouterConfig = {
|
|
|
111
110
|
*/
|
|
112
111
|
prerender?: PrerenderPaths | {
|
|
113
112
|
paths: PrerenderPaths;
|
|
114
|
-
|
|
113
|
+
concurrency?: number;
|
|
115
114
|
};
|
|
116
115
|
/**
|
|
117
116
|
* An array of React Router plugin config presets to ease integration with
|
|
@@ -153,6 +152,11 @@ type ReactRouterConfig = {
|
|
|
153
152
|
* SPA without server-rendering. Default's to `true`.
|
|
154
153
|
*/
|
|
155
154
|
ssr?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Enable subresource integrity hashes on asset script tags. Defaults to
|
|
157
|
+
* `false`.
|
|
158
|
+
*/
|
|
159
|
+
subResourceIntegrity?: boolean;
|
|
156
160
|
/**
|
|
157
161
|
* An array of allowed origin hosts for action submissions to UI routes (does not apply
|
|
158
162
|
* to resource routes). Supports micromatch glob patterns (`*` to match one segment,
|
|
@@ -259,6 +263,10 @@ type ResolvedReactRouterConfig = Readonly<{
|
|
|
259
263
|
* SPA without server-rendering. Default's to `true`.
|
|
260
264
|
*/
|
|
261
265
|
ssr: boolean;
|
|
266
|
+
/**
|
|
267
|
+
* Whether to generate subresource integrity hashes for asset script tags.
|
|
268
|
+
*/
|
|
269
|
+
subResourceIntegrity: boolean;
|
|
262
270
|
/**
|
|
263
271
|
* The allowed origins for actions / mutations. Does not apply to routes
|
|
264
272
|
* without a component. micromatch glob patterns are supported.
|
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 v0.0.0-experimental-
|
|
2
|
+
* @react-router/dev v0.0.0-experimental-34996874d
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -424,10 +424,10 @@ async function resolveConfig({
|
|
|
424
424
|
"The `prerender`/`prerender.paths` config must be a boolean, an array of string paths, or a function returning a boolean or array of string paths."
|
|
425
425
|
);
|
|
426
426
|
}
|
|
427
|
-
let isValidConcurrencyConfig = typeof prerender != "object" || !("
|
|
427
|
+
let isValidConcurrencyConfig = typeof prerender != "object" || !("concurrency" in prerender) || typeof prerender.concurrency === "number" && Number.isInteger(prerender.concurrency) && prerender.concurrency > 0;
|
|
428
428
|
if (!isValidConcurrencyConfig) {
|
|
429
429
|
return err(
|
|
430
|
-
"The `prerender.
|
|
430
|
+
"The `prerender.concurrency` config must be a positive integer if specified."
|
|
431
431
|
);
|
|
432
432
|
}
|
|
433
433
|
}
|
|
@@ -529,10 +529,14 @@ async function resolveConfig({
|
|
|
529
529
|
'The "future.unstable_viteEnvironmentApi" flag has been stabilized as "future.v8_viteEnvironmentApi"'
|
|
530
530
|
);
|
|
531
531
|
}
|
|
532
|
+
if (futureConfig?.unstable_passThroughRequests !== void 0) {
|
|
533
|
+
return err(
|
|
534
|
+
'The "future.unstable_passThroughRequests" flag has been stabilized as "future.v8_passThroughRequests"'
|
|
535
|
+
);
|
|
536
|
+
}
|
|
532
537
|
let future = {
|
|
533
538
|
unstable_optimizeDeps: userAndPresetConfigs.future?.unstable_optimizeDeps ?? false,
|
|
534
|
-
|
|
535
|
-
unstable_subResourceIntegrity: userAndPresetConfigs.future?.unstable_subResourceIntegrity ?? false,
|
|
539
|
+
v8_passThroughRequests: userAndPresetConfigs.future?.v8_passThroughRequests ?? false,
|
|
536
540
|
unstable_trailingSlashAwareDataRequests: userAndPresetConfigs.future?.unstable_trailingSlashAwareDataRequests ?? false,
|
|
537
541
|
unstable_previewServerPrerendering: userAndPresetConfigs.future?.unstable_previewServerPrerendering ?? false,
|
|
538
542
|
v8_middleware: userAndPresetConfigs.future?.v8_middleware ?? false,
|
|
@@ -540,6 +544,7 @@ async function resolveConfig({
|
|
|
540
544
|
v8_viteEnvironmentApi: (userAndPresetConfigs.future?.v8_viteEnvironmentApi || userAndPresetConfigs.future?.unstable_previewServerPrerendering) ?? false
|
|
541
545
|
};
|
|
542
546
|
let allowedActionOrigins = userAndPresetConfigs.allowedActionOrigins ?? false;
|
|
547
|
+
let subResourceIntegrity = userAndPresetConfigs.subResourceIntegrity ?? false;
|
|
543
548
|
let reactRouterConfig = deepFreeze({
|
|
544
549
|
appDirectory,
|
|
545
550
|
basename,
|
|
@@ -553,6 +558,7 @@ async function resolveConfig({
|
|
|
553
558
|
serverBundles,
|
|
554
559
|
serverModuleFormat,
|
|
555
560
|
ssr,
|
|
561
|
+
subResourceIntegrity,
|
|
556
562
|
allowedActionOrigins,
|
|
557
563
|
unstable_routeConfig: routeConfig
|
|
558
564
|
});
|