Skip to content

Conversation

@rphlmr
Copy link
Owner

@rphlmr rphlmr commented Oct 27, 2025

Changelog

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
 }
}

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.

- Changed the middleware flag from `unstable_middleware` to `v8_middleware` in `react-router.config.ts` to align with the latest API changes.
- Updated documentation in `hono-server-options-base.d.ts` to reflect the new configuration requirement for enabling middleware types.
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 27, 2025

Open in StackBlitz

pnpm add https://pkg.pr.new/rphlmr/react-router-hono-server@161

commit: 481eee0

@rphlmr rphlmr merged commit 179e2ea into main Oct 27, 2025
4 checks passed
@rphlmr rphlmr deleted the feat/hono-update branch October 27, 2025 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants