Bump hono from 4.11.7 to 4.12.0 by dependabot[bot] · Pull Request #657 · dependabot/fetch-metadata (original) (raw)

Bumps hono from 4.11.7 to 4.12.0.

Release notes

Sourced from hono's releases.

v4.12.0

Release Notes

Hono v4.12.0 is now available!

This release includes new features for the Hono client, middleware improvements, adapter enhancements, and significant performance improvements to the router and context.

$path for Hono Client

The Hono client now has a $path() method that returns the path string instead of a full URL. This is useful when you need just the path portion for routing or key-based operations:

const client = hc('http://localhost:8787') // Get the path string const path = client.api.posts.$path() // => '/api/posts' // With path parameters const postPath = client.api.posts[':id'].$path({ param: { id: '123' }, }) // => '/api/posts/123' // With query parameters const searchPath = client.api.posts.$path({ query: { filter: 'test' }, }) // => '/api/posts?filter=test'

Unlike $url() which returns a URL object, $path() returns a plain path string, making it convenient for use with routers or as cache keys.

Thanks @​ShaMan123!

ApplyGlobalResponse Type Helper for RPC Client

The new ApplyGlobalResponse type helper allows you to add global error response types to all routes in the RPC client. This is useful for typing common error responses from app.onError() or global middlewares:

const app = new Hono() .get('/api/users', (c) => c.json({ users: ['alice', 'bob'] }, 200)) .onError((err, c) => c.json({ error: err.message }, 500)) type AppWithErrors = ApplyGlobalResponse< typeof app, { 401: { json: { error: string; message: string } } 500: { json: { error: string; message: string } } }

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR: