react-router-hono-server 4.0.3 → 4.1.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/README.md +1 -1
- package/dist/adapters/aws-lambda.d.ts +1 -1
- package/dist/adapters/aws-lambda.js +1 -1
- package/dist/adapters/bun.d.ts +1 -1
- package/dist/adapters/bun.js +1 -1
- package/dist/adapters/cloudflare.d.ts +1 -1
- package/dist/adapters/cloudflare.js +1 -1
- package/dist/adapters/deno.d.ts +1 -1
- package/dist/adapters/deno.js +1 -1
- package/dist/adapters/node.d.ts +1 -1
- package/dist/adapters/node.js +1 -1
- package/dist/dev.js +1 -1
- package/dist/{helpers-D9Y2AQRk.js → helpers-3n8XqkAi.js} +7 -2
- package/dist/{helpers-VHYCCAPs.d.ts → helpers-BRZLziEZ.d.ts} +1 -1
- package/package.json +9 -7
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ Choose the runtime that matches your deployment target. Application routes and H
|
|
|
54
54
|
- Node.js 24.19 or newer is required for installation, builds, and the CLI.
|
|
55
55
|
- React 19.2, React DOM 19.2, React Router 8.3 or newer, Vite 8, and Hono 4 are supported.
|
|
56
56
|
- `@hono/node-server` 2 is installed with this package for Node-backed functionality; applications only need to install it directly when they import it themselves.
|
|
57
|
-
- Bun 1.
|
|
57
|
+
- Bun 1.4 or newer is required for Bun execution.
|
|
58
58
|
- Deno 2 is required for Deno execution.
|
|
59
59
|
- Cloudflare projects require the current `@cloudflare/vite-plugin`, Wrangler 4, an `ASSETS` binding, and the `nodejs_compat` compatibility flag.
|
|
60
60
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as WithoutWebsocket, n as HonoServerOptionsBase, t as createGetLoadContext } from "../helpers-
|
|
1
|
+
import { i as WithoutWebsocket, n as HonoServerOptionsBase, t as createGetLoadContext } from "../helpers-BRZLziEZ.js";
|
|
2
2
|
import { Env, Hono } from "hono";
|
|
3
3
|
import { LambdaContext, LambdaEvent } from "hono/aws-lambda";
|
|
4
4
|
import { BlankEnv } from "hono/types";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getBuildMode, n as bindIncomingRequestSocketInfo, o as handleChromeDevToolsWorkspaceRequest, r as createGetLoadContext, s as importBuild } from "../helpers-
|
|
1
|
+
import { a as getBuildMode, n as bindIncomingRequestSocketInfo, o as handleChromeDevToolsWorkspaceRequest, r as createGetLoadContext, s as importBuild } from "../helpers-3n8XqkAi.js";
|
|
2
2
|
import { cache } from "../middleware.js";
|
|
3
3
|
import { t as isReactRouterBuildRequest } from "../react-router-build-request-_jlIVza5.js";
|
|
4
4
|
import { serveStatic } from "@hono/node-server/serve-static";
|
package/dist/adapters/bun.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as WithoutWebsocket, n as HonoServerOptionsBase, r as WithWebsocket, t as createGetLoadContext } from "../helpers-
|
|
1
|
+
import { i as WithoutWebsocket, n as HonoServerOptionsBase, r as WithWebsocket, t as createGetLoadContext } from "../helpers-BRZLziEZ.js";
|
|
2
2
|
import { Env } from "hono";
|
|
3
3
|
import { BlankEnv } from "hono/types";
|
|
4
4
|
import { ServeStaticOptions } from "hono/serve-static";
|
package/dist/adapters/bun.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getBuildMode, i as createWebSocket, n as bindIncomingRequestSocketInfo, o as handleChromeDevToolsWorkspaceRequest, r as createGetLoadContext, s as importBuild, t as attachWebSocketToVite } from "../helpers-
|
|
1
|
+
import { a as getBuildMode, i as createWebSocket, n as bindIncomingRequestSocketInfo, o as handleChromeDevToolsWorkspaceRequest, r as createGetLoadContext, s as importBuild, t as attachWebSocketToVite } from "../helpers-3n8XqkAi.js";
|
|
2
2
|
import { cache } from "../middleware.js";
|
|
3
3
|
import { t as isReactRouterBuildRequest } from "../react-router-build-request-_jlIVza5.js";
|
|
4
4
|
import { i as viteGeneratedAssetsRoute, n as composeViteAssetRewriteRequestPath, t as classifyVitePublicPath } from "../vite-public-path-Aqd7hZ0d.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as WithoutWebsocket, n as HonoServerOptionsBase, r as WithWebsocket, t as createGetLoadContext } from "../helpers-
|
|
1
|
+
import { i as WithoutWebsocket, n as HonoServerOptionsBase, r as WithWebsocket, t as createGetLoadContext } from "../helpers-BRZLziEZ.js";
|
|
2
2
|
import { Env, Hono } from "hono";
|
|
3
3
|
import { BlankEnv } from "hono/types";
|
|
4
4
|
import { upgradeWebSocket } from "hono/cloudflare-workers";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getBuildMode, i as createWebSocket, n as bindIncomingRequestSocketInfo, o as handleChromeDevToolsWorkspaceRequest, r as createGetLoadContext, s as importBuild } from "../helpers-
|
|
1
|
+
import { a as getBuildMode, i as createWebSocket, n as bindIncomingRequestSocketInfo, o as handleChromeDevToolsWorkspaceRequest, r as createGetLoadContext, s as importBuild } from "../helpers-3n8XqkAi.js";
|
|
2
2
|
import { cache } from "../middleware.js";
|
|
3
3
|
import { i as viteGeneratedAssetsRoute, r as stripVitePathnamePrefix, t as classifyVitePublicPath } from "../vite-public-path-Aqd7hZ0d.js";
|
|
4
4
|
import { Hono } from "hono";
|
package/dist/adapters/deno.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as WithoutWebsocket, n as HonoServerOptionsBase, r as WithWebsocket, t as createGetLoadContext } from "../helpers-
|
|
1
|
+
import { i as WithoutWebsocket, n as HonoServerOptionsBase, r as WithWebsocket, t as createGetLoadContext } from "../helpers-BRZLziEZ.js";
|
|
2
2
|
import { Env, Hono } from "hono";
|
|
3
3
|
import { BlankEnv } from "hono/types";
|
|
4
4
|
import { ServeStaticOptions } from "hono/serve-static";
|
package/dist/adapters/deno.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getBuildMode, i as createWebSocket, n as bindIncomingRequestSocketInfo, o as handleChromeDevToolsWorkspaceRequest, r as createGetLoadContext, s as importBuild, t as attachWebSocketToVite } from "../helpers-
|
|
1
|
+
import { a as getBuildMode, i as createWebSocket, n as bindIncomingRequestSocketInfo, o as handleChromeDevToolsWorkspaceRequest, r as createGetLoadContext, s as importBuild, t as attachWebSocketToVite } from "../helpers-3n8XqkAi.js";
|
|
2
2
|
import { cache } from "../middleware.js";
|
|
3
3
|
import { t as isReactRouterBuildRequest } from "../react-router-build-request-_jlIVza5.js";
|
|
4
4
|
import { i as viteGeneratedAssetsRoute, n as composeViteAssetRewriteRequestPath, t as classifyVitePublicPath } from "../vite-public-path-Aqd7hZ0d.js";
|
package/dist/adapters/node.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as WithoutWebsocket, n as HonoServerOptionsBase, r as WithWebsocket, t as createGetLoadContext } from "../helpers-
|
|
1
|
+
import { i as WithoutWebsocket, n as HonoServerOptionsBase, r as WithWebsocket, t as createGetLoadContext } from "../helpers-BRZLziEZ.js";
|
|
2
2
|
import { ServerType } from "@hono/node-server";
|
|
3
3
|
import { ServeStaticOptions } from "@hono/node-server/serve-static";
|
|
4
4
|
import { Env, Hono } from "hono";
|
package/dist/adapters/node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getBuildMode, i as createWebSocket, n as bindIncomingRequestSocketInfo, o as handleChromeDevToolsWorkspaceRequest, r as createGetLoadContext, s as importBuild, t as attachWebSocketToVite } from "../helpers-
|
|
1
|
+
import { a as getBuildMode, i as createWebSocket, n as bindIncomingRequestSocketInfo, o as handleChromeDevToolsWorkspaceRequest, r as createGetLoadContext, s as importBuild, t as attachWebSocketToVite } from "../helpers-3n8XqkAi.js";
|
|
2
2
|
import { cache } from "../middleware.js";
|
|
3
3
|
import { t as isReactRouterBuildRequest } from "../react-router-build-request-_jlIVza5.js";
|
|
4
4
|
import { i as viteGeneratedAssetsRoute, n as composeViteAssetRewriteRequestPath, t as classifyVitePublicPath } from "../vite-public-path-Aqd7hZ0d.js";
|
package/dist/dev.js
CHANGED
|
@@ -134,7 +134,7 @@ function reactRouterHonoServer(options = {}) {
|
|
|
134
134
|
req.rawHeaders.push("x-remote-family", req.socket.remoteFamily || "unknown");
|
|
135
135
|
next();
|
|
136
136
|
});
|
|
137
|
-
if (typeof devServerPlugin.configureServer === "function") devServerPlugin.configureServer(server);
|
|
137
|
+
if (typeof devServerPlugin.configureServer === "function") devServerPlugin.configureServer.call(this, server);
|
|
138
138
|
else {
|
|
139
139
|
console.error("Dev server plugin configureServer hook is not a function. This is likely a bug, I guess 😅\n");
|
|
140
140
|
throw new Error("Cannot apply dev server plugin configureServer hook");
|
|
@@ -6,6 +6,11 @@ const defaultWebSocket = {
|
|
|
6
6
|
};
|
|
7
7
|
async function importNodeWebSocket(runtime, mode) {
|
|
8
8
|
try {
|
|
9
|
+
if (runtime === "bun" && typeof Bun !== "undefined") {
|
|
10
|
+
const { createRequire } = await import("node:module");
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
return require(require.resolve("ws/package.json").replace(/package\.json$/, "index.js"));
|
|
13
|
+
}
|
|
9
14
|
return await import("ws");
|
|
10
15
|
} catch (cause) {
|
|
11
16
|
throw new Error(`WebSocket support for the "${runtime}" runtime in ${mode} requires the optional "ws" peer dependency. Install "ws" before enabling useWebSocket.`, { cause });
|
|
@@ -105,9 +110,9 @@ function patchUpgradeListener(httpServer) {
|
|
|
105
110
|
const upgradeListeners = httpServer.listeners("upgrade").filter((listener) => listener.name !== "hmrServerWsListener");
|
|
106
111
|
for (const listener of upgradeListeners) {
|
|
107
112
|
httpServer.removeListener("upgrade", listener);
|
|
108
|
-
httpServer.on("upgrade", (request,
|
|
113
|
+
httpServer.on("upgrade", (request, socket, head) => {
|
|
109
114
|
if (request.headers["sec-websocket-protocol"] === "vite-hmr") return;
|
|
110
|
-
return listener(request,
|
|
115
|
+
return listener(request, socket, head);
|
|
111
116
|
});
|
|
112
117
|
}
|
|
113
118
|
}
|
|
@@ -2,7 +2,7 @@ import { ServerType } from "@hono/node-server";
|
|
|
2
2
|
import { Context, Env, Hono } from "hono";
|
|
3
3
|
import { RouterContextProvider, ServerBuild } from "react-router";
|
|
4
4
|
import { UpgradeWebSocket } from "hono/ws";
|
|
5
|
-
import
|
|
5
|
+
import "ws";
|
|
6
6
|
//#region src/types/hono-server-options-base.d.ts
|
|
7
7
|
type ReactRouterHonoServerAppLoadContext = RouterContextProvider;
|
|
8
8
|
interface HonoServerOptionsBase<E extends Env> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-router-hono-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
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": {
|
|
@@ -89,18 +89,18 @@
|
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@arethetypeswrong/cli": "0.18.5",
|
|
91
91
|
"@changesets/changelog-github": "1.0.0",
|
|
92
|
-
"@changesets/cli": "3.0.
|
|
93
|
-
"@cloudflare/workers-types": "5.
|
|
92
|
+
"@changesets/cli": "3.0.1",
|
|
93
|
+
"@cloudflare/workers-types": "5.20260819.1",
|
|
94
94
|
"@playwright/test": "1.62.1",
|
|
95
95
|
"@types/bun": "1.3.14",
|
|
96
96
|
"@types/deno": "2.7.0",
|
|
97
97
|
"@types/node": "24.13.3",
|
|
98
98
|
"@types/react-dom": "19.2.4",
|
|
99
99
|
"@types/ws": "8.18.1",
|
|
100
|
-
"@vitest/coverage-v8": "4.1.
|
|
101
|
-
"hono": "4.13.
|
|
100
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
101
|
+
"hono": "4.13.3",
|
|
102
102
|
"npm-run-all": "4.1.5",
|
|
103
|
-
"publint": "0.3.
|
|
103
|
+
"publint": "0.3.24",
|
|
104
104
|
"react": "19.2.8",
|
|
105
105
|
"react-dom": "19.2.8",
|
|
106
106
|
"typescript": "6.0.3",
|
|
@@ -126,6 +126,8 @@
|
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
128
|
"engines": {
|
|
129
|
+
"bun": ">=1.4.0",
|
|
130
|
+
"deno": ">=2.0.0",
|
|
129
131
|
"node": ">=24.19.0"
|
|
130
132
|
},
|
|
131
133
|
"scripts": {
|
|
@@ -141,7 +143,7 @@
|
|
|
141
143
|
"release": "changeset publish",
|
|
142
144
|
"test": "vp test run",
|
|
143
145
|
"test:aws": "pnpm test:prepare && vp test run --project runtime tests/integration/aws",
|
|
144
|
-
"test:bun": "pnpm test:prepare && vp test run --project runtime tests/integration/bun",
|
|
146
|
+
"test:bun": "pnpm test:prepare && vp test run --project runtime tests/integration/bun --no-file-parallelism",
|
|
145
147
|
"test:cloudflare": "pnpm test:prepare && vp test run --project runtime tests/integration/cloudflare",
|
|
146
148
|
"test:cov": "vp test run --coverage",
|
|
147
149
|
"test:deno": "pnpm test:prepare && vp test run --project runtime tests/integration/deno",
|