Summary
This is a patch release but includes small new features.
Improve app.route()
We can specify "base path" with app.route
:
const api = new Hono().route('/api')
const route = api.get('/search', (c) => c.jsonT({ ok: true }))
type AppType = typeof route
const client = hc<AppType>('/')
client.api.search.$get()
Improve handling types
jsonT()
does not allow non-JSON object such as Date
:
If $get()
needs arguments but it's blank, it throw the type error.
What's Changed
- chore: update sponsor link by @yusukebe in #931
- feat: Improve route() by @usualoma in #929
- fix: add missing
MergePath
by @yusukebe in #936 - fix: let the app.request behave the same as fetch by @tangye1234 in #933
- feat(
jsonT
): check JSON type by @yusukebe in #939 - fix(client): show type error if
$get()
needs args by @yusukebe in #937 - fix(pages/nextjs): don't use
route()
if path is not passed by @yusukebe in #943
New Contributors
- @tangye1234 made their first contribution in #933
Full Changelog: v3.0.2...v3.0.3