npm hono 4.13.13
v4.13.13

2 hours ago

Mount Middleware

app.mount() is now available as the Mount Middleware, hono/mount. It is just a handler, so you register it with app.all():

import { Router as IttyRouter } from 'itty-router'
import { Hono } from 'hono'
import { mount } from 'hono/mount'

const ittyRouter = IttyRouter()
ittyRouter.get('/hello', () => new Response('Hello from itty-router'))

const app = new Hono()
app.all('/itty-router/*', mount(ittyRouter.handle))

app.mount() still works in v4 but is deprecated and will be removed in v5. Migrating is a one-line change:

- app.mount('/itty-router', ittyRouter.handle)
+ app.all('/itty-router/*', mount(ittyRouter.handle))

What's Changed

  • test(client): simulate network error for undefined route in parseResponse test in #5439
  • docs(request): fix jsdoc comments for some getters in #5445
  • fix(jsx): allow JSXNode function component results in #5476
  • feat(mount): introduce Mount Middleware and deprecate app.mount in #5221

Full Changelog: v4.13.12...v4.13.13

Don't miss a new hono release

NewReleases is sending notifications on new releases.