OpenAIHonoApr 15, 2026, 5:27 AM

v4.12.13

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

openaienmodel: gpt-5-mini-2025-08-07

v4.12.13 — Type fixes, trailing-slash skip, cache callback

Key Points

  • Type inference fixed for app.on handlers
  • trailing-slash middleware gains skip option
  • cache adds onCacheNotAvailable callback

Summary

This release (v4.12.13) includes a TypeScript typing fix for handler response inference and two new feature additions: a skip option for the trailing-slash middleware and an onCacheNotAvailable callback for caching behavior. No breaking changes are indicated.

Key Points

  • fix(types): Type inference for app.on now derives the response type from the last handler in the 9-/10-handler overloads.
    • If you depend on accurate response typings from long handler-chains, you should see improved inference; adjust any manual generics if you previously worked around the issue.
  • feat(trailing-slash): Added a skip option to the trailing-slash middleware.
    • Use skip to conditionally bypass trailing-slash handling for specific requests, e.g. trailingSlash({ skip: req => req.url.startsWith('/api') }).
  • feat(cache): Added onCacheNotAvailable option.
    • Provide a callback to handle cases where the cache is unavailable: cache({ onCacheNotAvailable: (req, ctx) => { /* fallback logic */ } }).

Upgrade Notes

  • These are additive and intended to be backward compatible. Verify TypeScript typings in code paths that rely on long handler overloads and remove any prior manual workarounds if they are now redundant.

Contributors

  • yusukebe (release author)
  • T4ko0522 (first-time contributor)

Full Translation

Translations

A translation section that keeps the flow of the original article.

openaijamodel: gpt-5-mini-2025-08-07

v4.12.13

リリース v4.12.13

  • 公開日: 2026-04-15T05:27:21.000Z
  • リリース担当: @yusukebe
  • 備考: このリリース以降、main に 3 コミットがあります

変更点

  • fix(types): infer response type from last handler in app.on 9-/10-handler overloads by @T4ko0522 in #4865

    • 説明: app.on の 9-/10-handler オーバーロードにおいて、最後のハンドラからレスポンスタイプを推論するよう修正されました。
  • feat(trailing-slash): add skip option by @yusukebe in #4862

    • 説明: Trailing slash の処理に skip オプションが追加されました。
  • feat(cache): add onCacheNotAvailable option by @yusukebe in #4876

    • 説明: キャッシュが利用不可の場合に呼ばれる onCacheNotAvailable オプションが追加されました。

新しい貢献者

  • @T4ko0522 — 初回の貢献 (#4865)

フル Changelog

  • v4.12.12...v4.12.13

貢献者

  • yusukebe
  • T4ko0522

アセット

  • Assets: 2

リアクション

  • ❤️ 1 (sant123 によるリアクション)