react-router-hono-server 2.8.2 → 2.8.4
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/dist/adapters/aws-lambda.d.ts +1 -1
- package/dist/adapters/aws-lambda.js +2 -1
- package/dist/adapters/bun.d.ts +1 -1
- package/dist/adapters/bun.js +2 -1
- package/dist/adapters/cloudflare.d.ts +1 -1
- package/dist/adapters/cloudflare.js +2 -1
- package/dist/adapters/node.d.ts +1 -1
- package/dist/adapters/node.js +2 -1
- package/dist/chunk-FTA5RKYX.js +8 -0
- package/dist/{chunk-DZZCDCBI.js → chunk-GGTBX2N2.js} +7 -1
- package/dist/dev.js +17 -4
- package/dist/http.js +2 -0
- package/dist/middleware.js +1 -0
- package/dist/react-EHUEJIYR.js +1584 -0
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import * as hono_aws_lambda from 'hono/aws-lambda';
|
|
|
2
2
|
import * as hono_types from 'hono/types';
|
|
3
3
|
import { BlankEnv } from 'hono/types';
|
|
4
4
|
import { Env, Hono } from 'hono';
|
|
5
|
-
import {
|
|
5
|
+
import { H as HonoServerOptionsBase, W as WithoutWebsocket } from '../helpers-DZ1r-Y-D.js';
|
|
6
6
|
export { c as createGetLoadContext } from '../helpers-DZ1r-Y-D.js';
|
|
7
7
|
import 'react-router';
|
|
8
8
|
import 'hono/ws';
|
|
@@ -2,10 +2,11 @@ import {
|
|
|
2
2
|
bindIncomingRequestSocketInfo,
|
|
3
3
|
createGetLoadContext,
|
|
4
4
|
importBuild
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-GGTBX2N2.js";
|
|
6
6
|
import {
|
|
7
7
|
cache
|
|
8
8
|
} from "../chunk-V3H4JZ4H.js";
|
|
9
|
+
import "../chunk-FTA5RKYX.js";
|
|
9
10
|
|
|
10
11
|
// src/adapters/aws-lambda.ts
|
|
11
12
|
import { serveStatic } from "@hono/node-server/serve-static";
|
package/dist/adapters/bun.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Serve, ServeOptions } from 'bun';
|
|
2
2
|
import { Env } from 'hono';
|
|
3
3
|
import { BlankEnv } from 'hono/types';
|
|
4
|
-
import {
|
|
4
|
+
import { H as HonoServerOptionsBase, a as WithWebsocket, W as WithoutWebsocket } from '../helpers-DZ1r-Y-D.js';
|
|
5
5
|
export { c as createGetLoadContext } from '../helpers-DZ1r-Y-D.js';
|
|
6
6
|
import 'react-router';
|
|
7
7
|
import 'hono/ws';
|
package/dist/adapters/bun.js
CHANGED
|
@@ -5,10 +5,11 @@ import {
|
|
|
5
5
|
createWebSocket,
|
|
6
6
|
importBuild,
|
|
7
7
|
patchUpgradeListener
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-GGTBX2N2.js";
|
|
9
9
|
import {
|
|
10
10
|
cache
|
|
11
11
|
} from "../chunk-V3H4JZ4H.js";
|
|
12
|
+
import "../chunk-FTA5RKYX.js";
|
|
12
13
|
|
|
13
14
|
// src/adapters/bun.ts
|
|
14
15
|
import { Hono } from "hono";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as hono_types from 'hono/types';
|
|
2
2
|
import { BlankEnv } from 'hono/types';
|
|
3
3
|
import { Env, Hono } from 'hono';
|
|
4
|
-
import {
|
|
4
|
+
import { H as HonoServerOptionsBase, W as WithoutWebsocket } from '../helpers-DZ1r-Y-D.js';
|
|
5
5
|
export { c as createGetLoadContext } from '../helpers-DZ1r-Y-D.js';
|
|
6
6
|
import 'react-router';
|
|
7
7
|
import 'hono/ws';
|
|
@@ -2,10 +2,11 @@ import {
|
|
|
2
2
|
bindIncomingRequestSocketInfo,
|
|
3
3
|
createGetLoadContext,
|
|
4
4
|
importBuild
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-GGTBX2N2.js";
|
|
6
6
|
import {
|
|
7
7
|
cache
|
|
8
8
|
} from "../chunk-V3H4JZ4H.js";
|
|
9
|
+
import "../chunk-FTA5RKYX.js";
|
|
9
10
|
|
|
10
11
|
// src/adapters/cloudflare.ts
|
|
11
12
|
import { Hono } from "hono";
|
package/dist/adapters/node.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { AddressInfo } from 'node:net';
|
|
|
2
2
|
import { ServerType } from '@hono/node-server';
|
|
3
3
|
import { Env, Hono } from 'hono';
|
|
4
4
|
import { BlankEnv } from 'hono/types';
|
|
5
|
-
import {
|
|
5
|
+
import { H as HonoServerOptionsBase, a as WithWebsocket, W as WithoutWebsocket } from '../helpers-DZ1r-Y-D.js';
|
|
6
6
|
export { c as createGetLoadContext } from '../helpers-DZ1r-Y-D.js';
|
|
7
7
|
import { ServerOptions, createServer } from 'node:http';
|
|
8
8
|
import { ServerOptions as ServerOptions$2, createServer as createServer$2, SecureServerOptions, createSecureServer } from 'node:http2';
|
package/dist/adapters/node.js
CHANGED
|
@@ -5,10 +5,11 @@ import {
|
|
|
5
5
|
createWebSocket,
|
|
6
6
|
importBuild,
|
|
7
7
|
patchUpgradeListener
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-GGTBX2N2.js";
|
|
9
9
|
import {
|
|
10
10
|
cache
|
|
11
11
|
} from "../chunk-V3H4JZ4H.js";
|
|
12
|
+
import "../chunk-FTA5RKYX.js";
|
|
12
13
|
|
|
13
14
|
// src/adapters/node.ts
|
|
14
15
|
import { serve } from "@hono/node-server";
|
|
@@ -87,6 +87,11 @@ async function importBuild() {
|
|
|
87
87
|
function createGetLoadContext(getLoadContext) {
|
|
88
88
|
return getLoadContext;
|
|
89
89
|
}
|
|
90
|
+
async function getReactVersion() {
|
|
91
|
+
const reactPackage = await import("./react-EHUEJIYR.js");
|
|
92
|
+
const version = reactPackage.default.version || reactPackage.version;
|
|
93
|
+
return Number.parseInt(version.split(".")[0]);
|
|
94
|
+
}
|
|
90
95
|
|
|
91
96
|
export {
|
|
92
97
|
createWebSocket,
|
|
@@ -94,5 +99,6 @@ export {
|
|
|
94
99
|
patchUpgradeListener,
|
|
95
100
|
bindIncomingRequestSocketInfo,
|
|
96
101
|
importBuild,
|
|
97
|
-
createGetLoadContext
|
|
102
|
+
createGetLoadContext,
|
|
103
|
+
getReactVersion
|
|
98
104
|
};
|
package/dist/dev.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getReactVersion
|
|
3
|
+
} from "./chunk-GGTBX2N2.js";
|
|
4
|
+
import "./chunk-FTA5RKYX.js";
|
|
5
|
+
|
|
1
6
|
// src/dev.ts
|
|
2
7
|
import fs from "node:fs";
|
|
3
8
|
import path from "node:path";
|
|
@@ -28,7 +33,7 @@ function reactRouterHonoServer(options = {}) {
|
|
|
28
33
|
`;
|
|
29
34
|
}
|
|
30
35
|
},
|
|
31
|
-
config(config) {
|
|
36
|
+
async config(config) {
|
|
32
37
|
pluginConfig = resolvePluginConfig(config, options);
|
|
33
38
|
if (!pluginConfig) {
|
|
34
39
|
return;
|
|
@@ -62,12 +67,17 @@ Please add it to your plugins: import { cloudflareDevProxy } from "@react-router
|
|
|
62
67
|
if (reactRouterBuildFile === "index.js") {
|
|
63
68
|
reactRouterBuildFile = "assets/server-build.js";
|
|
64
69
|
}
|
|
70
|
+
let alias = void 0;
|
|
71
|
+
if (runtime === "cloudflare") {
|
|
72
|
+
const reactVersion = await getReactVersion();
|
|
73
|
+
alias = {
|
|
74
|
+
"react-dom/server": reactVersion >= 19 ? "react-dom/server.edge" : "react-dom/server.browser"
|
|
75
|
+
};
|
|
76
|
+
}
|
|
65
77
|
return {
|
|
66
78
|
...baseConfig,
|
|
67
79
|
resolve: {
|
|
68
|
-
alias
|
|
69
|
-
"react-dom/server": "react-dom/server.browser"
|
|
70
|
-
} : void 0
|
|
80
|
+
alias
|
|
71
81
|
},
|
|
72
82
|
build: {
|
|
73
83
|
// https://vite.dev/config/build-options#build-target
|
|
@@ -97,6 +107,9 @@ Please add it to your plugins: import { cloudflareDevProxy } from "@react-router
|
|
|
97
107
|
const buildPath = path.join(pluginConfig.rootDirectory, pluginConfig.buildDirectory, "server", "index.js");
|
|
98
108
|
let content = await fs.promises.readFile(buildPath, "utf-8");
|
|
99
109
|
content = content.replace(reactRouterExport, "");
|
|
110
|
+
if (await getReactVersion() >= 19) {
|
|
111
|
+
content = content.replace(/react-dom\/server\.browser/g, "react-dom/server.edge");
|
|
112
|
+
}
|
|
100
113
|
await fs.promises.writeFile(buildPath, content);
|
|
101
114
|
console.log("\x1B[32mAll done!\x1B[0m");
|
|
102
115
|
},
|
package/dist/http.js
CHANGED