@react-router/dev 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 +50 -207
- package/README.md +1 -3
- package/dist/cli/index.js +7 -1
- package/dist/config.d.ts +4 -1
- package/dist/config.js +1 -1
- package/dist/{routes-C14jcF98.d.ts → routes-DHIOx0R9.d.ts} +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.js +1 -1
- package/dist/vite/cloudflare.js +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +13 -3
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,84 +1,16 @@
|
|
|
1
|
-
# `@
|
|
1
|
+
# `@react-router/dev`
|
|
2
2
|
|
|
3
|
-
## 7.0.
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- chore: warn instead of error for min node version in CLI ([#12270](https://github.com/remix-run/react-router/pull/12270))
|
|
8
|
-
- chore: re-enable development warnings through a `development` exports condition. ([#12269](https://github.com/remix-run/react-router/pull/12269))
|
|
9
|
-
- if we are in SAP mode, always render the `index.html` for hydration ([#12268](https://github.com/remix-run/react-router/pull/12268))
|
|
10
|
-
- fix(react-router): (v7) fix static prerender of non-ascii characters ([#12161](https://github.com/remix-run/react-router/pull/12161))
|
|
11
|
-
- Updated dependencies:
|
|
12
|
-
- `@react-router/node@7.0.0-pre.6`
|
|
13
|
-
- `react-router@7.0.0-pre.6`
|
|
14
|
-
- `@react-router/serve@7.0.0-pre.6`
|
|
15
|
-
|
|
16
|
-
## 7.0.0-pre.5
|
|
17
|
-
|
|
18
|
-
### Patch Changes
|
|
19
|
-
|
|
20
|
-
- Updated dependencies:
|
|
21
|
-
- `react-router@7.0.0-pre.5`
|
|
22
|
-
- `@react-router/node@7.0.0-pre.5`
|
|
23
|
-
- `@react-router/serve@7.0.0-pre.5`
|
|
24
|
-
|
|
25
|
-
## 7.0.0-pre.4
|
|
26
|
-
|
|
27
|
-
### Patch Changes
|
|
28
|
-
|
|
29
|
-
- Updated dependencies:
|
|
30
|
-
- `react-router@7.0.0-pre.4`
|
|
31
|
-
- `@react-router/node@7.0.0-pre.4`
|
|
32
|
-
- `@react-router/serve@7.0.0-pre.4`
|
|
33
|
-
|
|
34
|
-
## 7.0.0-pre.3
|
|
35
|
-
|
|
36
|
-
### Patch Changes
|
|
37
|
-
|
|
38
|
-
- Enable prerendering for resource routes ([#12200](https://github.com/remix-run/react-router/pull/12200))
|
|
39
|
-
- resolve config directory relative to flat output file structure ([#12187](https://github.com/remix-run/react-router/pull/12187))
|
|
40
|
-
- Updated dependencies:
|
|
41
|
-
- `react-router@7.0.0-pre.3`
|
|
42
|
-
- `@react-router/node@7.0.0-pre.3`
|
|
43
|
-
- `@react-router/serve@7.0.0-pre.3`
|
|
44
|
-
|
|
45
|
-
## 7.0.0-pre.2
|
|
46
|
-
|
|
47
|
-
### Major Changes
|
|
48
|
-
|
|
49
|
-
- - 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))
|
|
50
|
-
- Examples: `LoaderFunction`, `LoaderFunctionArgs`, `ActionFunction`, `ActionFunctionArgs`, `DataFunctionArgs`, `RouteManifest`, `LinksFunction`, `Route`, `EntryRoute`
|
|
51
|
-
- The `RouteManifest` type used by the "remix" code is now slightly stricter because it is using the former `@remix-run/router` `RouteManifest`
|
|
52
|
-
- `Record<string, Route> -> Record<string, Route | undefined>`
|
|
53
|
-
- Removed `AppData` type in favor of inlining `unknown` in the few locations it was used
|
|
54
|
-
- Removed `ServerRuntimeMeta*` types in favor of the `Meta*` types they were duplicated from
|
|
55
|
-
- Drop support for Node 18, update minimum Node vestion to 20 ([#12171](https://github.com/remix-run/react-router/pull/12171))
|
|
56
|
-
|
|
57
|
-
- Remove `installGlobals()` as this should no longer be necessary
|
|
3
|
+
## 7.0.1-pre.0
|
|
58
4
|
|
|
59
5
|
### Patch Changes
|
|
60
6
|
|
|
7
|
+
- Ensure typegen file watcher is cleaned up when Vite dev server restarts ([#12331](https://github.com/remix-run/react-router/pull/12331))
|
|
61
8
|
- Updated dependencies:
|
|
62
|
-
- `react-router@7.0.
|
|
63
|
-
- `@react-router/node@7.0.
|
|
64
|
-
- `@react-router/serve@7.0.
|
|
65
|
-
|
|
66
|
-
## 7.0.0-pre.1
|
|
67
|
-
|
|
68
|
-
### Minor Changes
|
|
69
|
-
|
|
70
|
-
- Add `prefix` route config helper to `@react-router/dev/routes` ([#12094](https://github.com/remix-run/react-router/pull/12094))
|
|
9
|
+
- `react-router@7.0.1-pre.0`
|
|
10
|
+
- `@react-router/node@7.0.1-pre.0`
|
|
11
|
+
- `@react-router/serve@7.0.1-pre.0`
|
|
71
12
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
- - 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))
|
|
75
|
-
- Proxy prerendered loader data into prerender pass for HTML files to avoid double-invocations of the loader at build time
|
|
76
|
-
- Updated dependencies:
|
|
77
|
-
- `react-router@7.0.0-pre.1`
|
|
78
|
-
- `@react-router/serve@7.0.0-pre.1`
|
|
79
|
-
- `@react-router/node@7.0.0-pre.1`
|
|
80
|
-
|
|
81
|
-
## 7.0.0-pre.0
|
|
13
|
+
## 7.0.0
|
|
82
14
|
|
|
83
15
|
### Major Changes
|
|
84
16
|
|
|
@@ -95,35 +27,45 @@
|
|
|
95
27
|
```
|
|
96
28
|
|
|
97
29
|
- Remove single_fetch future flag. ([#11522](https://github.com/remix-run/react-router/pull/11522))
|
|
30
|
+
|
|
98
31
|
- update minimum node version to 18 ([#11690](https://github.com/remix-run/react-router/pull/11690))
|
|
32
|
+
|
|
99
33
|
- Add `exports` field to all packages ([#11675](https://github.com/remix-run/react-router/pull/11675))
|
|
34
|
+
|
|
100
35
|
- node package no longer re-exports from react-router ([#11702](https://github.com/remix-run/react-router/pull/11702))
|
|
36
|
+
|
|
101
37
|
- For Remix consumers migrating to React Router who used the Vite plugin's `buildEnd` hook, the resolved `reactRouterConfig` object no longer contains a `publicPath` property since this belongs to Vite, not React Router. ([#11575](https://github.com/remix-run/react-router/pull/11575))
|
|
38
|
+
|
|
102
39
|
- For Remix consumers migrating to React Router, the Vite plugin's `manifest` option has been removed. ([#11573](https://github.com/remix-run/react-router/pull/11573))
|
|
103
40
|
|
|
104
41
|
The `manifest` option been superseded by the more powerful `buildEnd` hook since it's passed the `buildManifest` argument. You can still write the build manifest to disk if needed, but you'll most likely find it more convenient to write any logic depending on the build manifest within the `buildEnd` hook itself.
|
|
105
42
|
|
|
106
43
|
If you were using the `manifest` option, you can replace it with a `buildEnd` hook that writes the manifest to disk like this:
|
|
107
44
|
|
|
108
|
-
```
|
|
109
|
-
|
|
45
|
+
```ts
|
|
46
|
+
// react-router.config.ts
|
|
47
|
+
import type { Config } from "@react-router/dev/config";
|
|
110
48
|
import { writeFile } from "node:fs/promises";
|
|
111
49
|
|
|
112
50
|
export default {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
}),
|
|
123
|
-
],
|
|
124
|
-
};
|
|
51
|
+
async buildEnd({ buildManifest }) {
|
|
52
|
+
await writeFile(
|
|
53
|
+
"build/manifest.json",
|
|
54
|
+
JSON.stringify(buildManifest, null, 2),
|
|
55
|
+
"utf-8"
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
} satisfies Config;
|
|
125
59
|
```
|
|
126
60
|
|
|
61
|
+
- 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))
|
|
62
|
+
|
|
63
|
+
- Examples: `LoaderFunction`, `LoaderFunctionArgs`, `ActionFunction`, `ActionFunctionArgs`, `DataFunctionArgs`, `RouteManifest`, `LinksFunction`, `Route`, `EntryRoute`
|
|
64
|
+
- The `RouteManifest` type used by the "remix" code is now slightly stricter because it is using the former `@remix-run/router` `RouteManifest`
|
|
65
|
+
- `Record<string, Route> -> Record<string, Route | undefined>`
|
|
66
|
+
- Removed `AppData` type in favor of inlining `unknown` in the few locations it was used
|
|
67
|
+
- Removed `ServerRuntimeMeta*` types in favor of the `Meta*` types they were duplicated from
|
|
68
|
+
|
|
127
69
|
- Update default `isbot` version to v5 and drop support for `isbot@3` ([#11770](https://github.com/remix-run/react-router/pull/11770))
|
|
128
70
|
|
|
129
71
|
- If you have `isbot@4` or `isbot@5` in your `package.json`:
|
|
@@ -134,6 +76,10 @@
|
|
|
134
76
|
- If you have `isbot@3` in your `package.json` and you do not have your own `entry.server.tsx` file in your repo
|
|
135
77
|
- You are using the internal default entry provided by React Router v7 and you will need to upgrade to `isbot@5` in your `package.json`
|
|
136
78
|
|
|
79
|
+
- Drop support for Node 18, update minimum Node vestion to 20 ([#12171](https://github.com/remix-run/react-router/pull/12171))
|
|
80
|
+
|
|
81
|
+
- Remove `installGlobals()` as this should no longer be necessary
|
|
82
|
+
|
|
137
83
|
- For Remix consumers migrating to React Router, Vite manifests (i.e. `.vite/manifest.json`) are now written within each build subdirectory, e.g. `build/client/.vite/manifest.json` and `build/server/.vite/manifest.json` instead of `build/.vite/client-manifest.json` and `build/.vite/server-manifest.json`. This means that the build output is now much closer to what you'd expect from a typical Vite project. ([#11573](https://github.com/remix-run/react-router/pull/11573))
|
|
138
84
|
|
|
139
85
|
Originally the Remix Vite plugin moved all Vite manifests to a root-level `build/.vite` directory to avoid accidentally serving them in production, particularly from the client build. This was later improved with additional logic that deleted these Vite manifest files at the end of the build process unless Vite's `build.manifest` had been enabled within the app's Vite config. This greatly reduced the risk of accidentally serving the Vite manifests in production since they're only present when explicitly asked for. As a result, we can now assume that consumers will know that they need to manage these additional files themselves, and React Router can safely generate a more standard Vite build output.
|
|
@@ -150,6 +96,9 @@
|
|
|
150
96
|
```
|
|
151
97
|
|
|
152
98
|
- Remove internal entry.server.spa.tsx implementation ([#11681](https://github.com/remix-run/react-router/pull/11681))
|
|
99
|
+
|
|
100
|
+
- Add `prefix` route config helper to `@react-router/dev/routes` ([#12094](https://github.com/remix-run/react-router/pull/12094))
|
|
101
|
+
|
|
153
102
|
- ### Typesafety improvements ([#12019](https://github.com/remix-run/react-router/pull/12019))
|
|
154
103
|
|
|
155
104
|
React Router now generates types for each of your route modules.
|
|
@@ -171,16 +120,6 @@
|
|
|
171
120
|
- `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
|
|
172
121
|
- `ActionData` : Action data from `action` and/or `clientAction` within your route module
|
|
173
122
|
|
|
174
|
-
These types are then used to create types for route export args and props:
|
|
175
|
-
|
|
176
|
-
- `LoaderArgs`
|
|
177
|
-
- `ClientLoaderArgs`
|
|
178
|
-
- `ActionArgs`
|
|
179
|
-
- `ClientActionArgs`
|
|
180
|
-
- `HydrateFallbackProps`
|
|
181
|
-
- `ComponentProps` (for the `default` export)
|
|
182
|
-
- `ErrorBoundaryProps`
|
|
183
|
-
|
|
184
123
|
In the future, we plan to add types for the rest of the route module exports: `meta`, `links`, `headers`, `shouldRevalidate`, etc.
|
|
185
124
|
We also plan to generate types for typesafe `Link`s:
|
|
186
125
|
|
|
@@ -190,120 +129,24 @@
|
|
|
190
129
|
// typesafe `to` and `params` based on the available routes in your app
|
|
191
130
|
```
|
|
192
131
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
React Router will generate types into a `.react-router/` directory at the root of your app.
|
|
196
|
-
This directory is fully managed by React Router and is derived based on your route config (`routes.ts`).
|
|
197
|
-
|
|
198
|
-
👉 **Add `.react-router/` to `.gitignore`**
|
|
199
|
-
|
|
200
|
-
```txt
|
|
201
|
-
.react-router
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
You should also ensure that generated types for routes are always present before running typechecking,
|
|
205
|
-
especially for running typechecking in CI.
|
|
206
|
-
|
|
207
|
-
👉 **Add `react-router typegen` to your `typecheck` command in `package.json`**
|
|
208
|
-
|
|
209
|
-
```json
|
|
210
|
-
{
|
|
211
|
-
"scripts": {
|
|
212
|
-
"typecheck": "react-router typegen && tsc"
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
To get TypeScript to use those generated types, you'll need to add them to `include` in `tsconfig.json`.
|
|
218
|
-
And to be able to import them as if they files next to your route modules, you'll also need to configure `rootDirs`.
|
|
219
|
-
|
|
220
|
-
👉 **Configure `tsconfig.json` for generated types**
|
|
221
|
-
|
|
222
|
-
```json
|
|
223
|
-
{
|
|
224
|
-
"include": [".react-router/types/**/*"],
|
|
225
|
-
"compilerOptions": {
|
|
226
|
-
"rootDirs": [".", "./.react-router/types"]
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
#### `typegen` command
|
|
232
|
-
|
|
233
|
-
You can manually generate types with the new `typegen` command:
|
|
234
|
-
|
|
235
|
-
```sh
|
|
236
|
-
react-router typegen
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
However, manual type generation is tedious and types can get out of sync quickly if you ever forget to run `typegen`.
|
|
240
|
-
Instead, we recommend that you setup our new TypeScript plugin which will automatically generate fresh types whenever routes change.
|
|
241
|
-
That way, you'll always have up-to-date types.
|
|
242
|
-
|
|
243
|
-
#### TypeScript plugin
|
|
244
|
-
|
|
245
|
-
To get automatic type generation, you can use our new TypeScript plugin.
|
|
246
|
-
|
|
247
|
-
👉 **Add the TypeScript plugin to `tsconfig.json`**
|
|
248
|
-
|
|
249
|
-
```json
|
|
250
|
-
{
|
|
251
|
-
"compilerOptions": {
|
|
252
|
-
"plugins": [{ "name": "@react-router/dev" }]
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
We plan to add some other goodies to our TypeScript plugin soon, including:
|
|
258
|
-
|
|
259
|
-
- Automatic `jsdoc` for route exports that include links to official docs
|
|
260
|
-
- Autocomplete for route exports
|
|
261
|
-
- Warnings for non-HMR compliant exports
|
|
262
|
-
|
|
263
|
-
##### VSCode
|
|
264
|
-
|
|
265
|
-
TypeScript looks for plugins registered in `tsconfig.json` in the local `node_modules/`,
|
|
266
|
-
but VSCode ships with its own copy of TypeScript that is installed outside of your project.
|
|
267
|
-
For TypeScript plugins to work, you'll need to tell VSCode to use the local workspace version of TypeScript.
|
|
268
|
-
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.
|
|
269
|
-
|
|
270
|
-
Your project should have a `.vscode/settings.json` with the following settings:
|
|
271
|
-
|
|
272
|
-
```json
|
|
273
|
-
{
|
|
274
|
-
"typescript.tsdk": "node_modules/typescript/lib",
|
|
275
|
-
"typescript.enablePromptUseWorkspaceTsdk": true
|
|
276
|
-
}
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
That way [VSCode will ask you](https://code.visualstudio.com/updates/v1_45#_prompt-users-to-switch-to-the-workspace-version-of-typescript) if you want to use the workspace version of TypeScript the first time you open a TS file in that project.
|
|
280
|
-
|
|
281
|
-
> [!IMPORTANT]
|
|
282
|
-
> You'll need to install dependencies first so that the workspace version of TypeScript is available.
|
|
283
|
-
|
|
284
|
-
👉 **Select "Allow" when VSCode asks if you want to use the workspace version of TypeScript**
|
|
285
|
-
|
|
286
|
-
Otherwise, you can also manually opt-in to the workspace version:
|
|
287
|
-
|
|
288
|
-
1. Open up any TypeScript file in your project
|
|
289
|
-
2. Open up the VSCode Command Palette (<kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>)
|
|
290
|
-
3. Search for `Select TypeScript Version`
|
|
291
|
-
4. Choose `Use Workspace Version`
|
|
292
|
-
5. Quit and reopen VSCode
|
|
132
|
+
Check out our docs for more:
|
|
293
133
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
In VSCode, open up any TypeScript file in your project and then use <kbd>CMD</kbd>+<kbd>SHIFT</kbd>+<kbd>P</kbd> to select `Open TS Server log`.
|
|
297
|
-
There should be a log for `[react-router] setup` that indicates that the plugin was resolved correctly.
|
|
298
|
-
Then look for any errors in the log.
|
|
134
|
+
- [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
|
|
135
|
+
- [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
|
|
299
136
|
|
|
300
137
|
### Patch Changes
|
|
301
138
|
|
|
139
|
+
- Enable prerendering for resource routes ([#12200](https://github.com/remix-run/react-router/pull/12200))
|
|
140
|
+
- chore: warn instead of error for min node version in CLI ([#12270](https://github.com/remix-run/react-router/pull/12270))
|
|
141
|
+
- chore: re-enable development warnings through a `development` exports condition. ([#12269](https://github.com/remix-run/react-router/pull/12269))
|
|
302
142
|
- include root "react-dom" module for optimization ([#12060](https://github.com/remix-run/react-router/pull/12060))
|
|
143
|
+
- resolve config directory relative to flat output file structure ([#12187](https://github.com/remix-run/react-router/pull/12187))
|
|
144
|
+
- if we are in SAP mode, always render the `index.html` for hydration ([#12268](https://github.com/remix-run/react-router/pull/12268))
|
|
145
|
+
- fix(react-router): (v7) fix static prerender of non-ascii characters ([#12161](https://github.com/remix-run/react-router/pull/12161))
|
|
303
146
|
- Updated dependencies:
|
|
304
|
-
- `react-router@7.0.0
|
|
305
|
-
- `@react-router/serve@7.0.0
|
|
306
|
-
- `@react-router/node@7.0.0
|
|
147
|
+
- `react-router@7.0.0`
|
|
148
|
+
- `@react-router/serve@7.0.0`
|
|
149
|
+
- `@react-router/node@7.0.0`
|
|
307
150
|
|
|
308
151
|
## 2.9.0
|
|
309
152
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Dev tools and CLI for [React Router.](https://github.com/remix-run/react-router)
|
|
1
|
+
Dev tools and CLI for React Router that enables framework features through bundler integration like server rendering, code splitting, HMR, etc.
|
|
4
2
|
|
|
5
3
|
```sh
|
|
6
4
|
npm install @react-router/dev
|
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @react-router/dev v7.0.
|
|
3
|
+
* @react-router/dev v7.0.1-pre.0
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) Remix Software Inc.
|
|
6
6
|
*
|
|
@@ -631,6 +631,9 @@ function generate(ctx, route) {
|
|
|
631
631
|
export type MetaDescriptors = T.MetaDescriptors
|
|
632
632
|
export type MetaFunction = (args: MetaArgs) => MetaDescriptors
|
|
633
633
|
|
|
634
|
+
export type HeadersArgs = T.HeadersArgs
|
|
635
|
+
export type HeadersFunction = (args: HeadersArgs) => Headers | HeadersInit
|
|
636
|
+
|
|
634
637
|
export type LoaderArgs = T.CreateServerLoaderArgs<Info>
|
|
635
638
|
export type ClientLoaderArgs = T.CreateClientLoaderArgs<Info>
|
|
636
639
|
export type ActionArgs = T.CreateServerActionArgs<Info>
|
|
@@ -717,6 +720,9 @@ async function watch(rootDirectory, { logger } = {}) {
|
|
|
717
720
|
});
|
|
718
721
|
}
|
|
719
722
|
});
|
|
723
|
+
return {
|
|
724
|
+
close: async () => await ctx.configLoader.close()
|
|
725
|
+
};
|
|
720
726
|
}
|
|
721
727
|
async function createContext2({
|
|
722
728
|
rootDirectory,
|
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Vite from 'vite';
|
|
2
|
-
import { R as RouteManifest, a as RouteManifestEntry } from './routes-
|
|
2
|
+
import { R as RouteManifest, a as RouteManifestEntry } from './routes-DHIOx0R9.js';
|
|
3
3
|
import 'valibot';
|
|
4
4
|
|
|
5
5
|
declare const excludedConfigPresetKeys: readonly ["presets"];
|
|
@@ -45,6 +45,9 @@ type BuildEndHook = (args: {
|
|
|
45
45
|
reactRouterConfig: ResolvedReactRouterConfig;
|
|
46
46
|
viteConfig: Vite.ResolvedConfig;
|
|
47
47
|
}) => void | Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Config to be exported via the default export from `react-router.config.ts`.
|
|
50
|
+
*/
|
|
48
51
|
type ReactRouterConfig = {
|
|
49
52
|
/**
|
|
50
53
|
* The path to the `app` directory, relative to the root directory. Defaults
|
package/dist/config.js
CHANGED
|
@@ -75,7 +75,7 @@ interface RouteConfigEntry {
|
|
|
75
75
|
declare const resolvedRouteConfigSchema: v.ArraySchema<v.BaseSchema<RouteConfigEntry, any, v.BaseIssue<unknown>>, undefined>;
|
|
76
76
|
type ResolvedRouteConfig = v.InferInput<typeof resolvedRouteConfigSchema>;
|
|
77
77
|
/**
|
|
78
|
-
* Route config to be exported via the
|
|
78
|
+
* Route config to be exported via the default export from `app/routes.ts`.
|
|
79
79
|
*/
|
|
80
80
|
type RouteConfig = ResolvedRouteConfig | Promise<ResolvedRouteConfig>;
|
|
81
81
|
declare const createConfigRouteOptionKeys: ["id", "index", "caseSensitive"];
|
package/dist/routes.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { b as RouteConfig, c as RouteConfigEntry, g as getAppDirectory, i as index, l as layout, p as prefix, d as relative, r as route } from './routes-
|
|
1
|
+
export { b as RouteConfig, c as RouteConfigEntry, g as getAppDirectory, i as index, l as layout, p as prefix, d as relative, r as route } from './routes-DHIOx0R9.js';
|
|
2
2
|
import 'valibot';
|
package/dist/routes.js
CHANGED
package/dist/vite/cloudflare.js
CHANGED
package/dist/vite.d.ts
CHANGED
package/dist/vite.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/dev v7.0.
|
|
2
|
+
* @react-router/dev v7.0.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -672,6 +672,9 @@ function generate(ctx, route) {
|
|
|
672
672
|
export type MetaDescriptors = T.MetaDescriptors
|
|
673
673
|
export type MetaFunction = (args: MetaArgs) => MetaDescriptors
|
|
674
674
|
|
|
675
|
+
export type HeadersArgs = T.HeadersArgs
|
|
676
|
+
export type HeadersFunction = (args: HeadersArgs) => Headers | HeadersInit
|
|
677
|
+
|
|
675
678
|
export type LoaderArgs = T.CreateServerLoaderArgs<Info>
|
|
676
679
|
export type ClientLoaderArgs = T.CreateClientLoaderArgs<Info>
|
|
677
680
|
export type ActionArgs = T.CreateServerActionArgs<Info>
|
|
@@ -744,6 +747,9 @@ async function watch(rootDirectory, { logger } = {}) {
|
|
|
744
747
|
});
|
|
745
748
|
}
|
|
746
749
|
});
|
|
750
|
+
return {
|
|
751
|
+
close: async () => await ctx.configLoader.close()
|
|
752
|
+
};
|
|
747
753
|
}
|
|
748
754
|
async function createContext2({
|
|
749
755
|
rootDirectory,
|
|
@@ -1134,7 +1140,7 @@ var plugin = {
|
|
|
1134
1140
|
if (id2 !== resolve3(vmodId)) return;
|
|
1135
1141
|
return import_dedent2.default`
|
|
1136
1142
|
import { createElement as h } from "react";
|
|
1137
|
-
import { useActionData, useLoaderData, useMatches, useParams } from "react-router";
|
|
1143
|
+
import { useActionData, useLoaderData, useMatches, useParams, useRouteError } from "react-router";
|
|
1138
1144
|
|
|
1139
1145
|
export function withComponentProps(Component) {
|
|
1140
1146
|
return function Wrapped() {
|
|
@@ -1163,6 +1169,7 @@ var plugin = {
|
|
|
1163
1169
|
params: useParams(),
|
|
1164
1170
|
loaderData: useLoaderData(),
|
|
1165
1171
|
actionData: useActionData(),
|
|
1172
|
+
error: useRouteError(),
|
|
1166
1173
|
};
|
|
1167
1174
|
return h(ErrorBoundary, props);
|
|
1168
1175
|
};
|
|
@@ -1412,6 +1419,7 @@ var reactRouterVitePlugin = () => {
|
|
|
1412
1419
|
let cssModulesManifest = {};
|
|
1413
1420
|
let viteChildCompiler = null;
|
|
1414
1421
|
let reactRouterConfigLoader;
|
|
1422
|
+
let typegenWatcherPromise;
|
|
1415
1423
|
let logger;
|
|
1416
1424
|
let firstLoad = true;
|
|
1417
1425
|
let ctx;
|
|
@@ -1670,7 +1678,7 @@ var reactRouterVitePlugin = () => {
|
|
|
1670
1678
|
});
|
|
1671
1679
|
rootDirectory = viteUserConfig.root ?? process.env.REACT_ROUTER_ROOT ?? process.cwd();
|
|
1672
1680
|
if (viteCommand === "serve") {
|
|
1673
|
-
watch(rootDirectory, {
|
|
1681
|
+
typegenWatcherPromise = watch(rootDirectory, {
|
|
1674
1682
|
// ignore `info` logs from typegen since they are redundant when Vite plugin logs are active
|
|
1675
1683
|
logger: vite2.createLogger("warn", { prefix: "[react-router]" })
|
|
1676
1684
|
});
|
|
@@ -2046,6 +2054,8 @@ var reactRouterVitePlugin = () => {
|
|
|
2046
2054
|
async buildEnd() {
|
|
2047
2055
|
await viteChildCompiler?.close();
|
|
2048
2056
|
await reactRouterConfigLoader.close();
|
|
2057
|
+
let typegenWatcher = await typegenWatcherPromise;
|
|
2058
|
+
await typegenWatcher?.close();
|
|
2049
2059
|
}
|
|
2050
2060
|
},
|
|
2051
2061
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-router/dev",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.1-pre.0",
|
|
4
4
|
"description": "Dev tools and CLI for React Router",
|
|
5
5
|
"homepage": "https://reactrouter.com",
|
|
6
6
|
"bugs": {
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"set-cookie-parser": "^2.6.0",
|
|
82
82
|
"valibot": "^0.41.0",
|
|
83
83
|
"vite-node": "^1.6.0",
|
|
84
|
-
"@react-router/node": "7.0.
|
|
84
|
+
"@react-router/node": "7.0.1-pre.0"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/babel__core": "^7.20.5",
|
|
@@ -110,15 +110,15 @@
|
|
|
110
110
|
"vite": "^5.1.0",
|
|
111
111
|
"wireit": "0.14.9",
|
|
112
112
|
"wrangler": "^3.28.2",
|
|
113
|
-
"@react-router/serve": "7.0.
|
|
114
|
-
"react-router": "^7.0.
|
|
113
|
+
"@react-router/serve": "7.0.1-pre.0",
|
|
114
|
+
"react-router": "^7.0.1-pre.0"
|
|
115
115
|
},
|
|
116
116
|
"peerDependencies": {
|
|
117
117
|
"typescript": "^5.1.0",
|
|
118
118
|
"vite": "^5.1.0",
|
|
119
119
|
"wrangler": "^3.28.2",
|
|
120
|
-
"@react-router/serve": "^7.0.
|
|
121
|
-
"react-router": "^7.0.
|
|
120
|
+
"@react-router/serve": "^7.0.1-pre.0",
|
|
121
|
+
"react-router": "^7.0.1-pre.0"
|
|
122
122
|
},
|
|
123
123
|
"peerDependenciesMeta": {
|
|
124
124
|
"@react-router/serve": {
|