@react-router/dev 7.2.0-pre.5 → 7.2.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 CHANGED
@@ -1,45 +1,25 @@
1
1
  # `@react-router/dev`
2
2
 
3
- ## 7.2.0-pre.5
3
+ ## 7.2.0
4
4
 
5
- ### Patch Changes
6
-
7
- - Updated dependencies:
8
- - `react-router@7.2.0-pre.5`
9
- - `@react-router/node@7.2.0-pre.5`
10
- - `@react-router/serve@7.2.0-pre.5`
11
-
12
- ## 7.2.0-pre.4
13
-
14
- ### Patch Changes
15
-
16
- - Fix prerendering of binary files ([#13039](https://github.com/remix-run/react-router/pull/13039))
17
- - Updated dependencies:
18
- - `react-router@7.2.0-pre.4`
19
- - `@react-router/node@7.2.0-pre.4`
20
- - `@react-router/serve@7.2.0-pre.4`
21
-
22
- ## 7.2.0-pre.3
23
-
24
- ### Patch Changes
25
-
26
- - Updated dependencies:
27
- - `react-router@7.2.0-pre.3`
28
- - `@react-router/node@7.2.0-pre.3`
29
- - `@react-router/serve@7.2.0-pre.3`
30
-
31
- ## 7.2.0-pre.2
5
+ ### Minor Changes
32
6
 
33
- ### Patch Changes
7
+ - Generate a "SPA fallback" HTML file for scenarios where applications are prerendering the `/` route with `ssr:false` ([#12948](https://github.com/remix-run/react-router/pull/12948))
34
8
 
35
- - Updated dependencies:
36
- - `react-router@7.2.0-pre.2`
37
- - `@react-router/node@7.2.0-pre.2`
38
- - `@react-router/serve@7.2.0-pre.2`
9
+ - If you specify `ssr:false` without a `prerender` config, this is considered "SPA Mode" and the generated `index.html` file will only render down to the root route and will be able to hydrate for any valid application path
10
+ - If you specify `ssr:false` with a `prerender` config but _do not_ include the `/` path (i.e., `prerender: ['/blog/post']`), then we still generate a "SPA Mode" `index.html` file that can hydrate for any path in the application
11
+ - However, previously if you specified `ssr:false` and included the `/` path in your `prerender` config, we would prerender the `/` route into `index.html` as a non-SPA page
12
+ - The generated HTML would include the root index route which prevented hydration for any other paths
13
+ - With this change, we now generate a "SPA Mode" file in `__spa-fallback.html` that will allow you to hydrate for any non-prerendered paths
14
+ - You can serve this file from your static file server for any paths that would otherwise 404 if you only want to pre-render _some_ routes in your `ssr:false` app and serve the others as a SPA
15
+ - `npx sirv-cli build/client --single __spa-fallback.html`
39
16
 
40
- ## 7.2.0-pre.1
17
+ - Allow a `loader` in the root route in SPA mode because it can be called/server-rendered at build time ([#12948](https://github.com/remix-run/react-router/pull/12948))
41
18
 
42
- ### Minor Changes
19
+ - `Route.HydrateFallbackProps` now also receives `loaderData`
20
+ - This will be defined so long as the `HydrateFallback` is rendering while _children_ routes are loading
21
+ - This will be `undefined` if the `HydrateFallback` is rendering because the route has it's own hydrating `clientLoader`
22
+ - In SPA mode, this will allow you to render loader root data into the SPA `index.html`
43
23
 
44
24
  - New type-safe `href` utility that guarantees links point to actual paths in your app ([#13012](https://github.com/remix-run/react-router/pull/13012))
45
25
 
@@ -59,6 +39,8 @@
59
39
 
60
40
  ### Patch Changes
61
41
 
42
+ - Handle custom `envDir` in Vite config ([#12969](https://github.com/remix-run/react-router/pull/12969))
43
+
62
44
  - Fix typegen for repeated params ([#13012](https://github.com/remix-run/react-router/pull/13012))
63
45
 
64
46
  In React Router, path parameters are keyed by their name.
@@ -71,37 +53,12 @@
71
53
  To be consistent with runtime behavior, the generated types now correctly model the "last one wins" semantics of path parameters.
72
54
  So `/a/1/b/2/c/3` now generates a type like `{ id: 3 }`.
73
55
 
74
- - Fix `ArgError: unknown or unexpected option: --version` when running `react-router --version` ([#13012](https://github.com/remix-run/react-router/pull/13012))
75
- - Updated dependencies:
76
- - `react-router@7.2.0-pre.1`
77
- - `@react-router/node@7.2.0-pre.1`
78
- - `@react-router/serve@7.2.0-pre.1`
79
-
80
- ## 7.2.0-pre.0
81
-
82
- ### Minor Changes
83
-
84
- - Generate a "SPA fallback" HTML file for scenarios where applications are prerendering the `/` route with `ssr:false` ([#12948](https://github.com/remix-run/react-router/pull/12948))
85
-
86
- - If you specify `ssr:false` without a `prerender` config, this is considered "SPA Mode" and the generated `index.html` file will only render down to the root route and will be able to hydrate for any valid application path
87
- - If you specify `ssr:false` with a `prerender` config but _do not_ include the `/` path (i.e., `prerender: ['/blog/post']`), then we still generate a "SPA Mode" `index.html` file that can hydrate for any path in the application
88
- - However, previously if you specified `ssr:false` and included the `/` path in your `prerender` config, we would prerender the `/` route into `index.html` as a non-SPA page
89
- - The generated HTML would include the root index route which prevented hydration for any other paths
90
- - With this change, we now generate a "SPA Mode" file in `__spa-fallback.html` that will allow you to hydrate for any non-prerendered paths
91
- - You can serve this file from your static file server for any paths that would otherwise 404 if you only want to pre-render _some_ routes in your `ssr:false` app and serve the others as a SPA
92
- - `npx sirv-cli build/client --single __spa-fallback.html`
93
-
94
- - - Allow a `loader` in the root route in SPA mode because it can be called/server-rendered at build time ([#12948](https://github.com/remix-run/react-router/pull/12948))
95
- - `Route.HydrateFallbackProps` now also receives `loaderData`
96
- - This will be defined so long as the `HydrateFallback` is rendering while _children_ routes are loading
97
- - This will be `undefined` if the `HydrateFallback` is rendering because the route has it's own hydrating `clientLoader`
98
- - In SPA mode, this will allow you to render loader root data into the SPA `index.html`
56
+ - Fix CLI parsing to allow argumentless `npx react-router` usage ([#12925](https://github.com/remix-run/react-router/pull/12925))
99
57
 
100
- ### Patch Changes
58
+ - Fix `ArgError: unknown or unexpected option: --version` when running `react-router --version` ([#13012](https://github.com/remix-run/react-router/pull/13012))
101
59
 
102
- - Handle custom `envDir` in Vite config ([#12969](https://github.com/remix-run/react-router/pull/12969))
103
- - Fix CLI parsing to allow argumentless `npx react-router` usage ([#12925](https://github.com/remix-run/react-router/pull/12925))
104
60
  - Skip action-only resource routes when using `prerender:true` ([#13004](https://github.com/remix-run/react-router/pull/13004))
61
+
105
62
  - Enhance invalid export detection when using `ssr:false` ([#12948](https://github.com/remix-run/react-router/pull/12948))
106
63
 
107
64
  - `headers`/`action` are prohibited in all routes with `ssr:false` because there will be no runtime server on which to run them
@@ -112,17 +69,22 @@
112
69
  - Exporting a `loader` from a route that is never matched by a `prerender` path will throw a build time error because there will be no runtime server to ever run the loader
113
70
 
114
71
  - Limit prerendered resource route `.data` files to only the target route ([#13004](https://github.com/remix-run/react-router/pull/13004))
72
+
115
73
  - Add unstable support for splitting route modules in framework mode via `future.unstable_splitRouteModules` ([#11871](https://github.com/remix-run/react-router/pull/11871))
74
+
75
+ - Fix prerendering of binary files ([#13039](https://github.com/remix-run/react-router/pull/13039))
76
+
116
77
  - Add `future.unstable_viteEnvironmentApi` flag to enable experimental Vite Environment API support ([#12936](https://github.com/remix-run/react-router/pull/12936))
78
+
117
79
  - Disable Lazy Route Discovery for all `ssr:false` apps and not just "SPA Mode" because there is no runtime server to serve the search-param-configured `__manifest` requests ([#12894](https://github.com/remix-run/react-router/pull/12894))
118
80
 
119
81
  - We previously only disabled this for "SPA Mode" which is `ssr:false` and no `prerender` config but we realized it should apply to all `ssr:false` apps, including those prerendering multiple pages
120
82
  - In those `prerender` scenarios we would prerender the `/__manifest` file assuming the static file server would serve it but that makes some unneccesary assumptions about the static file server behaviors
121
83
 
122
84
  - Updated dependencies:
123
- - `react-router@7.2.0-pre.0`
124
- - `@react-router/node@7.2.0-pre.0`
125
- - `@react-router/serve@7.2.0-pre.0`
85
+ - `react-router@7.2.0`
86
+ - `@react-router/node@7.2.0`
87
+ - `@react-router/serve@7.2.0`
126
88
 
127
89
  ## 7.1.5
128
90
 
package/dist/cli/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * @react-router/dev v7.2.0-pre.5
3
+ * @react-router/dev v7.2.0
4
4
  *
5
5
  * Copyright (c) Remix Software Inc.
6
6
  *
package/dist/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v7.2.0-pre.5
2
+ * @react-router/dev v7.2.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
package/dist/routes.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v7.2.0-pre.5
2
+ * @react-router/dev v7.2.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v7.2.0-pre.5
2
+ * @react-router/dev v7.2.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
package/dist/vite.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v7.2.0-pre.5
2
+ * @react-router/dev v7.2.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -3741,20 +3741,20 @@ async function validateSsrFalsePrerenderExports(viteConfig, ctx, manifest, viteC
3741
3741
  if (exports2.includes("action")) invalidApis.push("action");
3742
3742
  if (invalidApis.length > 0) {
3743
3743
  errors.push(
3744
- `Prerender: ${invalidApis.length} invalid route export(s) in \`${route.id}\` when prerendering with \`ssr:false\`: ${invalidApis.join(", ")}. See https://reactrouter.com/how-to/pre-rendering for more information.`
3744
+ `Prerender: ${invalidApis.length} invalid route export(s) in \`${route.id}\` when pre-rendering with \`ssr:false\`: ${invalidApis.map((a) => `\`${a}\``).join(", ")}. See https://reactrouter.com/how-to/pre-rendering#invalid-exports for more information.`
3745
3745
  );
3746
3746
  }
3747
3747
  if (!prerenderedRoutes.has(routeId)) {
3748
3748
  if (exports2.includes("loader")) {
3749
3749
  errors.push(
3750
- `Prerender: 1 invalid route export in \`${route.id}\` when using \`ssr:false\` with \`prerender\` because the route is never prerendered so the loader will never be called. See https://reactrouter.com/how-to/pre-rendering for more information.`
3750
+ `Prerender: 1 invalid route export in \`${route.id}\` when pre-rendering with \`ssr:false\`: \`loader\`. See https://reactrouter.com/how-to/pre-rendering#invalid-exports for more information.`
3751
3751
  );
3752
3752
  }
3753
3753
  let parentRoute = route.parentId ? manifest.routes[route.parentId] : null;
3754
3754
  while (parentRoute && parentRoute.id !== "root") {
3755
3755
  if (parentRoute.hasLoader && !parentRoute.hasClientLoader) {
3756
3756
  errors.push(
3757
- `Prerender: 1 invalid route export in \`${parentRoute.id}\` when using \`ssr:false\` with \`prerender\`: \`loader\`. This is because the route has non-pre-rendered children paths and does not have it's own \`clientLoader\` to be used when those paths are hydrated as a SPA. You can fix this error by adding a \`clientLoader\` to the route or by pre-rendering the children paths. See https://reactrouter.com/how-to/pre-rendering for more information.`
3757
+ `Prerender: 1 invalid route export in \`${parentRoute.id}\` when pre-rendering with \`ssr:false\`: \`loader\`. See https://reactrouter.com/how-to/pre-rendering#invalid-exports for more information.`
3758
3758
  );
3759
3759
  }
3760
3760
  parentRoute = parentRoute.parentId && parentRoute.parentId !== "root" ? manifest.routes[parentRoute.parentId] : null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-router/dev",
3
- "version": "7.2.0-pre.5",
3
+ "version": "7.2.0",
4
4
  "description": "Dev tools and CLI for React Router",
5
5
  "homepage": "https://reactrouter.com",
6
6
  "bugs": {
@@ -88,7 +88,7 @@
88
88
  "set-cookie-parser": "^2.6.0",
89
89
  "valibot": "^0.41.0",
90
90
  "vite-node": "3.0.0-beta.2",
91
- "@react-router/node": "7.2.0-pre.5"
91
+ "@react-router/node": "7.2.0"
92
92
  },
93
93
  "devDependencies": {
94
94
  "@types/babel__core": "^7.20.5",
@@ -117,15 +117,15 @@
117
117
  "vite": "^6.0.0",
118
118
  "wireit": "0.14.9",
119
119
  "wrangler": "^3.28.2",
120
- "@react-router/serve": "7.2.0-pre.5",
121
- "react-router": "^7.2.0-pre.5"
120
+ "@react-router/serve": "7.2.0",
121
+ "react-router": "^7.2.0"
122
122
  },
123
123
  "peerDependencies": {
124
124
  "typescript": "^5.1.0",
125
125
  "vite": "^5.1.0 || ^6.0.0",
126
126
  "wrangler": "^3.28.2",
127
- "@react-router/serve": "^7.2.0-pre.5",
128
- "react-router": "^7.2.0-pre.5"
127
+ "@react-router/serve": "^7.2.0",
128
+ "react-router": "^7.2.0"
129
129
  },
130
130
  "peerDependenciesMeta": {
131
131
  "@react-router/serve": {