react-router-hono-server 4.1.1 → 4.1.3

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/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # React Router Hono Server
2
2
 
3
+ [![Latest compatible runtimes](https://github.com/rphlmr/react-router-hono-server/actions/workflows/nightly.yaml/badge.svg)](https://github.com/rphlmr/react-router-hono-server/actions/workflows/nightly.yaml)
4
+
3
5
  Run a React Router framework-mode application on Hono—without giving up the runtime you want.
4
6
 
5
7
  `react-router-hono-server` provides a Vite plugin and production adapters for Node.js, Bun, Deno, Cloudflare Workers, and AWS Lambda.
@@ -290,8 +292,8 @@ export default await createHonoServer();
290
292
  ```json
291
293
  {
292
294
  "scripts": {
293
- "build": "bunx --bun react-router build",
294
- "dev": "bunx --bun vite",
295
+ "build": "bun x --bun react-router build",
296
+ "dev": "bun x --bun vite",
295
297
  "start": "bun ./build/server/index.js",
296
298
  "typecheck": "react-router typegen && tsc --noEmit"
297
299
  }
@@ -311,8 +313,8 @@ bun run start
311
313
 
312
314
  #### Bun runtime notes
313
315
 
314
- - `bunx --bun react-router build` runs React Router and prerendering under Bun instead of following the CLI's Node.js shebang.
315
- - `bunx --bun vite` forces Vite and its child processes to run with Bun.
316
+ - `bun x --bun react-router build` runs React Router and prerendering under Bun instead of following the CLI's Node.js shebang.
317
+ - `bun x --bun vite` forces Vite and its child processes to run with Bun.
316
318
  - React Router automatically uses its Web Streams server entry.
317
319
  - `customBunServer` forwards options to `Bun.serve`.
318
320
  - Graceful shutdown, static-file customization, and WebSockets are supported.
@@ -15,12 +15,12 @@ interface HonoAWSServerOptions<E extends Env = BlankEnv> extends Omit<HonoServer
15
15
  */
16
16
  invokeMode: InvokeMode;
17
17
  }
18
- type HonoServerOptions<E extends Env = BlankEnv> = HonoAWSServerOptions<E> & Omit<WithoutWebsocket<E>, "useWebSocket">;
18
+ export type HonoServerOptions<E extends Env = BlankEnv> = HonoAWSServerOptions<E> & Omit<WithoutWebsocket<E>, "useWebSocket">;
19
19
  /**
20
20
  * Create a Hono server
21
21
  *
22
22
  * @param config {@link HonoServerOptions} - The configuration options for the server
23
23
  */
24
- declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptions<E>): Promise<Hono<E> | AWSLambdaHandler>;
24
+ export declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptions<E>): Promise<Hono<E> | AWSLambdaHandler>;
25
25
  //#endregion
26
- export { HonoServerOptions, createGetLoadContext, createHonoServer };
26
+ export { createGetLoadContext };
@@ -43,13 +43,13 @@ interface HonoBunServerOptions<E extends Env = BlankEnv> extends HonoServerOptio
43
43
  }
44
44
  type HonoServerOptionsWithWebSocket<E extends Env = BlankEnv> = HonoBunServerOptions<E> & WithWebsocket<E>;
45
45
  type HonoServerOptionsWithoutWebSocket<E extends Env = BlankEnv> = HonoBunServerOptions<E> & WithoutWebsocket<E>;
46
- type HonoServerOptions<E extends Env = BlankEnv> = HonoServerOptionsWithWebSocket<E> | HonoServerOptionsWithoutWebSocket<E>;
46
+ export type HonoServerOptions<E extends Env = BlankEnv> = HonoServerOptionsWithWebSocket<E> | HonoServerOptionsWithoutWebSocket<E>;
47
47
  /**
48
48
  * Create a Hono server
49
49
  *
50
50
  * @param HonoServerOptions options {@link HonoServerOptions} - The configuration options for the server
51
51
  */
52
- declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithoutWebSocket<E>): Promise<CustomBunServer>;
53
- declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithWebSocket<E>): Promise<CustomBunServer>;
52
+ export declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithoutWebSocket<E>): Promise<CustomBunServer>;
53
+ export declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithWebSocket<E>): Promise<CustomBunServer>;
54
54
  //#endregion
55
- export { HonoServerOptions, createGetLoadContext, createHonoServer };
55
+ export { createGetLoadContext };
@@ -7,13 +7,13 @@ interface HonoCloudflareOptions<E extends Env = BlankEnv> extends Omit<HonoServe
7
7
  type CloudflareUpgradeWebSocket = typeof upgradeWebSocket;
8
8
  type HonoServerOptionsWithWebSocket<E extends Env = BlankEnv> = HonoCloudflareOptions<E> & WithWebsocket<E, CloudflareUpgradeWebSocket>;
9
9
  type HonoServerOptionsWithoutWebSocket<E extends Env = BlankEnv> = HonoCloudflareOptions<E> & WithoutWebsocket<E>;
10
- type HonoServerOptions<E extends Env = BlankEnv> = HonoServerOptionsWithWebSocket<E> | HonoServerOptionsWithoutWebSocket<E>;
10
+ export type HonoServerOptions<E extends Env = BlankEnv> = HonoServerOptionsWithWebSocket<E> | HonoServerOptionsWithoutWebSocket<E>;
11
11
  /**
12
12
  * Create a Hono server
13
13
  *
14
14
  * @param config {@link HonoServerOptions} - The configuration options for the server
15
15
  */
16
- declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithoutWebSocket<E>): Promise<Hono<E>>;
17
- declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithWebSocket<E>): Promise<Hono<E>>;
16
+ export declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithoutWebSocket<E>): Promise<Hono<E>>;
17
+ export declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithWebSocket<E>): Promise<Hono<E>>;
18
18
  //#endregion
19
- export { HonoServerOptions, createGetLoadContext, createHonoServer };
19
+ export { createGetLoadContext };
@@ -40,13 +40,13 @@ interface HonoDenoServerOptions<E extends Env = BlankEnv> extends HonoServerOpti
40
40
  }
41
41
  type HonoServerOptionsWithoutWebSocket<E extends Env = BlankEnv> = HonoDenoServerOptions<E> & WithoutWebsocket<E>;
42
42
  type HonoServerOptionsWithWebSocket<E extends Env = BlankEnv> = HonoDenoServerOptions<E> & WithWebsocket<E>;
43
- type HonoServerOptions<E extends Env = BlankEnv> = HonoServerOptionsWithWebSocket<E> | HonoServerOptionsWithoutWebSocket<E>;
43
+ export type HonoServerOptions<E extends Env = BlankEnv> = HonoServerOptionsWithWebSocket<E> | HonoServerOptionsWithoutWebSocket<E>;
44
44
  /**
45
45
  * Create a Hono server
46
46
  *
47
47
  * @param config {@link HonoServerOptions} - The configuration options for the server
48
48
  */
49
- declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithoutWebSocket<E>): Promise<Hono<E>>;
50
- declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithWebSocket<E>): Promise<Hono<E>>;
49
+ export declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithoutWebSocket<E>): Promise<Hono<E>>;
50
+ export declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithWebSocket<E>): Promise<Hono<E>>;
51
51
  //#endregion
52
- export { HonoServerOptions, createGetLoadContext, createHonoServer };
52
+ export { createGetLoadContext };
@@ -93,13 +93,13 @@ type WithNodeWebsocket<E extends Env> = Omit<WithWebsocket<E>, "configure"> & {
93
93
  };
94
94
  type HonoServerOptionsWithWebSocket<E extends Env = BlankEnv> = HonoNodeServerOptions<E> & WithNodeWebsocket<E>;
95
95
  type HonoServerOptionsWithoutWebSocket<E extends Env = BlankEnv> = HonoNodeServerOptions<E> & WithoutWebsocket<E>;
96
- type HonoServerOptions<E extends Env = BlankEnv> = HonoServerOptionsWithWebSocket<E> | HonoServerOptionsWithoutWebSocket<E>;
96
+ export type HonoServerOptions<E extends Env = BlankEnv> = HonoServerOptionsWithWebSocket<E> | HonoServerOptionsWithoutWebSocket<E>;
97
97
  /**
98
98
  * Create a Hono server
99
99
  *
100
100
  * @param config {@link HonoServerOptions} - The configuration options for the server
101
101
  */
102
- declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithoutWebSocket<E>): Promise<Hono<E>>;
103
- declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithWebSocket<E>): Promise<Hono<E>>;
102
+ export declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithoutWebSocket<E>): Promise<Hono<E>>;
103
+ export declare function createHonoServer<E extends Env = BlankEnv>(options?: HonoServerOptionsWithWebSocket<E>): Promise<Hono<E>>;
104
104
  //#endregion
105
- export { HonoServerOptions, createGetLoadContext, createHonoServer };
105
+ export { createGetLoadContext };
package/dist/dev.d.ts CHANGED
@@ -44,6 +44,5 @@ type ReactRouterHonoServerPluginOptionsDefault = ReactRouterHonoServerPluginOpti
44
44
  runtime?: Runtime;
45
45
  };
46
46
  type ReactRouterHonoServerPluginOptions = ReactRouterHonoServerPluginOptionsDefault;
47
- declare function reactRouterHonoServer(options?: ReactRouterHonoServerPluginOptions): Plugin;
48
- //#endregion
49
- export { reactRouterHonoServer };
47
+ export declare function reactRouterHonoServer(options?: ReactRouterHonoServerPluginOptions): Plugin;
48
+ //#endregion
package/dist/http.d.ts CHANGED
@@ -7,18 +7,17 @@ import { Context } from "hono";
7
7
  *
8
8
  * @deprecated Use `redirect` instead. `import { reactRouterRedirect } from "react-router-hono-server/http"`
9
9
  */
10
- declare function reactRouterRedirect(location: string): Response;
10
+ export declare function reactRouterRedirect(location: string): Response;
11
11
  /**
12
12
  * Redirect to a new location.
13
13
  *
14
14
  * It follows the Single Fetch Redirect protocol, if the request path ends with `.data`.
15
15
  */
16
- declare function redirect(c: Context, location: string): Response;
16
+ export declare function redirect(c: Context, location: string): Response;
17
17
  /**
18
18
  * Get the current request path
19
19
  *
20
20
  * If the path ends with `.data` (React Router Single Fetch query), it will be removed.
21
21
  */
22
- declare function getPath(c: Context): string;
23
- //#endregion
24
- export { getPath, reactRouterRedirect, redirect };
22
+ export declare function getPath(c: Context): string;
23
+ //#endregion
@@ -4,6 +4,5 @@
4
4
  *
5
5
  * @param seconds - The number of seconds to cache
6
6
  */
7
- declare function cache(seconds: number): import("hono").MiddlewareHandler<any, string, {}, Response>;
8
- //#endregion
9
- export { cache };
7
+ export declare function cache(seconds: number): import("hono").MiddlewareHandler<any, string, {}, Response>;
8
+ //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-router-hono-server",
3
- "version": "4.1.1",
3
+ "version": "4.1.3",
4
4
  "description": "The Vite plugin you need to create a Hono server for your React Router app in less than 10 seconds.",
5
5
  "homepage": "https://github.com/rphlmr/react-router-hono-server#readme",
6
6
  "bugs": {
@@ -82,39 +82,40 @@
82
82
  "provenance": true
83
83
  },
84
84
  "dependencies": {
85
- "@drizzle-team/brocli": "0.12.0",
85
+ "@drizzle-team/brocli": "0.12.1",
86
86
  "@hono/node-server": "2.1.1",
87
87
  "@hono/vite-dev-server": "0.26.1"
88
88
  },
89
89
  "devDependencies": {
90
90
  "@arethetypeswrong/cli": "0.18.5",
91
- "@changesets/changelog-github": "1.0.0",
92
- "@changesets/cli": "3.0.1",
93
- "@cloudflare/workers-types": "5.20260819.1",
94
- "@playwright/test": "1.62.1",
95
- "@types/bun": "1.3.14",
91
+ "@changesets/changelog-github": "1.0.1",
92
+ "@changesets/cli": "3.0.2",
93
+ "@cloudflare/workers-types": "5.20260902.1",
94
+ "@playwright/test": "1.63.0",
95
+ "@types/bun": "1.4.2",
96
96
  "@types/deno": "2.7.0",
97
- "@types/node": "24.13.3",
98
- "@types/react-dom": "19.2.4",
97
+ "@types/node": "22.20.2",
98
+ "@types/react-dom": "19.3.0",
99
99
  "@types/ws": "8.18.1",
100
100
  "@vitest/coverage-v8": "4.1.11",
101
- "hono": "4.13.3",
101
+ "hono": "4.13.7",
102
102
  "npm-run-all": "4.1.5",
103
103
  "publint": "0.3.24",
104
- "react": "19.2.8",
105
- "react-dom": "19.2.8",
104
+ "react": "19.3.0",
105
+ "react-dom": "19.3.0",
106
106
  "typescript": "6.0.3",
107
- "vite-plus": "0.2.9",
107
+ "vite-plus": "0.3.1",
108
+ "vitest": "4.1.11",
108
109
  "ws": "8.21.3"
109
110
  },
110
111
  "peerDependencies": {
111
112
  "@react-router/dev": "^8.3.0",
112
113
  "@types/ws": "^8.18.1",
113
- "hono": "^4.13.2",
114
- "react": "^19.2.8",
115
- "react-dom": "^19.2.8",
116
- "react-router": "^8.3.0",
117
- "vite": ">=8.2.1",
114
+ "hono": "^4.13.7",
115
+ "react": "^19.3.0",
116
+ "react-dom": "^19.3.0",
117
+ "react-router": "^8.3.1",
118
+ "vite": ">=8.3.0",
118
119
  "ws": "^8.21.3"
119
120
  },
120
121
  "peerDependenciesMeta": {
@@ -141,13 +142,23 @@
141
142
  "check:fix": "vp check --fix",
142
143
  "clear-all": "rm -rf node_modules pnpm-lock.yaml",
143
144
  "release": "changeset publish",
144
- "test": "vp test run",
145
+ "test": "pnpm test:suite",
145
146
  "test:aws": "pnpm test:prepare && vp test run --project runtime tests/integration/aws",
147
+ "test:aws:nightly": "RRHS_LATEST_COMPATIBLE=1 vp run test:aws",
148
+ "test:aws:nightly:docker": "docker build --file tests/nightly/aws/Dockerfile --tag react-router-hono-server-nightly-aws tests/nightly && docker run --rm --network=host --mount \"type=bind,source=$PWD,target=/source,readonly\" react-router-hono-server-nightly-aws",
146
149
  "test:bun": "pnpm test:prepare && vp test run --project runtime tests/integration/bun --no-file-parallelism",
150
+ "test:bun:nightly": "RRHS_LATEST_COMPATIBLE=1 vp run test:bun",
151
+ "test:bun:nightly:docker": "docker build --file tests/nightly/bun/Dockerfile --tag react-router-hono-server-nightly-bun tests/nightly && docker run --rm --ipc=host --network=host --mount \"type=bind,source=$PWD,target=/source,readonly\" react-router-hono-server-nightly-bun",
147
152
  "test:cloudflare": "pnpm test:prepare && vp test run --project runtime tests/integration/cloudflare",
153
+ "test:cloudflare:nightly": "RRHS_LATEST_COMPATIBLE=1 vp run test:cloudflare",
154
+ "test:cloudflare:nightly:docker": "docker build --file tests/nightly/cloudflare/Dockerfile --tag react-router-hono-server-nightly-cloudflare tests/nightly && docker run --rm --ipc=host --network=host --mount \"type=bind,source=$PWD,target=/source,readonly\" react-router-hono-server-nightly-cloudflare",
148
155
  "test:cov": "vp test run --coverage",
149
156
  "test:deno": "pnpm test:prepare && vp test run --project runtime tests/integration/deno",
157
+ "test:deno:nightly": "RRHS_LATEST_COMPATIBLE=1 vp run test:deno",
158
+ "test:deno:nightly:docker": "docker build --file tests/nightly/deno/Dockerfile --tag react-router-hono-server-nightly-deno tests/nightly && docker run --rm --ipc=host --network=host --mount \"type=bind,source=$PWD,target=/source,readonly\" react-router-hono-server-nightly-deno",
150
159
  "test:node": "pnpm test:prepare && vp test run --project runtime tests/integration/node",
160
+ "test:node:nightly": "RRHS_LATEST_COMPATIBLE=1 vp run test:node",
161
+ "test:node:nightly:docker": "docker build --file tests/nightly/node/Dockerfile --tag react-router-hono-server-nightly-node tests/nightly && docker run --rm --ipc=host --network=host --mount \"type=bind,source=$PWD,target=/source,readonly\" react-router-hono-server-nightly-node",
151
162
  "test:package": "pnpm test:prepare && pnpm test:package:prepared && vp test run --project package",
152
163
  "test:package:prepared": "publint out/test-artifacts/*.tgz && attw out/test-artifacts/*.tgz --profile esm-only",
153
164
  "test:prepare": "node tests/prepare.ts",