honojs/hono
### [`v2.1.4`](https://togithub.com/honojs/hono/releases/tag/v2.1.4)
[Compare Source](https://togithub.com/honojs/hono/compare/v2.1.3...v2.1.4)
#### Summary
Performance tuning!
This release includes performance improvement. "Hello World" will be 11% faster and `c.req.query` 25% faster on Bun. Of course, it becomes faster on Deno.
#### What's Changed
- perf: do not `compose` if it has only one handler by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/493](https://togithub.com/honojs/hono/pull/493)
- fix: fixed the issue logger called twice by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/494](https://togithub.com/honojs/hono/pull/494)
- perf(compose): Remove `await composed()` from hono.ts. by [@usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/495](https://togithub.com/honojs/hono/pull/495)
- perf(compose): Always return a Promise without async. by [@usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/496](https://togithub.com/honojs/hono/pull/496)
- perf(req): improve `c.req.query` performance by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/498](https://togithub.com/honojs/hono/pull/498)
- Fix regexp ambigous route by [@usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/499](https://togithub.com/honojs/hono/pull/499)
**Full Changelog**: https://github.com/honojs/hono/compare/v2.1.3...v2.1.4
### [`v2.1.3`](https://togithub.com/honojs/hono/releases/tag/v2.1.3)
[Compare Source](https://togithub.com/honojs/hono/compare/v2.1.2...v2.1.3)
#### Summary
This is a patch release including minor bug fixes.
#### What's Changed
- fix app.HTTP_METHOD type by [@azukiazusa1](https://togithub.com/azukiazusa1) in [https://github.com/honojs/hono/pull/490](https://togithub.com/honojs/hono/pull/490)
- fix(compose): do not handle the error in `compose` by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/491](https://togithub.com/honojs/hono/pull/491)
#### New Contributors
- [@azukiazusa1](https://togithub.com/azukiazusa1) made their first contribution in [https://github.com/honojs/hono/pull/490](https://togithub.com/honojs/hono/pull/490)
**Full Changelog**: https://github.com/honojs/hono/compare/v2.1.2...v2.1.3
### [`v2.1.2`](https://togithub.com/honojs/hono/releases/tag/v2.1.2)
[Compare Source](https://togithub.com/honojs/hono/compare/v2.1.1...v2.1.2)
##### Summary
This is also a patch release.
##### What's Changed
- fix(context): fix type error by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/489](https://togithub.com/honojs/hono/pull/489)
**Full Changelog**: https://github.com/honojs/hono/compare/v2.1.1...v2.1.2
### [`v2.1.1`](https://togithub.com/honojs/hono/releases/tag/v2.1.1)
[Compare Source](https://togithub.com/honojs/hono/compare/v2.1.0...v2.1.1)
#### Summary
This is a patch release. Fixed type errors.
#### What's Changed
- fix(type): fix type errors for Bindings and Variables by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/488](https://togithub.com/honojs/hono/pull/488)
**Full Changelog**: https://github.com/honojs/hono/compare/v2.1.0...v2.1.1
### [`v2.1.0`](https://togithub.com/honojs/hono/releases/tag/v2.1.0)
[Compare Source](https://togithub.com/honojs/hono/compare/v2.0.9...v2.1.0)
#### BREAKING CHANGES
This release has the breaking changes. Please see the migration guide for more detail:
- [Migration Guide](https://togithub.com/honojs/hono/blob/main/docs/MIGRATION.md#v209-to-v210)
#### Summary
- TrieRouter is 9~10% faster.
- Enable adding types to `c.set`/`c.get` by passing the Generics to `new Hono`. [#472](https://togithub.com/honojs/hono/issues/472)
- `c.req.parseBody` parses only FormData. Does not parse JSON, text, or ArrayBuffer. [#487](https://togithub.com/honojs/hono/issues/487)
#### Types for c.set/c.get
Now, we can add the types to the variables used in `c.set` and `c.get`. `new Hono` receive the Generics for the variables and bindings which is for environment variables for Cloudflare Workers.
```ts
type Bindings = {
KV: KVNamespace
Storage: R2Bucket
}
type WebClient = {
user: string
pass: string
}
type Variables = {
client: WebClient
}
const app = new Hono<{ Variables: Variables; Bindings: Bindings }>()
app.get('/foo', (c) => {
const client = c.get('client') // client is WebClient
const kv = c.env.KV // kv is KVNamespace
//...
})
```
#### `c.req.parseBody`
Now, `c.req.parseBody` has become only for parsing FormData. We have to parse the request body explicitly.
```ts
// `multipart/form` or `application/x-www-form-urlencoded`
const data = await c.req.parseBody()
const jsonData = await c.req.json() // for JSON body
const text = await c.req.text() // for text body
const arrayBuffer = await c.req.arrayBuffer() // for ArrayBuffer
```
#### What's Changed
- perf(trie-router): fine tuning, 9~10% faster by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/473](https://togithub.com/honojs/hono/pull/473)
- fix(context): export `ContextVariableMap` correctly by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/476](https://togithub.com/honojs/hono/pull/476)
- feat(types): enable adding Types for variables used in `c.set`/`c.get` by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/478](https://togithub.com/honojs/hono/pull/478)
- fix: enable passing Generics to c.req.parseBody, default is any by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/481](https://togithub.com/honojs/hono/pull/481)
- docs(readme): add discord and twitter links by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/485](https://togithub.com/honojs/hono/pull/485)
- \[BREAKING] fix: make that `c.req.parseBody` parses only `FormData` by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/487](https://togithub.com/honojs/hono/pull/487)
**Full Changelog**: https://github.com/honojs/hono/compare/v2.0.9...v2.1.0
### [`v2.0.9`](https://togithub.com/honojs/hono/releases/tag/v2.0.9)
[Compare Source](https://togithub.com/honojs/hono/compare/v2.0.8...v2.0.9)
##### Summary
**Performance improvement** - We have revised the await/async process so that it is faster in some situations.
It has been 8-9% faster in the benchmark:
hono - trie-router(default) x 393,919 ops/sec ±4.52% (86 runs sampled)
hono - regexp-router x 478,140 ops/sec ±2.85% (83 runs sampled)
hono optimized - trie-router(default) x 427,940 ops/sec ±4.32% (81 runs sampled)
hono optimized - regexp-router x 512,488 ops/sec ±5.28% (75 runs sampled)
Fastest is hono optimized - regexp-router
✨ Done in 28.36s.
On Bun, it has been 15% faster.
Before: Requests/sec: 57043.0018
After: Requests/sec: 65658.9860
##### What's Changed
- fix(context): fixed `ContextVariableMap` is not enabled in built code by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/465](https://togithub.com/honojs/hono/pull/465)
- perf(compose): optimize `await` by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/466](https://togithub.com/honojs/hono/pull/466)
- docs(readme): update benchmark results by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/467](https://togithub.com/honojs/hono/pull/467)
- chore: add `FUNDING.yml` by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/468](https://togithub.com/honojs/hono/pull/468)
- fix(compose): Support a handler that non-async and returning a promise. by [@usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/469](https://togithub.com/honojs/hono/pull/469)
**Full Changelog**: https://github.com/honojs/hono/compare/v2.0.8...v2.0.9
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, click this checkbox.
This PR has been generated by Mend Renovate. View repository job log here.
This PR contains the following updates:
2.0.8
->2.1.4
Release Notes
honojs/hono
### [`v2.1.4`](https://togithub.com/honojs/hono/releases/tag/v2.1.4) [Compare Source](https://togithub.com/honojs/hono/compare/v2.1.3...v2.1.4) #### Summary Performance tuning! This release includes performance improvement. "Hello World" will be 11% faster and `c.req.query` 25% faster on Bun. Of course, it becomes faster on Deno. #### What's Changed - perf: do not `compose` if it has only one handler by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/493](https://togithub.com/honojs/hono/pull/493) - fix: fixed the issue logger called twice by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/494](https://togithub.com/honojs/hono/pull/494) - perf(compose): Remove `await composed()` from hono.ts. by [@usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/495](https://togithub.com/honojs/hono/pull/495) - perf(compose): Always return a Promise without async. by [@usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/496](https://togithub.com/honojs/hono/pull/496) - perf(req): improve `c.req.query` performance by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/498](https://togithub.com/honojs/hono/pull/498) - Fix regexp ambigous route by [@usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/499](https://togithub.com/honojs/hono/pull/499) **Full Changelog**: https://github.com/honojs/hono/compare/v2.1.3...v2.1.4 ### [`v2.1.3`](https://togithub.com/honojs/hono/releases/tag/v2.1.3) [Compare Source](https://togithub.com/honojs/hono/compare/v2.1.2...v2.1.3) #### Summary This is a patch release including minor bug fixes. #### What's Changed - fix app.HTTP_METHOD type by [@azukiazusa1](https://togithub.com/azukiazusa1) in [https://github.com/honojs/hono/pull/490](https://togithub.com/honojs/hono/pull/490) - fix(compose): do not handle the error in `compose` by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/491](https://togithub.com/honojs/hono/pull/491) #### New Contributors - [@azukiazusa1](https://togithub.com/azukiazusa1) made their first contribution in [https://github.com/honojs/hono/pull/490](https://togithub.com/honojs/hono/pull/490) **Full Changelog**: https://github.com/honojs/hono/compare/v2.1.2...v2.1.3 ### [`v2.1.2`](https://togithub.com/honojs/hono/releases/tag/v2.1.2) [Compare Source](https://togithub.com/honojs/hono/compare/v2.1.1...v2.1.2) ##### Summary This is also a patch release. ##### What's Changed - fix(context): fix type error by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/489](https://togithub.com/honojs/hono/pull/489) **Full Changelog**: https://github.com/honojs/hono/compare/v2.1.1...v2.1.2 ### [`v2.1.1`](https://togithub.com/honojs/hono/releases/tag/v2.1.1) [Compare Source](https://togithub.com/honojs/hono/compare/v2.1.0...v2.1.1) #### Summary This is a patch release. Fixed type errors. #### What's Changed - fix(type): fix type errors for Bindings and Variables by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/488](https://togithub.com/honojs/hono/pull/488) **Full Changelog**: https://github.com/honojs/hono/compare/v2.1.0...v2.1.1 ### [`v2.1.0`](https://togithub.com/honojs/hono/releases/tag/v2.1.0) [Compare Source](https://togithub.com/honojs/hono/compare/v2.0.9...v2.1.0) #### BREAKING CHANGES This release has the breaking changes. Please see the migration guide for more detail: - [Migration Guide](https://togithub.com/honojs/hono/blob/main/docs/MIGRATION.md#v209-to-v210) #### Summary - TrieRouter is 9~10% faster. - Enable adding types to `c.set`/`c.get` by passing the Generics to `new Hono`. [#472](https://togithub.com/honojs/hono/issues/472) - `c.req.parseBody` parses only FormData. Does not parse JSON, text, or ArrayBuffer. [#487](https://togithub.com/honojs/hono/issues/487) #### Types for c.set/c.get Now, we can add the types to the variables used in `c.set` and `c.get`. `new Hono` receive the Generics for the variables and bindings which is for environment variables for Cloudflare Workers. ```ts type Bindings = { KV: KVNamespace Storage: R2Bucket } type WebClient = { user: string pass: string } type Variables = { client: WebClient } const app = new Hono<{ Variables: Variables; Bindings: Bindings }>() app.get('/foo', (c) => { const client = c.get('client') // client is WebClient const kv = c.env.KV // kv is KVNamespace //... }) ``` #### `c.req.parseBody` Now, `c.req.parseBody` has become only for parsing FormData. We have to parse the request body explicitly. ```ts // `multipart/form` or `application/x-www-form-urlencoded` const data = await c.req.parseBody() const jsonData = await c.req.json() // for JSON body const text = await c.req.text() // for text body const arrayBuffer = await c.req.arrayBuffer() // for ArrayBuffer ``` #### What's Changed - perf(trie-router): fine tuning, 9~10% faster by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/473](https://togithub.com/honojs/hono/pull/473) - fix(context): export `ContextVariableMap` correctly by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/476](https://togithub.com/honojs/hono/pull/476) - feat(types): enable adding Types for variables used in `c.set`/`c.get` by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/478](https://togithub.com/honojs/hono/pull/478) - fix: enable passing Generics to c.req.parseBody, default is any by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/481](https://togithub.com/honojs/hono/pull/481) - docs(readme): add discord and twitter links by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/485](https://togithub.com/honojs/hono/pull/485) - \[BREAKING] fix: make that `c.req.parseBody` parses only `FormData` by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/487](https://togithub.com/honojs/hono/pull/487) **Full Changelog**: https://github.com/honojs/hono/compare/v2.0.9...v2.1.0 ### [`v2.0.9`](https://togithub.com/honojs/hono/releases/tag/v2.0.9) [Compare Source](https://togithub.com/honojs/hono/compare/v2.0.8...v2.0.9) ##### Summary **Performance improvement** - We have revised the await/async process so that it is faster in some situations. It has been 8-9% faster in the benchmark: hono - trie-router(default) x 393,919 ops/sec ±4.52% (86 runs sampled) hono - regexp-router x 478,140 ops/sec ±2.85% (83 runs sampled) hono optimized - trie-router(default) x 427,940 ops/sec ±4.32% (81 runs sampled) hono optimized - regexp-router x 512,488 ops/sec ±5.28% (75 runs sampled) Fastest is hono optimized - regexp-router ✨ Done in 28.36s. On Bun, it has been 15% faster. Before: Requests/sec: 57043.0018 After: Requests/sec: 65658.9860 ##### What's Changed - fix(context): fixed `ContextVariableMap` is not enabled in built code by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/465](https://togithub.com/honojs/hono/pull/465) - perf(compose): optimize `await` by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/466](https://togithub.com/honojs/hono/pull/466) - docs(readme): update benchmark results by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/467](https://togithub.com/honojs/hono/pull/467) - chore: add `FUNDING.yml` by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/468](https://togithub.com/honojs/hono/pull/468) - fix(compose): Support a handler that non-async and returning a promise. by [@usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/469](https://togithub.com/honojs/hono/pull/469) **Full Changelog**: https://github.com/honojs/hono/compare/v2.0.8...v2.0.9Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.