@react-router/dev 7.6.1-pre.1 → 7.6.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 +15 -20
- package/dist/cli/index.js +1 -1
- package/dist/config.js +1 -1
- package/dist/routes.js +1 -1
- package/dist/vite/cloudflare.js +1 -1
- package/dist/vite.js +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
# `@react-router/dev`
|
|
2
2
|
|
|
3
|
-
## 7.6.1
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Updated dependencies:
|
|
8
|
-
- `react-router@7.6.1-pre.1`
|
|
9
|
-
- `@react-router/node@7.6.1-pre.1`
|
|
10
|
-
- `@react-router/serve@7.6.1-pre.1`
|
|
11
|
-
|
|
12
|
-
## 7.6.1-pre.0
|
|
3
|
+
## 7.6.1
|
|
13
4
|
|
|
14
5
|
### Patch Changes
|
|
15
6
|
|
|
16
7
|
- Prevent typegen with route files are outside the app directory ([#12996](https://github.com/remix-run/react-router/pull/12996))
|
|
8
|
+
|
|
17
9
|
- Fix typegen when same route is used at multiple paths ([#13574](https://github.com/remix-run/react-router/pull/13574))
|
|
18
10
|
|
|
19
11
|
For example, `routes/route.tsx` is used at 4 different paths here:
|
|
@@ -34,6 +26,7 @@
|
|
|
34
26
|
Now, typegen creates unions as necessary for alternate paths for the same route file.
|
|
35
27
|
|
|
36
28
|
- Add additional logging to `build` command output when cleaning assets from server build ([#13547](https://github.com/remix-run/react-router/pull/13547))
|
|
29
|
+
|
|
37
30
|
- Better types for `params` ([#13543](https://github.com/remix-run/react-router/pull/13543))
|
|
38
31
|
|
|
39
32
|
For example:
|
|
@@ -44,7 +37,7 @@
|
|
|
44
37
|
|
|
45
38
|
export default [
|
|
46
39
|
route("parent/:p", "routes/parent.tsx", [
|
|
47
|
-
route("
|
|
40
|
+
route("layout/:l", "routes/layout.tsx", [
|
|
48
41
|
route("child1/:c1a/:c1b", "routes/child1.tsx"),
|
|
49
42
|
route("child2/:c2a/:c2b", "routes/child2.tsx"),
|
|
50
43
|
]),
|
|
@@ -52,9 +45,9 @@
|
|
|
52
45
|
] satisfies RouteConfig;
|
|
53
46
|
```
|
|
54
47
|
|
|
55
|
-
Previously, `params` for `routes/
|
|
48
|
+
Previously, `params` for the `routes/layout.tsx` route were calculated as `{ p: string, l: string }`.
|
|
56
49
|
This incorrectly ignores params that could come from child routes.
|
|
57
|
-
If visiting `/parent/1/
|
|
50
|
+
If visiting `/parent/1/layout/2/child1/3/4`, the actual params passed to `routes/layout.tsx` will have a type of `{ p: string, l: string, c1a: string, c1b: string }`.
|
|
58
51
|
|
|
59
52
|
Now, `params` are aware of child routes and autocompletion will include child params as optionals:
|
|
60
53
|
|
|
@@ -62,21 +55,21 @@
|
|
|
62
55
|
params.|
|
|
63
56
|
// ^ cursor is here and you ask for autocompletion
|
|
64
57
|
// p: string
|
|
65
|
-
//
|
|
58
|
+
// l: string
|
|
66
59
|
// c1a?: string
|
|
67
60
|
// c1b?: string
|
|
68
61
|
// c2a?: string
|
|
69
62
|
// c2b?: string
|
|
70
63
|
```
|
|
71
64
|
|
|
72
|
-
You can also narrow the types for `params` as it is implemented as a normalized union of params for each page that includes `routes/
|
|
65
|
+
You can also narrow the types for `params` as it is implemented as a normalized union of params for each page that includes `routes/layout.tsx`:
|
|
73
66
|
|
|
74
67
|
```ts
|
|
75
68
|
if (typeof params.c1a === 'string') {
|
|
76
69
|
params.|
|
|
77
70
|
// ^ cursor is here and you ask for autocompletion
|
|
78
71
|
// p: string
|
|
79
|
-
//
|
|
72
|
+
// l: string
|
|
80
73
|
// c1a: string
|
|
81
74
|
// c1b: string
|
|
82
75
|
}
|
|
@@ -87,8 +80,10 @@
|
|
|
87
80
|
UNSTABLE: renamed internal `react-router/route-module` export to `react-router/internal`
|
|
88
81
|
UNSTABLE: removed `Info` export from generated `+types/*` files
|
|
89
82
|
|
|
90
|
-
- [UNSTABLE] Normalize dirent entry path across node versions when generating SRI manifest ([#13591](https://github.com/remix-run/react-router/pull/13591))
|
|
83
|
+
- \[UNSTABLE] Normalize dirent entry path across node versions when generating SRI manifest ([#13591](https://github.com/remix-run/react-router/pull/13591))
|
|
84
|
+
|
|
91
85
|
- Don't clean assets from server build when `build.ssrEmitAssets` has been enabled in Vite config ([#13547](https://github.com/remix-run/react-router/pull/13547))
|
|
86
|
+
|
|
92
87
|
- Fix `href` for optional segments ([#13595](https://github.com/remix-run/react-router/pull/13595))
|
|
93
88
|
|
|
94
89
|
Type generation now expands paths with optionals into their corresponding non-optional paths.
|
|
@@ -117,9 +112,9 @@
|
|
|
117
112
|
```
|
|
118
113
|
|
|
119
114
|
- Updated dependencies:
|
|
120
|
-
- `react-router@7.6.1
|
|
121
|
-
- `@react-router/node@7.6.1
|
|
122
|
-
- `@react-router/serve@7.6.1
|
|
115
|
+
- `react-router@7.6.1`
|
|
116
|
+
- `@react-router/node@7.6.1`
|
|
117
|
+
- `@react-router/serve@7.6.1`
|
|
123
118
|
|
|
124
119
|
## 7.6.0
|
|
125
120
|
|
package/dist/cli/index.js
CHANGED
package/dist/config.js
CHANGED
package/dist/routes.js
CHANGED
package/dist/vite/cloudflare.js
CHANGED
package/dist/vite.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-router/dev",
|
|
3
|
-
"version": "7.6.1
|
|
3
|
+
"version": "7.6.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.6.1
|
|
89
|
+
"@react-router/node": "7.6.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": "^4.2.0",
|
|
113
|
-
"@react-router/serve": "7.6.1
|
|
114
|
-
"react-router": "^7.6.1
|
|
113
|
+
"@react-router/serve": "7.6.1",
|
|
114
|
+
"react-router": "^7.6.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 || ^4.0.0",
|
|
120
|
-
"@react-router/serve": "^7.6.1
|
|
121
|
-
"react-router": "^7.6.1
|
|
120
|
+
"@react-router/serve": "^7.6.1",
|
|
121
|
+
"react-router": "^7.6.1"
|
|
122
122
|
},
|
|
123
123
|
"peerDependenciesMeta": {
|
|
124
124
|
"@react-router/serve": {
|