npm hono 4.9.0
v4.9.0

latest releases: 4.9.6, 4.9.5, 4.9.4...
28 days ago

Release Notes

Hono v4.9.0 is now available!

This release introduces several enhancements and utilities.

The main highlight is the new parseResponse utility that makes it easier to work with RPC client responses.

parseResponse Utility

The new parseResponse utility provides a convenient way to parse responses from Hono RPC clients (hc). It automatically handles different response formats and throws structured errors for failed requests.

import { parseResponse, DetailedError } from 'hono/client'

// result contains the parsed response body (automatically parsed based on Content-Type)
const result = await parseResponse(client.hello.$get()).catch(
  // parseResponse automatically throws an error if response is not ok
  (e: DetailedError) => {
    console.error(e)
  }
)

This makes working with RPC client responses much more straightforward and type-safe.

Thanks @NamesMT!

New features

  • feat(bun): allow importing upgradeWebSocket and websocket directly #4242
  • feat(aws-lambda): specify content-type as binary #4250
  • feat(jwt): add validation for the issuer (iss) claim #4253
  • feat(jwk): add headerName to JWK middleware #4279
  • feat(cookie): add generateCookie and generateSignedCookie helpers #4285
  • feat(serve-static): use join to correct path resolution #4291
  • feat(jwt): expose utility function verifyWithJwks for external use #4302
  • feat: add parseResponse util to smartly parse hc's Response #4314
  • feat(ssg): mark old hook options as deprecated #4331

All changes

  • feat(aws-lambda): specify content-type as binary by @Kanahiro in #4250
  • feat(jwt): added validation for the issuer (iss) claim by @yolocat-dev in #4253
  • feat(jwk): Add custom headerName to JWK middleware by @JoaquinGimenez1 in #4279
  • feat(cookie): generateCookie and generateSignedCookie helpers by @Soviut in #4285
  • feat(serve-static): use join to correct path resolution by @yusukebe in #4291
  • feat(jwt): Exposing utility function verifyWithJwks for external use by @Beyondo in #4302
  • feat: add parseResponse util to smartly parse hc's Response by @NamesMT in #4314
  • feat(ssg): mark old hook options as deprecated by @3w36zj6 in #4331
  • fix(bun): exports functions related to websocket by @yusukebe in #4341
  • Next by @yusukebe in #4340
  • chore: enable skipLibCheck to resolve TypeScript compilation issues by @yusukebe in #4342

New Contributors

Full Changelog: v4.8.12...v4.9.0

Don't miss a new hono release

NewReleases is sending notifications on new releases.