Releases: rphlmr/react-router-hono-server
Releases · rphlmr/react-router-hono-server
v2.26.0
Minor Changes
- 15f28de: feat: add Deno support by @ktKongTong
v2.25.3
v2.25.2
v2.25.1
v2.25.0
v2.24.1
v2.24.0
v2.23.0
v2.22.0
Minor Changes
- 179e2ea: Upgrade to latest hono
Important
To make the typing works correctly, in your react-router.config.ts or where you want, add future v8_middleware flag type to true.
declare module "react-router" {
interface Future {
v8_middleware: true; // 👈 Enable middleware types
}
}Or in your react-router.config.ts:
future: {
v8_middleware: true,
},Dependency upgrades
- Bumped Hono stack:
- hono -> 4.10.3
- @hono/node-server -> 1.19.5
- @hono/vite-dev-server -> 0.23.0
- React / Router:
- react -> 19.2.0
- react-dom -> 19.2.0
- react-router -> 7.9.4
- @react-router/dev -> 7.9.4 (examples updated)
API / Typing changes (important for consumers)
- React Router middleware typing changed from the unstable names to stable-like names:
- unstable_RouterContextProvider -> RouterContextProvider
- unstable_createContext -> createContext
- Update imports and usage where middleware context/provider was previously
unstable_*.
- To enable middleware types in consumers, declare the future flag:
- Add
v8_middleware: trueto yourreact-router.config.ts(or declare module augmentation) — README and example updated with guidance.
- Add
- If you override getLoadContext for middleware, return the new RouterContextProvider (formerly unstable_RouterContextProvider).
Breaking / required changes for consumers
- Node engine requirement increased:
- package.json engines: node >= 22.20.0
- If you rely on unstable_RouterContextProvider / unstable_createContext, update to RouterContextProvider / createContext and ensure you enable v8_middleware typing as described.
- Example projects and README were updated; follow those examples when upgrading.
Documentation
- README updated with:
- Middleware typing guidance and examples.
- Migration notes for getLoadContext changes.
- Examples updated in examples/node/simple-future-middleware to reflect new imports, config, and dependency versions.
v2.21.0
Minor Changes
- ee2abf2: Add support for React Router 7.8.0 unstable middleware changes
example:
import { unstable_RouterContextProvider, unstable_createContext } from "react-router";
import { createHonoServer } from "react-router-hono-server/node";
type GlobalAppContext = {
appVersion: string;
};
export const globalAppContext = unstable_createContext<GlobalAppContext>();
export default await createHonoServer({
getLoadContext(_c, { mode, build }) {
const isProductionMode = mode === "production";
const context = new unstable_RouterContextProvider(); // New for 7.8.0
context.set(globalAppContext, { appVersion: isProductionMode ? build.assets.version : "dev" }); // New for 7.8.0
return context; // New for 7.8.0
},
});