Skip to content

Commit 68d9c8b

Browse files
committed
Simplify the type declaration for the virtual module virtual:react-router/server-build
Signed-off-by: Sora Morimoto <[email protected]>
1 parent c0f766f commit 68d9c8b

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

.changeset/yellow-planets-dance.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-router/dev": patch
3+
---
4+
5+
Simplify the type declaration for the virtual module `virtual:react-router/server-build`. Previously, we exported each property of the `ServerBuild` interface individually, but now we export the entire `ServerBuild` interface, making the type declaration simpler and easier to maintain. This ensures that any future updates to the `ServerBuild` interface will be automatically reflected in the type definition.

packages/react-router-dev/typegen/index.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,7 @@ function register(ctx: Context) {
152152

153153
const virtual = ts`
154154
declare module "virtual:react-router/server-build" {
155-
import { ServerBuild } from "react-router";
156-
export const assets: ServerBuild["assets"];
157-
export const assetsBuildDirectory: ServerBuild["assetsBuildDirectory"];
158-
export const basename: ServerBuild["basename"];
159-
export const entry: ServerBuild["entry"];
160-
export const future: ServerBuild["future"];
161-
export const isSpaMode: ServerBuild["isSpaMode"];
162-
export const prerender: ServerBuild["prerender"];
163-
export const publicPath: ServerBuild["publicPath"];
164-
export const routes: ServerBuild["routes"];
165-
export const ssr: ServerBuild["ssr"];
166-
export const unstable_getCriticalCss: ServerBuild["unstable_getCriticalCss"];
155+
import type { ServerBuild } from "react-router";
156+
export = ServerBuild;
167157
}
168158
`;

0 commit comments

Comments
 (0)