honojs/hono (hono)
### [`v4.2.1`](https://togithub.com/honojs/hono/releases/tag/v4.2.1)
[Compare Source](https://togithub.com/honojs/hono/compare/v4.2.0...v4.2.1)
#### What's Changed
- fix(jws): Only import necessary helper (not all helpers) by [@nicksrandall](https://togithub.com/nicksrandall) in [https://github.com/honojs/hono/pull/2458](https://togithub.com/honojs/hono/pull/2458)
#### New Contributors
- [@nicksrandall](https://togithub.com/nicksrandall) made their first contribution in [https://github.com/honojs/hono/pull/2458](https://togithub.com/honojs/hono/pull/2458)
**Full Changelog**: https://github.com/honojs/hono/compare/v4.2.0...v4.2.1
### [`v4.2.0`](https://togithub.com/honojs/hono/releases/tag/v4.2.0)
[Compare Source](https://togithub.com/honojs/hono/compare/v4.1.7...v4.2.0)
Hono v4.2.0 is now available! Let's take a look at the new features.
##### Added more algorithms for JWT
The number of algorithms that JWT util can handle has increased from only 3 to 13! This means that JWT util now implements many of the algorithms supported by JWT.
- HS256
- HS384
- HS512
- RS256
- RS384
- RS512
- PS256
- PS384
- PS512
- ES256
- ES384
- ES512
- EdDSA
You can use these algorithms from the JWT middleware or JWT helpers. Thanks [@Code-Hex](https://togithub.com/Code-Hex)!
##### Method Override Middleware
[Method Override Middleware](https://hono.dev/middleware/builtin/method-override) has been added. This middleware override the method of the real request with the specified method.
HTML `form` does not allow you to send a DELETE method request. Instead, by sending an input with `name` as `_method` and a value of `DELETE`, you can call the handler registered in `app.delete()`.
```ts
const app = new Hono()
// If no options are specified, the value of `_method` in the form,
// e.g. DELETE, is used as the method.
app.use('/posts', methodOverride({ app }))
app.delete('/posts', (c) => {
// ....
})
```
##### Trailing Slash Middleware
[Trailing Slash Middleware](https://hono.dev/middleware/builtin/trailing-slash) resolves the handling of Trailing Slashes in GET requests. You can use `appendTrailingSlash` and `trimTrailingSlash` functions.
For example, it redirects a GET request to `/about/me` to `/about/me/`.
```ts
import { Hono } from 'hono'
import { appendTrailingSlash } from 'hono/trailing-slash'
const app = new Hono({ strict: true })
app.use(appendTrailingSlash())
app.get('/about/me/', (c) => c.text('With Trailing Slash'))
```
Thanks [@rnmeow](https://togithub.com/rnmeow)!
##### Other features
- SSG Helper - Support `extensionMap` [https://github.com/honojs/hono/pull/2382](https://togithub.com/honojs/hono/pull/2382)
- JSX/DOM - Add `userId` hook [https://github.com/honojs/hono/pull/2389](https://togithub.com/honojs/hono/pull/2389)
- JWT Middleware - Improve error handling [https://github.com/honojs/hono/pull/2406](https://togithub.com/honojs/hono/pull/2406)
- Request - Cache the body for re-using [https://github.com/honojs/hono/pull/2416](https://togithub.com/honojs/hono/pull/2416)
- JWT Util - Add type helper to `payload` [https://github.com/honojs/hono/pull/2424](https://togithub.com/honojs/hono/pull/2424)
- CORS Middleware - Pass context to `options.origin` function [https://github.com/honojs/hono/pull/2436](https://togithub.com/honojs/hono/pull/2436)
- Cache Middleware - Support for the `vary` header option [https://github.com/honojs/hono/pull/2426](https://togithub.com/honojs/hono/pull/2426)
- HTTP Exception - Add `cause` option [https://github.com/honojs/hono/pull/2224](https://togithub.com/honojs/hono/pull/2224)
- Logger - Support `NO_COLOR` [https://github.com/honojs/hono/pull/2228](https://togithub.com/honojs/hono/pull/2228)
- JWT Middleware - Add `JwtTokenInvalid` object as `cause` when JWT is invalid [https://github.com/honojs/hono/pull/2448](https://togithub.com/honojs/hono/pull/2448)
- Bearer Auth Middleware - Add `verifyToken` option [https://github.com/honojs/hono/pull/2449](https://togithub.com/honojs/hono/pull/2449)
- Basic Auth Middleware - Add `verifyUser` option [https://github.com/honojs/hono/pull/2450](https://togithub.com/honojs/hono/pull/2450)
##### All Updates
- feat(jwt): supported RS256, RS384, RS512 algorithm for JWT by [@Code-Hex](https://togithub.com/Code-Hex) in [https://github.com/honojs/hono/pull/2339](https://togithub.com/honojs/hono/pull/2339)
- added remain algorithm for JWT by [@Code-Hex](https://togithub.com/Code-Hex) in [https://github.com/honojs/hono/pull/2352](https://togithub.com/honojs/hono/pull/2352)
- acceptable CryptoKey in JWT sign and verify by [@Code-Hex](https://togithub.com/Code-Hex) in [https://github.com/honojs/hono/pull/2373](https://togithub.com/honojs/hono/pull/2373)
- feat(ssg): Support `extentionMap` by [@watany-dev](https://togithub.com/watany-dev) in [https://github.com/honojs/hono/pull/2382](https://togithub.com/honojs/hono/pull/2382)
- feat(jwt): support remaining algorithms by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2368](https://togithub.com/honojs/hono/pull/2368)
- feat(jsx): add useId hook by [@usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/2389](https://togithub.com/honojs/hono/pull/2389)
- feat(middleware/jwt): improve error handling by [@tfkhdyt](https://togithub.com/tfkhdyt) in [https://github.com/honojs/hono/pull/2406](https://togithub.com/honojs/hono/pull/2406)
- feat(request): cache body for reusing by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2416](https://togithub.com/honojs/hono/pull/2416)
- feat(jwt): Add type helper to `payload` by [@nakasyou](https://togithub.com/nakasyou) in [https://github.com/honojs/hono/pull/2424](https://togithub.com/honojs/hono/pull/2424)
- feat: introduce Method Override Middleware by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2420](https://togithub.com/honojs/hono/pull/2420)
- feat(middleware/cors): pass context to options.origin function by [@okmr-d](https://togithub.com/okmr-d) in [https://github.com/honojs/hono/pull/2436](https://togithub.com/honojs/hono/pull/2436)
- feat: support for `vary` header in cache middleware by [@naporin0624](https://togithub.com/naporin0624) in [https://github.com/honojs/hono/pull/2426](https://togithub.com/honojs/hono/pull/2426)
- feat: add middlewares resolve trailing slashes on GET request by [@rnmeow](https://togithub.com/rnmeow) in [https://github.com/honojs/hono/pull/2408](https://togithub.com/honojs/hono/pull/2408)
- test: stub `crypto` if not exist by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2445](https://togithub.com/honojs/hono/pull/2445)
- feat(jwt): literal typed `alg` option value by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2446](https://togithub.com/honojs/hono/pull/2446)
- test(ssg): add test for content-type includes `;` by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2447](https://togithub.com/honojs/hono/pull/2447)
- feat(jwt): add `JwtTokenInvalid` object as `cause` when JWT is invalid by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2448](https://togithub.com/honojs/hono/pull/2448)
- feat(bearer-auth): add `verifyToken` option by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2449](https://togithub.com/honojs/hono/pull/2449)
- feat(basic-auth): add `verifyUser` option by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2450](https://togithub.com/honojs/hono/pull/2450)
- Next by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2454](https://togithub.com/honojs/hono/pull/2454)
##### New Contributors
- [@tfkhdyt](https://togithub.com/tfkhdyt) made their first contribution in [https://github.com/honojs/hono/pull/2406](https://togithub.com/honojs/hono/pull/2406)
- [@okmr-d](https://togithub.com/okmr-d) made their first contribution in [https://github.com/honojs/hono/pull/2436](https://togithub.com/honojs/hono/pull/2436)
- [@naporin0624](https://togithub.com/naporin0624) made their first contribution in [https://github.com/honojs/hono/pull/2426](https://togithub.com/honojs/hono/pull/2426)
- [@rnmeow](https://togithub.com/rnmeow) made their first contribution in [https://github.com/honojs/hono/pull/2408](https://togithub.com/honojs/hono/pull/2408)
**Full Changelog**: https://github.com/honojs/hono/compare/v4.1.7...v4.2.0
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, check this box
This PR has been generated by Mend Renovate. View repository job log here.
This PR contains the following updates:
~4.1.0
->~4.2.0
Release Notes
honojs/hono (hono)
### [`v4.2.1`](https://togithub.com/honojs/hono/releases/tag/v4.2.1) [Compare Source](https://togithub.com/honojs/hono/compare/v4.2.0...v4.2.1) #### What's Changed - fix(jws): Only import necessary helper (not all helpers) by [@nicksrandall](https://togithub.com/nicksrandall) in [https://github.com/honojs/hono/pull/2458](https://togithub.com/honojs/hono/pull/2458) #### New Contributors - [@nicksrandall](https://togithub.com/nicksrandall) made their first contribution in [https://github.com/honojs/hono/pull/2458](https://togithub.com/honojs/hono/pull/2458) **Full Changelog**: https://github.com/honojs/hono/compare/v4.2.0...v4.2.1 ### [`v4.2.0`](https://togithub.com/honojs/hono/releases/tag/v4.2.0) [Compare Source](https://togithub.com/honojs/hono/compare/v4.1.7...v4.2.0) Hono v4.2.0 is now available! Let's take a look at the new features. ##### Added more algorithms for JWT The number of algorithms that JWT util can handle has increased from only 3 to 13! This means that JWT util now implements many of the algorithms supported by JWT. - HS256 - HS384 - HS512 - RS256 - RS384 - RS512 - PS256 - PS384 - PS512 - ES256 - ES384 - ES512 - EdDSA You can use these algorithms from the JWT middleware or JWT helpers. Thanks [@Code-Hex](https://togithub.com/Code-Hex)! ##### Method Override Middleware [Method Override Middleware](https://hono.dev/middleware/builtin/method-override) has been added. This middleware override the method of the real request with the specified method. HTML `form` does not allow you to send a DELETE method request. Instead, by sending an input with `name` as `_method` and a value of `DELETE`, you can call the handler registered in `app.delete()`. ```ts const app = new Hono() // If no options are specified, the value of `_method` in the form, // e.g. DELETE, is used as the method. app.use('/posts', methodOverride({ app })) app.delete('/posts', (c) => { // .... }) ``` ##### Trailing Slash Middleware [Trailing Slash Middleware](https://hono.dev/middleware/builtin/trailing-slash) resolves the handling of Trailing Slashes in GET requests. You can use `appendTrailingSlash` and `trimTrailingSlash` functions. For example, it redirects a GET request to `/about/me` to `/about/me/`. ```ts import { Hono } from 'hono' import { appendTrailingSlash } from 'hono/trailing-slash' const app = new Hono({ strict: true }) app.use(appendTrailingSlash()) app.get('/about/me/', (c) => c.text('With Trailing Slash')) ``` Thanks [@rnmeow](https://togithub.com/rnmeow)! ##### Other features - SSG Helper - Support `extensionMap` [https://github.com/honojs/hono/pull/2382](https://togithub.com/honojs/hono/pull/2382) - JSX/DOM - Add `userId` hook [https://github.com/honojs/hono/pull/2389](https://togithub.com/honojs/hono/pull/2389) - JWT Middleware - Improve error handling [https://github.com/honojs/hono/pull/2406](https://togithub.com/honojs/hono/pull/2406) - Request - Cache the body for re-using [https://github.com/honojs/hono/pull/2416](https://togithub.com/honojs/hono/pull/2416) - JWT Util - Add type helper to `payload` [https://github.com/honojs/hono/pull/2424](https://togithub.com/honojs/hono/pull/2424) - CORS Middleware - Pass context to `options.origin` function [https://github.com/honojs/hono/pull/2436](https://togithub.com/honojs/hono/pull/2436) - Cache Middleware - Support for the `vary` header option [https://github.com/honojs/hono/pull/2426](https://togithub.com/honojs/hono/pull/2426) - HTTP Exception - Add `cause` option [https://github.com/honojs/hono/pull/2224](https://togithub.com/honojs/hono/pull/2224) - Logger - Support `NO_COLOR` [https://github.com/honojs/hono/pull/2228](https://togithub.com/honojs/hono/pull/2228) - JWT Middleware - Add `JwtTokenInvalid` object as `cause` when JWT is invalid [https://github.com/honojs/hono/pull/2448](https://togithub.com/honojs/hono/pull/2448) - Bearer Auth Middleware - Add `verifyToken` option [https://github.com/honojs/hono/pull/2449](https://togithub.com/honojs/hono/pull/2449) - Basic Auth Middleware - Add `verifyUser` option [https://github.com/honojs/hono/pull/2450](https://togithub.com/honojs/hono/pull/2450) ##### All Updates - feat(jwt): supported RS256, RS384, RS512 algorithm for JWT by [@Code-Hex](https://togithub.com/Code-Hex) in [https://github.com/honojs/hono/pull/2339](https://togithub.com/honojs/hono/pull/2339) - added remain algorithm for JWT by [@Code-Hex](https://togithub.com/Code-Hex) in [https://github.com/honojs/hono/pull/2352](https://togithub.com/honojs/hono/pull/2352) - acceptable CryptoKey in JWT sign and verify by [@Code-Hex](https://togithub.com/Code-Hex) in [https://github.com/honojs/hono/pull/2373](https://togithub.com/honojs/hono/pull/2373) - feat(ssg): Support `extentionMap` by [@watany-dev](https://togithub.com/watany-dev) in [https://github.com/honojs/hono/pull/2382](https://togithub.com/honojs/hono/pull/2382) - feat(jwt): support remaining algorithms by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2368](https://togithub.com/honojs/hono/pull/2368) - feat(jsx): add useId hook by [@usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/hono/pull/2389](https://togithub.com/honojs/hono/pull/2389) - feat(middleware/jwt): improve error handling by [@tfkhdyt](https://togithub.com/tfkhdyt) in [https://github.com/honojs/hono/pull/2406](https://togithub.com/honojs/hono/pull/2406) - feat(request): cache body for reusing by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2416](https://togithub.com/honojs/hono/pull/2416) - feat(jwt): Add type helper to `payload` by [@nakasyou](https://togithub.com/nakasyou) in [https://github.com/honojs/hono/pull/2424](https://togithub.com/honojs/hono/pull/2424) - feat: introduce Method Override Middleware by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2420](https://togithub.com/honojs/hono/pull/2420) - feat(middleware/cors): pass context to options.origin function by [@okmr-d](https://togithub.com/okmr-d) in [https://github.com/honojs/hono/pull/2436](https://togithub.com/honojs/hono/pull/2436) - feat: support for `vary` header in cache middleware by [@naporin0624](https://togithub.com/naporin0624) in [https://github.com/honojs/hono/pull/2426](https://togithub.com/honojs/hono/pull/2426) - feat: add middlewares resolve trailing slashes on GET request by [@rnmeow](https://togithub.com/rnmeow) in [https://github.com/honojs/hono/pull/2408](https://togithub.com/honojs/hono/pull/2408) - test: stub `crypto` if not exist by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2445](https://togithub.com/honojs/hono/pull/2445) - feat(jwt): literal typed `alg` option value by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2446](https://togithub.com/honojs/hono/pull/2446) - test(ssg): add test for content-type includes `;` by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2447](https://togithub.com/honojs/hono/pull/2447) - feat(jwt): add `JwtTokenInvalid` object as `cause` when JWT is invalid by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2448](https://togithub.com/honojs/hono/pull/2448) - feat(bearer-auth): add `verifyToken` option by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2449](https://togithub.com/honojs/hono/pull/2449) - feat(basic-auth): add `verifyUser` option by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2450](https://togithub.com/honojs/hono/pull/2450) - Next by [@yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/hono/pull/2454](https://togithub.com/honojs/hono/pull/2454) ##### New Contributors - [@tfkhdyt](https://togithub.com/tfkhdyt) made their first contribution in [https://github.com/honojs/hono/pull/2406](https://togithub.com/honojs/hono/pull/2406) - [@okmr-d](https://togithub.com/okmr-d) made their first contribution in [https://github.com/honojs/hono/pull/2436](https://togithub.com/honojs/hono/pull/2436) - [@naporin0624](https://togithub.com/naporin0624) made their first contribution in [https://github.com/honojs/hono/pull/2426](https://togithub.com/honojs/hono/pull/2426) - [@rnmeow](https://togithub.com/rnmeow) made their first contribution in [https://github.com/honojs/hono/pull/2408](https://togithub.com/honojs/hono/pull/2408) **Full Changelog**: https://github.com/honojs/hono/compare/v4.1.7...v4.2.0Configuration
📅 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.