Bot releases are hidden (Show)
Full Changelog: https://github.com/honojs/hono/compare/v4.2.8...v4.2.9
Published by yusukebe 6 months ago
Full Changelog: https://github.com/honojs/hono/compare/v4.2.7...v4.2.8
Published by yusukebe 6 months ago
This release fixes "Restricted Directory Traversal in serveStatic with deno".
Full Changelog: https://github.com/honojs/hono/compare/v4.2.6...v4.2.7
Published by yusukebe 6 months ago
$ws
when not used WebSockets by @nakasyou in https://github.com/honojs/hono/pull/2532
Full Changelog: https://github.com/honojs/hono/compare/v4.2.5...v4.2.6
Published by yusukebe 6 months ago
Full Changelog: https://github.com/honojs/hono/compare/v4.2.4...v4.2.5
Published by yusukebe 6 months ago
typ
Field Optional to Enhance Compatibility by @naporin0624 in https://github.com/honojs/hono/pull/2488
baseUrl
for testClient
by @yusukebe in https://github.com/honojs/hono/pull/2496
OutputTypeExcludeResponseType
when InputType
is unknown by @nagasawaryoya in https://github.com/honojs/hono/pull/2500
Full Changelog: https://github.com/honojs/hono/compare/v4.2.3...v4.2.4
Published by yusukebe 6 months ago
package.json
correctly by @yusukebe in https://github.com/honojs/hono/pull/2483
Full Changelog: https://github.com/honojs/hono/compare/v4.2.2...v4.2.3
Published by yusukebe 7 months ago
null
correctly by @yusukebe in https://github.com/honojs/hono/pull/2469
Full Changelog: https://github.com/honojs/hono/compare/v4.2.1...v4.2.2
Published by yusukebe 7 months ago
Full Changelog: https://github.com/honojs/hono/compare/v4.2.0...v4.2.1
Published by yusukebe 7 months ago
Hono v4.2.0 is now available! Let's take a look at the new features.
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.
You can use these algorithms from the JWT middleware or JWT helpers. Thanks @Code-Hex!
Method Override Middleware 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()
.
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 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/
.
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!
extensionMap
https://github.com/honojs/hono/pull/2382
userId
hook https://github.com/honojs/hono/pull/2389
payload
https://github.com/honojs/hono/pull/2424
options.origin
function https://github.com/honojs/hono/pull/2436
vary
header option https://github.com/honojs/hono/pull/2426
cause
option https://github.com/honojs/hono/pull/2224
NO_COLOR
https://github.com/honojs/hono/pull/2228
JwtTokenInvalid
object as cause
when JWT is invalid https://github.com/honojs/hono/pull/2448
verifyToken
option https://github.com/honojs/hono/pull/2449
verifyUser
option https://github.com/honojs/hono/pull/2450
extentionMap
by @watany-dev in https://github.com/honojs/hono/pull/2382
payload
by @nakasyou in https://github.com/honojs/hono/pull/2424
vary
header in cache middleware by @naporin0624 in https://github.com/honojs/hono/pull/2426
crypto
if not exist by @yusukebe in https://github.com/honojs/hono/pull/2445
alg
option value by @yusukebe in https://github.com/honojs/hono/pull/2446
;
by @yusukebe in https://github.com/honojs/hono/pull/2447
JwtTokenInvalid
object as cause
when JWT is invalid by @yusukebe in https://github.com/honojs/hono/pull/2448
verifyToken
option by @yusukebe in https://github.com/honojs/hono/pull/2449
verifyUser
option by @yusukebe in https://github.com/honojs/hono/pull/2450
Full Changelog: https://github.com/honojs/hono/compare/v4.1.7...v4.2.0
Published by yusukebe 7 months ago
globalThis.caches
by @yusukebe in https://github.com/honojs/hono/pull/2444
Full Changelog: https://github.com/honojs/hono/compare/v4.1.6...v4.1.7
Published by yusukebe 7 months ago
caches
is not defined by @yusukebe in https://github.com/honojs/hono/pull/2443
Full Changelog: https://github.com/honojs/hono/compare/v4.1.5...v4.1.6
Published by yusukebe 7 months ago
Arrap.prototype.map
if it is not needed return value by @nakasyou in https://github.com/honojs/hono/pull/2419
await
cached contents by @yusukebe in https://github.com/honojs/hono/pull/2430
Full Changelog: https://github.com/honojs/hono/compare/v4.1.4...v4.1.5
Published by yusukebe 7 months ago
Full Changelog: https://github.com/honojs/hono/compare/v4.1.3...v4.1.4
Published by yusukebe 7 months ago
src/helper.ts
by @yusukebe in https://github.com/honojs/hono/pull/2385
json
and form
validation by @yusukebe in https://github.com/honojs/hono/pull/2392
Full Changelog: https://github.com/honojs/hono/compare/v4.1.2...v4.1.3
Published by yusukebe 7 months ago
slice
+ indexOf
for getPath()
by @yusukebe in https://github.com/honojs/hono/pull/2376
MergePath
merge blank paths correctly by @yusukebe in https://github.com/honojs/hono/pull/2365
Full Changelog: https://github.com/honojs/hono/compare/v4.1.1...v4.1.2
Published by yusukebe 7 months ago
ExecutionContext
from hono
by @yusukebe in https://github.com/honojs/hono/pull/2346
denoify
by @yusukebe in https://github.com/honojs/hono/pull/2362
true
by @yusukebe in https://github.com/honojs/hono/pull/2363
this.#headers
by @yusukebe in https://github.com/honojs/hono/pull/2364
Full Changelog: https://github.com/honojs/hono/compare/v4.1.0...v4.1.1
Published by yusukebe 7 months ago
Hono v4.1.0 is now available! Let's take a look at the new features.
Now Hono supports WebSockets! With WebSocket helper, you can easily handle WebSockets in your application. Currently, Cloudflare Workers / Pages, Deno, and Bun adapters are available.
const app = new Hono()
app.get(
'/ws',
upgradeWebSocket((c) => {
return {
onMessage(event, ws) {
console.log(`Message from client: ${event.data}`)
ws.send('Hello from server!')
},
onClose: () => {
console.log('Connection closed')
}
}
})
)
PRC mode is now also supported for WebSockets endpoints. The following is a demo.
Thanks @nakasyou!
Introducing Body Limit Middleware. This middleware can limit the file size of the request body.
const app = new Hono()
app.post(
'/upload',
bodyLimit({
maxSize: 50 * 1024, // 50kb
onError: (c) => {
return c.text('overflow :(', 413)
}
}),
async (c) => {
const body = await c.req.parseBody()
if (body['file'] instanceof File) {
console.log(`Got file sized: ${body['file'].size}`)
}
return c.text('pass :)')
}
)
Thanks @EdamAme-x and @usualoma!
We made the target
in the tsconfig.json
as ES2022 instead of ES2020. So, the generated JavaScript files are now ES2022. That made the file size smaller! The following is the result of the minify and build of "Hello World" with Wrangler.
// ES2020
hono => Total Upload: 20.15 KiB / gzip: 7.42 KiB
hono/tiny => Total Upload: 12.74 KiB / gzip: 4.69 KiB
// ES2022
hono => Total Upload: 18.46 KiB / gzip: 7.09 KiB
hono/tiny => Total Upload: 11.12 KiB / gzip: 4.38 KiB
Performance has also been improved in some Node.js environments.
__Secure-
and __Host- prefix
https://github.com/honojs/hono/pull/2269
cause
option https://github.com/honojs/hono/pull/2224
NO_COLOR
https://github.com/honojs/hono/pull/2228
NO_COLOR
by @ryuapp in https://github.com/honojs/hono/pull/2228
@hono/node-server
by @yusukebe in https://github.com/honojs/hono/pull/2323
bodyLimit
for Deno by @yusukebe in https://github.com/honojs/hono/pull/2324
Full Changelog: https://github.com/honojs/hono/compare/v4.0.10...v4.1.0
Published by yusukebe 8 months ago
Full Changelog: https://github.com/honojs/hono/compare/v4.0.9...v4.0.10