Skip to content

Releases: rphlmr/react-router-hono-server

v2.26.0

26 Apr 17:29
26d2128

Choose a tag to compare

Minor Changes

v2.25.3

14 Apr 18:10
6f11fc4

Choose a tag to compare

Patch Changes

v2.25.2

16 Mar 08:51
baf20b4

Choose a tag to compare

Patch Changes

v2.25.1

12 Mar 12:29
64abc35

Choose a tag to compare

Patch Changes

v2.25.0

17 Feb 19:09
f5020a6

Choose a tag to compare

Minor Changes

  • 8a64698: ✨ feat: Added optional production graceful shutdown for bun adapter.

v2.24.1

10 Feb 13:53
6404c83

Choose a tag to compare

Patch Changes

  • f207d80: chore: 🔨 Update hono and related dependencies. Make hono a peer dep

v2.24.0

27 Jan 18:22
508209a

Choose a tag to compare

Minor Changes

  • f1f2e3d: chore: 🔨 Update hono dependencies

Patch Changes

  • 1defe62: Add compatibility with environment API being promoted to v8 instead of unstable in React Router

v2.23.0

16 Jan 11:51
3d30746

Choose a tag to compare

Minor Changes

v2.22.0

27 Oct 22:32
def85d5

Choose a tag to compare

Minor Changes

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: true to your react-router.config.ts (or declare module augmentation) — README and example updated with guidance.
  • 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

12 Aug 08:13
f937bd6

Choose a tag to compare

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
  },
});