react-router 7.0.0-pre.6 → 7.0.1-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 +73 -193
- package/README.md +6 -2
- package/dist/development/{chunk-CQOJUIYR.mjs → chunk-MFVUHSGM.mjs} +3 -3
- package/dist/development/dom-export.js +2 -2
- package/dist/development/dom-export.mjs +2 -2
- package/dist/development/index.js +3 -3
- package/dist/development/index.mjs +2 -2
- package/dist/development/lib/types/route-module.d.mts +8 -1
- package/dist/development/lib/types/route-module.d.ts +8 -1
- package/dist/development/lib/types/route-module.js +1 -1
- package/dist/development/lib/types/route-module.mjs +1 -1
- package/dist/production/{chunk-X537FOHI.mjs → chunk-U7UKN772.mjs} +3 -3
- package/dist/production/dom-export.js +2 -2
- package/dist/production/dom-export.mjs +2 -2
- package/dist/production/index.js +3 -3
- package/dist/production/index.mjs +2 -2
- package/dist/production/lib/types/route-module.d.mts +8 -1
- package/dist/production/lib/types/route-module.d.ts +8 -1
- package/dist/production/lib/types/route-module.js +1 -1
- package/dist/production/lib/types/route-module.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,69 +1,8 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
-
## 7.0.
|
|
3
|
+
## 7.0.1-pre.0
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- chore: re-enable development warnings through a `development` exports condition. ([#12269](https://github.com/remix-run/react-router/pull/12269))
|
|
8
|
-
- Remove unneeded dependency on @web3-storage/multipart-parser ([#12274](https://github.com/remix-run/react-router/pull/12274))
|
|
9
|
-
- fix(react-router): (v7) fix static prerender of non-ascii characters ([#12161](https://github.com/remix-run/react-router/pull/12161))
|
|
10
|
-
- Remove unneeded dependency on source-map ([#12275](https://github.com/remix-run/react-router/pull/12275))
|
|
11
|
-
|
|
12
|
-
## 7.0.0-pre.5
|
|
13
|
-
|
|
14
|
-
## 7.0.0-pre.4
|
|
15
|
-
|
|
16
|
-
## 7.0.0-pre.3
|
|
17
|
-
|
|
18
|
-
## 7.0.0-pre.2
|
|
19
|
-
|
|
20
|
-
### Major Changes
|
|
21
|
-
|
|
22
|
-
- Migrate Remix type generics to React Router ([#12180](https://github.com/remix-run/react-router/pull/12180))
|
|
23
|
-
|
|
24
|
-
- These generics are provided for Remix v2 migration purposes
|
|
25
|
-
- These generics and the APIs they exist on should be considered informally deprecated in favor of the new `Route.*` types
|
|
26
|
-
- Anyone migrating from React Router v6 should probably not leverage these new generics and should migrate straight to the `Route.*` types
|
|
27
|
-
- For React Router v6 users, these generics are new and should not impact your app, with one exception
|
|
28
|
-
- `useFetcher` previously had an optional generic (used primarily by Remix v2) that expected the data type
|
|
29
|
-
- This has been updated in v7 to expect the type of the function that generates the data (i.e., `typeof loader`/`typeof action`)
|
|
30
|
-
- Therefore, you should update your usages:
|
|
31
|
-
- ❌ `useFetcher<LoaderData>()`
|
|
32
|
-
- ✅ `useFetcher<typeof loader>()`
|
|
33
|
-
|
|
34
|
-
- - Consolidate types previously duplicated across `@remix-run/router`, `@remix-run/server-runtime`, and `@remix-run/react` now that they all live in `react-router` ([#12177](https://github.com/remix-run/react-router/pull/12177))
|
|
35
|
-
- Examples: `LoaderFunction`, `LoaderFunctionArgs`, `ActionFunction`, `ActionFunctionArgs`, `DataFunctionArgs`, `RouteManifest`, `LinksFunction`, `Route`, `EntryRoute`
|
|
36
|
-
- The `RouteManifest` type used by the "remix" code is now slightly stricter because it is using the former `@remix-run/router` `RouteManifest`
|
|
37
|
-
- `Record<string, Route> -> Record<string, Route | undefined>`
|
|
38
|
-
- Removed `AppData` type in favor of inlining `unknown` in the few locations it was used
|
|
39
|
-
- Removed `ServerRuntimeMeta*` types in favor of the `Meta*` types they were duplicated from
|
|
40
|
-
- Drop support for Node 18, update minimum Node vestion to 20 ([#12171](https://github.com/remix-run/react-router/pull/12171))
|
|
41
|
-
|
|
42
|
-
- Remove `installGlobals()` as this should no longer be necessary
|
|
43
|
-
|
|
44
|
-
- Update `cookie` dependency to `^1.0.1` - please see the [release notes](https://github.com/jshttp/cookie/releases) for any breaking changes ([#12172](https://github.com/remix-run/react-router/pull/12172))
|
|
45
|
-
|
|
46
|
-
### Patch Changes
|
|
47
|
-
|
|
48
|
-
- Replace `substr` with `substring` ([#12080](https://github.com/remix-run/react-router/pull/12080))
|
|
49
|
-
- Remove the deprecated `json` utility ([#12146](https://github.com/remix-run/react-router/pull/12146))
|
|
50
|
-
|
|
51
|
-
- You can use [`Response.json`](https://developer.mozilla.org/en-US/docs/Web/API/Response/json_static) if you still need to construct JSON responses in your app
|
|
52
|
-
|
|
53
|
-
- Updated dependencies:
|
|
54
|
-
- `react-router@7.0.0-pre.2`
|
|
55
|
-
|
|
56
|
-
## 7.0.0-pre.1
|
|
57
|
-
|
|
58
|
-
### Patch Changes
|
|
59
|
-
|
|
60
|
-
- Fix typegen for routes with a client loader but no server loader ([#12117](https://github.com/remix-run/react-router/pull/12117))
|
|
61
|
-
- - Fix `react-router-serve` handling of prerendered HTML files by removing the `redirect: false` option so it now falls back on the default `redirect: true` behavior of redirecting from `/folder` -> `/folder/` which will then pick up `/folder/index.html` from disk. See https://expressjs.com/en/resources/middleware/serve-static.html ([#12071](https://github.com/remix-run/react-router/pull/12071))
|
|
62
|
-
- Proxy prerendered loader data into prerender pass for HTML files to avoid double-invocations of the loader at build time
|
|
63
|
-
- Updated dependencies:
|
|
64
|
-
- `react-router@7.0.0-pre.1`
|
|
65
|
-
|
|
66
|
-
## 7.0.0-pre.0
|
|
5
|
+
## 7.0.0
|
|
67
6
|
|
|
68
7
|
### Major Changes
|
|
69
8
|
|
|
@@ -79,16 +18,22 @@
|
|
|
79
18
|
- Collapse `react-router-dom` into `react-router`
|
|
80
19
|
- Collapse `@remix-run/server-runtime` into `react-router`
|
|
81
20
|
- Collapse `@remix-run/testing` into `react-router`
|
|
21
|
+
|
|
82
22
|
- Remove single_fetch future flag. ([#11522](https://github.com/remix-run/react-router/pull/11522))
|
|
23
|
+
|
|
83
24
|
- Drop support for Node 16, React Router SSR now requires Node 18 or higher ([#11391](https://github.com/remix-run/react-router/pull/11391))
|
|
25
|
+
|
|
84
26
|
- Remove `future.v7_startTransition` flag ([#11696](https://github.com/remix-run/react-router/pull/11696))
|
|
27
|
+
|
|
85
28
|
- - Expose the underlying router promises from the following APIs for compsition in React 19 APIs: ([#11521](https://github.com/remix-run/react-router/pull/11521))
|
|
86
29
|
- `useNavigate()`
|
|
87
30
|
- `useSubmit`
|
|
88
31
|
- `useFetcher().load`
|
|
89
32
|
- `useFetcher().submit`
|
|
90
33
|
- `useRevalidator.revalidate`
|
|
34
|
+
|
|
91
35
|
- Remove `future.v7_normalizeFormMethod` future flag ([#11697](https://github.com/remix-run/react-router/pull/11697))
|
|
36
|
+
|
|
92
37
|
- For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837))
|
|
93
38
|
|
|
94
39
|
- `createCookie`
|
|
@@ -139,27 +84,62 @@
|
|
|
139
84
|
- `Search`
|
|
140
85
|
|
|
141
86
|
- update minimum node version to 18 ([#11690](https://github.com/remix-run/react-router/pull/11690))
|
|
87
|
+
|
|
142
88
|
- Remove `future.v7_prependBasename` from the ionternalized `@remix-run/router` package ([#11726](https://github.com/remix-run/react-router/pull/11726))
|
|
89
|
+
|
|
90
|
+
- Migrate Remix type generics to React Router ([#12180](https://github.com/remix-run/react-router/pull/12180))
|
|
91
|
+
|
|
92
|
+
- These generics are provided for Remix v2 migration purposes
|
|
93
|
+
- These generics and the APIs they exist on should be considered informally deprecated in favor of the new `Route.*` types
|
|
94
|
+
- Anyone migrating from React Router v6 should probably not leverage these new generics and should migrate straight to the `Route.*` types
|
|
95
|
+
- For React Router v6 users, these generics are new and should not impact your app, with one exception
|
|
96
|
+
- `useFetcher` previously had an optional generic (used primarily by Remix v2) that expected the data type
|
|
97
|
+
- This has been updated in v7 to expect the type of the function that generates the data (i.e., `typeof loader`/`typeof action`)
|
|
98
|
+
- Therefore, you should update your usages:
|
|
99
|
+
- ❌ `useFetcher<LoaderData>()`
|
|
100
|
+
- ✅ `useFetcher<typeof loader>()`
|
|
101
|
+
|
|
143
102
|
- Remove `future.v7_throwAbortReason` from internalized `@remix-run/router` package ([#11728](https://github.com/remix-run/react-router/pull/11728))
|
|
103
|
+
|
|
144
104
|
- Add `exports` field to all packages ([#11675](https://github.com/remix-run/react-router/pull/11675))
|
|
105
|
+
|
|
145
106
|
- node package no longer re-exports from react-router ([#11702](https://github.com/remix-run/react-router/pull/11702))
|
|
107
|
+
|
|
146
108
|
- renamed RemixContext to FrameworkContext ([#11705](https://github.com/remix-run/react-router/pull/11705))
|
|
109
|
+
|
|
147
110
|
- updates the minimum React version to 18 ([#11689](https://github.com/remix-run/react-router/pull/11689))
|
|
111
|
+
|
|
148
112
|
- PrefetchPageDescriptor replaced by PageLinkDescriptor ([#11960](https://github.com/remix-run/react-router/pull/11960))
|
|
113
|
+
|
|
114
|
+
- - Consolidate types previously duplicated across `@remix-run/router`, `@remix-run/server-runtime`, and `@remix-run/react` now that they all live in `react-router` ([#12177](https://github.com/remix-run/react-router/pull/12177))
|
|
115
|
+
- Examples: `LoaderFunction`, `LoaderFunctionArgs`, `ActionFunction`, `ActionFunctionArgs`, `DataFunctionArgs`, `RouteManifest`, `LinksFunction`, `Route`, `EntryRoute`
|
|
116
|
+
- The `RouteManifest` type used by the "remix" code is now slightly stricter because it is using the former `@remix-run/router` `RouteManifest`
|
|
117
|
+
- `Record<string, Route> -> Record<string, Route | undefined>`
|
|
118
|
+
- Removed `AppData` type in favor of inlining `unknown` in the few locations it was used
|
|
119
|
+
- Removed `ServerRuntimeMeta*` types in favor of the `Meta*` types they were duplicated from
|
|
120
|
+
|
|
149
121
|
- - Remove the `future.v7_partialHydration` flag ([#11725](https://github.com/remix-run/react-router/pull/11725))
|
|
150
122
|
- This also removes the `<RouterProvider fallbackElement>` prop
|
|
151
123
|
- To migrate, move the `fallbackElement` to a `hydrateFallbackElement`/`HydrateFallback` on your root route
|
|
152
124
|
- Also worth nothing there is a related breaking changer with this future flag:
|
|
153
125
|
- Without `future.v7_partialHydration` (when using `fallbackElement`), `state.navigation` was populated during the initial load
|
|
154
126
|
- With `future.v7_partialHydration`, `state.navigation` remains in an `"idle"` state during the initial load
|
|
127
|
+
|
|
155
128
|
- Remove `v7_relativeSplatPath` future flag ([#11695](https://github.com/remix-run/react-router/pull/11695))
|
|
129
|
+
|
|
130
|
+
- Drop support for Node 18, update minimum Node vestion to 20 ([#12171](https://github.com/remix-run/react-router/pull/12171))
|
|
131
|
+
|
|
132
|
+
- Remove `installGlobals()` as this should no longer be necessary
|
|
133
|
+
|
|
156
134
|
- Remove remaining future flags ([#11820](https://github.com/remix-run/react-router/pull/11820))
|
|
157
135
|
|
|
158
136
|
- React Router `v7_skipActionErrorRevalidation`
|
|
159
137
|
- Remix `v3_fetcherPersist`, `v3_relativeSplatPath`, `v3_throwAbortReason`
|
|
160
138
|
|
|
161
139
|
- rename createRemixStub to createRoutesStub ([#11692](https://github.com/remix-run/react-router/pull/11692))
|
|
140
|
+
|
|
162
141
|
- Remove `@remix-run/router` deprecated `detectErrorBoundary` option in favor of `mapRouteProperties` ([#11751](https://github.com/remix-run/react-router/pull/11751))
|
|
142
|
+
|
|
163
143
|
- Add `react-router/dom` subpath export to properly enable `react-dom` as an optional `peerDependency` ([#11851](https://github.com/remix-run/react-router/pull/11851))
|
|
164
144
|
|
|
165
145
|
- This ensures that we don't blindly `import ReactDOM from "react-dom"` in `<RouterProvider>` in order to access `ReactDOM.flushSync()`, since that would break `createMemoryRouter` use cases in non-DOM environments
|
|
@@ -171,6 +151,8 @@
|
|
|
171
151
|
|
|
172
152
|
- Remove `future.v7_fetcherPersist` flag ([#11731](https://github.com/remix-run/react-router/pull/11731))
|
|
173
153
|
|
|
154
|
+
- Update `cookie` dependency to `^1.0.1` - please see the [release notes](https://github.com/jshttp/cookie/releases) for any breaking changes ([#12172](https://github.com/remix-run/react-router/pull/12172))
|
|
155
|
+
|
|
174
156
|
### Minor Changes
|
|
175
157
|
|
|
176
158
|
- - Add support for `prerender` config in the React Router vite plugin, to support existing SSG use-cases ([#11539](https://github.com/remix-run/react-router/pull/11539))
|
|
@@ -178,19 +160,17 @@
|
|
|
178
160
|
- `prerender` can either be an array of string paths, or a function (sync or async) that returns an array of strings so that you can dynamically generate the paths by talking to your CMS, etc.
|
|
179
161
|
|
|
180
162
|
```ts
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
],
|
|
193
|
-
});
|
|
163
|
+
// react-router.config.ts
|
|
164
|
+
import type { Config } from "@react-router/dev/config";
|
|
165
|
+
|
|
166
|
+
export default {
|
|
167
|
+
async prerender() {
|
|
168
|
+
let slugs = await fakeGetSlugsFromCms();
|
|
169
|
+
// Prerender these paths into `.html` files at build time, and `.data`
|
|
170
|
+
// files if they have loaders
|
|
171
|
+
return ["/", "/about", ...slugs.map((slug) => `/product/${slug}`)];
|
|
172
|
+
},
|
|
173
|
+
} satisfies Config;
|
|
194
174
|
|
|
195
175
|
async function fakeGetSlugsFromCms() {
|
|
196
176
|
await new Promise((r) => setTimeout(r, 1000));
|
|
@@ -198,10 +178,6 @@
|
|
|
198
178
|
}
|
|
199
179
|
```
|
|
200
180
|
|
|
201
|
-
- [REMOVE] Allow returning undefined from loaders/actions part 2 ([#12057](https://github.com/remix-run/react-router/pull/12057))
|
|
202
|
-
|
|
203
|
-
- This is a follow up to #11680 which missed some of the Remix codepaths
|
|
204
|
-
|
|
205
181
|
- Params, loader data, and action data as props for route component exports ([#11961](https://github.com/remix-run/react-router/pull/11961))
|
|
206
182
|
|
|
207
183
|
```tsx
|
|
@@ -212,6 +188,7 @@
|
|
|
212
188
|
```
|
|
213
189
|
|
|
214
190
|
- Remove duplicate `RouterProvider` impliementations ([#11679](https://github.com/remix-run/react-router/pull/11679))
|
|
191
|
+
|
|
215
192
|
- ### Typesafety improvements ([#12019](https://github.com/remix-run/react-router/pull/12019))
|
|
216
193
|
|
|
217
194
|
React Router now generates types for each of your route modules.
|
|
@@ -233,16 +210,6 @@
|
|
|
233
210
|
- `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
|
|
234
211
|
- `ActionData` : Action data from `action` and/or `clientAction` within your route module
|
|
235
212
|
|
|
236
|
-
These types are then used to create types for route export args and props:
|
|
237
|
-
|
|
238
|
-
- `LoaderArgs`
|
|
239
|
-
- `ClientLoaderArgs`
|
|
240
|
-
- `ActionArgs`
|
|
241
|
-
- `ClientActionArgs`
|
|
242
|
-
- `HydrateFallbackProps`
|
|
243
|
-
- `ComponentProps` (for the `default` export)
|
|
244
|
-
- `ErrorBoundaryProps`
|
|
245
|
-
|
|
246
213
|
In the future, we plan to add types for the rest of the route module exports: `meta`, `links`, `headers`, `shouldRevalidate`, etc.
|
|
247
214
|
We also plan to generate types for typesafe `Link`s:
|
|
248
215
|
|
|
@@ -252,123 +219,36 @@
|
|
|
252
219
|
// typesafe `to` and `params` based on the available routes in your app
|
|
253
220
|
```
|
|
254
221
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
React Router will generate types into a `.react-router/` directory at the root of your app.
|
|
258
|
-
This directory is fully managed by React Router and is derived based on your route config (`routes.ts`).
|
|
259
|
-
|
|
260
|
-
👉 **Add `.react-router/` to `.gitignore`**
|
|
261
|
-
|
|
262
|
-
```txt
|
|
263
|
-
.react-router
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
You should also ensure that generated types for routes are always present before running typechecking,
|
|
267
|
-
especially for running typechecking in CI.
|
|
268
|
-
|
|
269
|
-
👉 **Add `react-router typegen` to your `typecheck` command in `package.json`**
|
|
270
|
-
|
|
271
|
-
```json
|
|
272
|
-
{
|
|
273
|
-
"scripts": {
|
|
274
|
-
"typecheck": "react-router typegen && tsc"
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
To get TypeScript to use those generated types, you'll need to add them to `include` in `tsconfig.json`.
|
|
280
|
-
And to be able to import them as if they files next to your route modules, you'll also need to configure `rootDirs`.
|
|
222
|
+
Check out our docs for more:
|
|
281
223
|
|
|
282
|
-
|
|
224
|
+
- [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
|
|
225
|
+
- [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
|
|
283
226
|
|
|
284
|
-
|
|
285
|
-
{
|
|
286
|
-
"include": [".react-router/types/**/*"],
|
|
287
|
-
"compilerOptions": {
|
|
288
|
-
"rootDirs": [".", "./.react-router/types"]
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
#### `typegen` command
|
|
294
|
-
|
|
295
|
-
You can manually generate types with the new `typegen` command:
|
|
296
|
-
|
|
297
|
-
```sh
|
|
298
|
-
react-router typegen
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
However, manual type generation is tedious and types can get out of sync quickly if you ever forget to run `typegen`.
|
|
302
|
-
Instead, we recommend that you setup our new TypeScript plugin which will automatically generate fresh types whenever routes change.
|
|
303
|
-
That way, you'll always have up-to-date types.
|
|
304
|
-
|
|
305
|
-
#### TypeScript plugin
|
|
306
|
-
|
|
307
|
-
To get automatic type generation, you can use our new TypeScript plugin.
|
|
308
|
-
|
|
309
|
-
👉 **Add the TypeScript plugin to `tsconfig.json`**
|
|
310
|
-
|
|
311
|
-
```json
|
|
312
|
-
{
|
|
313
|
-
"compilerOptions": {
|
|
314
|
-
"plugins": [{ "name": "@react-router/dev" }]
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
We plan to add some other goodies to our TypeScript plugin soon, including:
|
|
320
|
-
|
|
321
|
-
- Automatic `jsdoc` for route exports that include links to official docs
|
|
322
|
-
- Autocomplete for route exports
|
|
323
|
-
- Warnings for non-HMR compliant exports
|
|
324
|
-
|
|
325
|
-
##### VSCode
|
|
326
|
-
|
|
327
|
-
TypeScript looks for plugins registered in `tsconfig.json` in the local `node_modules/`,
|
|
328
|
-
but VSCode ships with its own copy of TypeScript that is installed outside of your project.
|
|
329
|
-
For TypeScript plugins to work, you'll need to tell VSCode to use the local workspace version of TypeScript.
|
|
330
|
-
For security reasons, [VSCode won't use the workspace version of TypeScript](https://code.visualstudio.com/docs/typescript/typescript-compiling#_using-the-workspace-version-of-typescript) until you manually opt-in.
|
|
227
|
+
- Stabilize `unstable_dataStrategy` ([#11969](https://github.com/remix-run/react-router/pull/11969))
|
|
331
228
|
|
|
332
|
-
|
|
229
|
+
- Stabilize `unstable_patchRoutesOnNavigation` ([#11970](https://github.com/remix-run/react-router/pull/11970))
|
|
333
230
|
|
|
334
|
-
|
|
335
|
-
{
|
|
336
|
-
"typescript.tsdk": "node_modules/typescript/lib",
|
|
337
|
-
"typescript.enablePromptUseWorkspaceTsdk": true
|
|
338
|
-
}
|
|
339
|
-
```
|
|
231
|
+
### Patch Changes
|
|
340
232
|
|
|
341
|
-
|
|
233
|
+
- No changes ([`506329c4e`](https://github.com/remix-run/react-router/commit/506329c4e2e7aba9837cbfa44df6103b49423745))
|
|
342
234
|
|
|
343
|
-
|
|
344
|
-
> You'll need to install dependencies first so that the workspace version of TypeScript is available.
|
|
235
|
+
- chore: re-enable development warnings through a `development` exports condition. ([#12269](https://github.com/remix-run/react-router/pull/12269))
|
|
345
236
|
|
|
346
|
-
|
|
237
|
+
- Remove unstable upload handler. ([#12015](https://github.com/remix-run/react-router/pull/12015))
|
|
347
238
|
|
|
348
|
-
|
|
239
|
+
- Remove unneeded dependency on @web3-storage/multipart-parser ([#12274](https://github.com/remix-run/react-router/pull/12274))
|
|
349
240
|
|
|
350
|
-
|
|
351
|
-
2. Open up the VSCode Command Palette (<kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>)
|
|
352
|
-
3. Search for `Select TypeScript Version`
|
|
353
|
-
4. Choose `Use Workspace Version`
|
|
354
|
-
5. Quit and reopen VSCode
|
|
241
|
+
- Fix redirects returned from loaders/actions using `data()` ([#12021](https://github.com/remix-run/react-router/pull/12021))
|
|
355
242
|
|
|
356
|
-
|
|
243
|
+
- fix(react-router): (v7) fix static prerender of non-ascii characters ([#12161](https://github.com/remix-run/react-router/pull/12161))
|
|
357
244
|
|
|
358
|
-
|
|
359
|
-
There should be a log for `[react-router] setup` that indicates that the plugin was resolved correctly.
|
|
360
|
-
Then look for any errors in the log.
|
|
245
|
+
- Replace `substr` with `substring` ([#12080](https://github.com/remix-run/react-router/pull/12080))
|
|
361
246
|
|
|
362
|
-
-
|
|
363
|
-
- Stabilize `unstable_patchRoutesOnNavigation` ([#11970](https://github.com/remix-run/react-router/pull/11970))
|
|
247
|
+
- Remove the deprecated `json` utility ([#12146](https://github.com/remix-run/react-router/pull/12146))
|
|
364
248
|
|
|
365
|
-
|
|
249
|
+
- You can use [`Response.json`](https://developer.mozilla.org/en-US/docs/Web/API/Response/json_static) if you still need to construct JSON responses in your app
|
|
366
250
|
|
|
367
|
-
- Remove
|
|
368
|
-
- Fix redirects returned from loaders/actions using `data()` ([#12021](https://github.com/remix-run/react-router/pull/12021))
|
|
369
|
-
- [REMOVE] Rename RemixRouter->DataRouter ([#12062](https://github.com/remix-run/react-router/pull/12062))
|
|
370
|
-
- Updated dependencies:
|
|
371
|
-
- `react-router@7.0.0-pre.0`
|
|
251
|
+
- Remove unneeded dependency on source-map ([#12275](https://github.com/remix-run/react-router/pull/12275))
|
|
372
252
|
|
|
373
253
|
## 6.28.0
|
|
374
254
|
|
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
`react-router` is the primary package in the React Router project.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm i react-router
|
|
7
|
+
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.0.
|
|
2
|
+
* react-router v7.0.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -4214,7 +4214,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
|
|
|
4214
4214
|
let parentPath = parentRoute && parentRoute.path || "";
|
|
4215
4215
|
warningOnce(
|
|
4216
4216
|
parentPathname,
|
|
4217
|
-
!parentRoute || parentPath.endsWith("*"),
|
|
4217
|
+
!parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"),
|
|
4218
4218
|
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${parentPathname}" (under <Route path="${parentPath}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
4219
4219
|
|
|
4220
4220
|
Please change the parent <Route path="${parentPath}"> to <Route path="${parentPath === "/" ? "*" : `${parentPath}/*`}">.`
|
|
@@ -6980,7 +6980,7 @@ function mergeRefs(...refs) {
|
|
|
6980
6980
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
6981
6981
|
try {
|
|
6982
6982
|
if (isBrowser) {
|
|
6983
|
-
window.__reactRouterVersion = "7.0.
|
|
6983
|
+
window.__reactRouterVersion = "7.0.1-pre.0";
|
|
6984
6984
|
}
|
|
6985
6985
|
} catch (e) {
|
|
6986
6986
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.0.
|
|
2
|
+
* react-router v7.0.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -3558,7 +3558,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
|
|
|
3558
3558
|
let parentPath = parentRoute && parentRoute.path || "";
|
|
3559
3559
|
warningOnce(
|
|
3560
3560
|
parentPathname,
|
|
3561
|
-
!parentRoute || parentPath.endsWith("*"),
|
|
3561
|
+
!parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"),
|
|
3562
3562
|
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${parentPathname}" (under <Route path="${parentPath}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
3563
3563
|
|
|
3564
3564
|
Please change the parent <Route path="${parentPath}"> to <Route path="${parentPath === "/" ? "*" : `${parentPath}/*`}">.`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.0.
|
|
2
|
+
* react-router v7.0.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
matchRoutes,
|
|
26
26
|
shouldHydrateRouteLoader,
|
|
27
27
|
useFogOFWarDiscovery
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-MFVUHSGM.mjs";
|
|
29
29
|
|
|
30
30
|
// lib/dom-export/dom-router-provider.tsx
|
|
31
31
|
import * as React from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.0.
|
|
2
|
+
* react-router v7.0.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -4359,7 +4359,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
|
|
|
4359
4359
|
let parentPath = parentRoute && parentRoute.path || "";
|
|
4360
4360
|
warningOnce(
|
|
4361
4361
|
parentPathname,
|
|
4362
|
-
!parentRoute || parentPath.endsWith("*"),
|
|
4362
|
+
!parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"),
|
|
4363
4363
|
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${parentPathname}" (under <Route path="${parentPath}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
4364
4364
|
|
|
4365
4365
|
Please change the parent <Route path="${parentPath}"> to <Route path="${parentPath === "/" ? "*" : `${parentPath}/*`}">.`
|
|
@@ -7125,7 +7125,7 @@ function mergeRefs(...refs) {
|
|
|
7125
7125
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
7126
7126
|
try {
|
|
7127
7127
|
if (isBrowser) {
|
|
7128
|
-
window.__reactRouterVersion = "7.0.
|
|
7128
|
+
window.__reactRouterVersion = "7.0.1-pre.0";
|
|
7129
7129
|
}
|
|
7130
7130
|
} catch (e) {
|
|
7131
7131
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.0.
|
|
2
|
+
* react-router v7.0.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
useSearchParams,
|
|
120
120
|
useSubmit,
|
|
121
121
|
useViewTransitionState
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-MFVUHSGM.mjs";
|
|
123
123
|
export {
|
|
124
124
|
Await,
|
|
125
125
|
BrowserRouter,
|
|
@@ -6,6 +6,7 @@ type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
|
|
|
6
6
|
type RouteModule = {
|
|
7
7
|
meta?: Func;
|
|
8
8
|
links?: Func;
|
|
9
|
+
headers?: Func;
|
|
9
10
|
loader?: Func;
|
|
10
11
|
clientLoader?: Func;
|
|
11
12
|
action?: Func;
|
|
@@ -42,6 +43,12 @@ type CreateMetaArgs<T extends RouteInfo> = {
|
|
|
42
43
|
matches: MetaMatches<T["parents"]>;
|
|
43
44
|
};
|
|
44
45
|
type MetaDescriptors = MetaDescriptor[];
|
|
46
|
+
type HeadersArgs = {
|
|
47
|
+
loaderHeaders: Headers;
|
|
48
|
+
parentHeaders: Headers;
|
|
49
|
+
actionHeaders: Headers;
|
|
50
|
+
errorHeaders: Headers | undefined;
|
|
51
|
+
};
|
|
45
52
|
type IsHydrate<ClientLoader> = ClientLoader extends {
|
|
46
53
|
hydrate: true;
|
|
47
54
|
} ? true : ClientLoader extends {
|
|
@@ -99,4 +106,4 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = {
|
|
|
99
106
|
actionData?: T["actionData"];
|
|
100
107
|
};
|
|
101
108
|
|
|
102
|
-
export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, LinkDescriptors, MetaDescriptors };
|
|
109
|
+
export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, HeadersArgs, LinkDescriptors, MetaDescriptors };
|
|
@@ -6,6 +6,7 @@ type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
|
|
|
6
6
|
type RouteModule = {
|
|
7
7
|
meta?: Func;
|
|
8
8
|
links?: Func;
|
|
9
|
+
headers?: Func;
|
|
9
10
|
loader?: Func;
|
|
10
11
|
clientLoader?: Func;
|
|
11
12
|
action?: Func;
|
|
@@ -42,6 +43,12 @@ type CreateMetaArgs<T extends RouteInfo> = {
|
|
|
42
43
|
matches: MetaMatches<T["parents"]>;
|
|
43
44
|
};
|
|
44
45
|
type MetaDescriptors = MetaDescriptor[];
|
|
46
|
+
type HeadersArgs = {
|
|
47
|
+
loaderHeaders: Headers;
|
|
48
|
+
parentHeaders: Headers;
|
|
49
|
+
actionHeaders: Headers;
|
|
50
|
+
errorHeaders: Headers | undefined;
|
|
51
|
+
};
|
|
45
52
|
type IsHydrate<ClientLoader> = ClientLoader extends {
|
|
46
53
|
hydrate: true;
|
|
47
54
|
} ? true : ClientLoader extends {
|
|
@@ -99,4 +106,4 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = {
|
|
|
99
106
|
actionData?: T["actionData"];
|
|
100
107
|
};
|
|
101
108
|
|
|
102
|
-
export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, LinkDescriptors, MetaDescriptors };
|
|
109
|
+
export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, HeadersArgs, LinkDescriptors, MetaDescriptors };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.0.
|
|
2
|
+
* react-router v7.0.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -4214,7 +4214,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
|
|
|
4214
4214
|
let parentPath = parentRoute && parentRoute.path || "";
|
|
4215
4215
|
warningOnce(
|
|
4216
4216
|
parentPathname,
|
|
4217
|
-
!parentRoute || parentPath.endsWith("*"),
|
|
4217
|
+
!parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"),
|
|
4218
4218
|
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${parentPathname}" (under <Route path="${parentPath}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
4219
4219
|
|
|
4220
4220
|
Please change the parent <Route path="${parentPath}"> to <Route path="${parentPath === "/" ? "*" : `${parentPath}/*`}">.`
|
|
@@ -6980,7 +6980,7 @@ function mergeRefs(...refs) {
|
|
|
6980
6980
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
6981
6981
|
try {
|
|
6982
6982
|
if (isBrowser) {
|
|
6983
|
-
window.__reactRouterVersion = "7.0.
|
|
6983
|
+
window.__reactRouterVersion = "7.0.1-pre.0";
|
|
6984
6984
|
}
|
|
6985
6985
|
} catch (e) {
|
|
6986
6986
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.0.
|
|
2
|
+
* react-router v7.0.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -3558,7 +3558,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
|
|
|
3558
3558
|
let parentPath = parentRoute && parentRoute.path || "";
|
|
3559
3559
|
warningOnce(
|
|
3560
3560
|
parentPathname,
|
|
3561
|
-
!parentRoute || parentPath.endsWith("*"),
|
|
3561
|
+
!parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"),
|
|
3562
3562
|
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${parentPathname}" (under <Route path="${parentPath}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
3563
3563
|
|
|
3564
3564
|
Please change the parent <Route path="${parentPath}"> to <Route path="${parentPath === "/" ? "*" : `${parentPath}/*`}">.`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.0.
|
|
2
|
+
* react-router v7.0.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
matchRoutes,
|
|
26
26
|
shouldHydrateRouteLoader,
|
|
27
27
|
useFogOFWarDiscovery
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-U7UKN772.mjs";
|
|
29
29
|
|
|
30
30
|
// lib/dom-export/dom-router-provider.tsx
|
|
31
31
|
import * as React from "react";
|
package/dist/production/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.0.
|
|
2
|
+
* react-router v7.0.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -4359,7 +4359,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
|
|
|
4359
4359
|
let parentPath = parentRoute && parentRoute.path || "";
|
|
4360
4360
|
warningOnce(
|
|
4361
4361
|
parentPathname,
|
|
4362
|
-
!parentRoute || parentPath.endsWith("*"),
|
|
4362
|
+
!parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"),
|
|
4363
4363
|
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${parentPathname}" (under <Route path="${parentPath}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
4364
4364
|
|
|
4365
4365
|
Please change the parent <Route path="${parentPath}"> to <Route path="${parentPath === "/" ? "*" : `${parentPath}/*`}">.`
|
|
@@ -7125,7 +7125,7 @@ function mergeRefs(...refs) {
|
|
|
7125
7125
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
7126
7126
|
try {
|
|
7127
7127
|
if (isBrowser) {
|
|
7128
|
-
window.__reactRouterVersion = "7.0.
|
|
7128
|
+
window.__reactRouterVersion = "7.0.1-pre.0";
|
|
7129
7129
|
}
|
|
7130
7130
|
} catch (e) {
|
|
7131
7131
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.0.
|
|
2
|
+
* react-router v7.0.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
useSearchParams,
|
|
120
120
|
useSubmit,
|
|
121
121
|
useViewTransitionState
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-U7UKN772.mjs";
|
|
123
123
|
export {
|
|
124
124
|
Await,
|
|
125
125
|
BrowserRouter,
|
|
@@ -6,6 +6,7 @@ type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
|
|
|
6
6
|
type RouteModule = {
|
|
7
7
|
meta?: Func;
|
|
8
8
|
links?: Func;
|
|
9
|
+
headers?: Func;
|
|
9
10
|
loader?: Func;
|
|
10
11
|
clientLoader?: Func;
|
|
11
12
|
action?: Func;
|
|
@@ -42,6 +43,12 @@ type CreateMetaArgs<T extends RouteInfo> = {
|
|
|
42
43
|
matches: MetaMatches<T["parents"]>;
|
|
43
44
|
};
|
|
44
45
|
type MetaDescriptors = MetaDescriptor[];
|
|
46
|
+
type HeadersArgs = {
|
|
47
|
+
loaderHeaders: Headers;
|
|
48
|
+
parentHeaders: Headers;
|
|
49
|
+
actionHeaders: Headers;
|
|
50
|
+
errorHeaders: Headers | undefined;
|
|
51
|
+
};
|
|
45
52
|
type IsHydrate<ClientLoader> = ClientLoader extends {
|
|
46
53
|
hydrate: true;
|
|
47
54
|
} ? true : ClientLoader extends {
|
|
@@ -99,4 +106,4 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = {
|
|
|
99
106
|
actionData?: T["actionData"];
|
|
100
107
|
};
|
|
101
108
|
|
|
102
|
-
export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, LinkDescriptors, MetaDescriptors };
|
|
109
|
+
export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, HeadersArgs, LinkDescriptors, MetaDescriptors };
|
|
@@ -6,6 +6,7 @@ type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
|
|
|
6
6
|
type RouteModule = {
|
|
7
7
|
meta?: Func;
|
|
8
8
|
links?: Func;
|
|
9
|
+
headers?: Func;
|
|
9
10
|
loader?: Func;
|
|
10
11
|
clientLoader?: Func;
|
|
11
12
|
action?: Func;
|
|
@@ -42,6 +43,12 @@ type CreateMetaArgs<T extends RouteInfo> = {
|
|
|
42
43
|
matches: MetaMatches<T["parents"]>;
|
|
43
44
|
};
|
|
44
45
|
type MetaDescriptors = MetaDescriptor[];
|
|
46
|
+
type HeadersArgs = {
|
|
47
|
+
loaderHeaders: Headers;
|
|
48
|
+
parentHeaders: Headers;
|
|
49
|
+
actionHeaders: Headers;
|
|
50
|
+
errorHeaders: Headers | undefined;
|
|
51
|
+
};
|
|
45
52
|
type IsHydrate<ClientLoader> = ClientLoader extends {
|
|
46
53
|
hydrate: true;
|
|
47
54
|
} ? true : ClientLoader extends {
|
|
@@ -99,4 +106,4 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = {
|
|
|
99
106
|
actionData?: T["actionData"];
|
|
100
107
|
};
|
|
101
108
|
|
|
102
|
-
export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, LinkDescriptors, MetaDescriptors };
|
|
109
|
+
export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, HeadersArgs, LinkDescriptors, MetaDescriptors };
|