Releases: honojs/hono
v4.4.2
What's Changed
- fix: add return types of void function by @EdamAme-x in #2870
Full Changelog: v4.4.1...v4.4.2
v4.4.1
What's Changed
- refactor(pretty-json): remove useless condition by @6km in #2815
- fix(aws-lambda): Update handler.ts getQueryString by @qualipsolutions in #2782
- refactor(aws-lambda): Object.hasOwn is recommended by @exoego in #2831
- fix(client): allow multiple files on the same key in form by @olivier-drieux in #2791
- fix(helper/ssg): fix bug of joinPaths by @EdamAme-x in #2809
- chore: Author should include JSDoc by @fzn0x in #2840
- fix(middleware/body-limit): set default duplex option for readable stream by @fzn0x in #2837
- refactor(websocket): remove unused condition by @fzn0x in #2839
- feat(bun): WebSocket helper supports that env be
{ server: server }
by @nakasyou in #2812 - refactor: added paths-ignore for ignore files of dont need tests by @EdamAme-x in #2850
- ci: include node22 tests by @Jayllyz in #2851
- docs(src/*): Add TSDoc comments to improve code documentation by @fzn0x in #2841
- fix(types): allow blank env by @fzn0x in #2834
- refactor: removed v4 branch in actions. by @EdamAme-x in #2849
- refactor(helper/adapter): improve runtime detection by @6km in #2846
- fix(jsx/dom): Fixed to not add "px" for certain properties, even if numeric value is given by @usualoma in #2845
- refactor(aws-lambda): remove unused setHeadersToResult by @exoego in #2828
- fix(validator): support json api header by @dil-borosz in #2855
- refactor(helper/testing): remove some any of helper/testing by @EdamAme-x in #2833
- docs: change to shell highlight by @EdamAme-x in #2848
- refactor(compose): Remove type definition of ComposeContext that was defined twice by @chimame in #2858
New Contributors
- @6km made their first contribution in #2815
- @qualipsolutions made their first contribution in #2782
- @olivier-drieux made their first contribution in #2791
- @Jayllyz made their first contribution in #2851
- @dil-borosz made their first contribution in #2855
- @chimame made their first contribution in #2858
Full Changelog: v4.4.0...v4.4.1
v4.4.0
Hono v4.4.0 is now available! Let's take a look at the new features.
Support JSR
Now, Hono is available on JSR - a new JavaScript/TypeScript registry! You can install the Hono package from JSR right now. If you want to run your Hono app on Deno, you can install it with the following command:
deno add @hono/hono
Then, use it in your code!
// main.ts
import { Hono } from '@hono/hono'
const app = new Hono()
app.get('/', (c) => c.text('Hello JSR!'))
export default app
And run it:
deno serve main.ts
If you edit the deno.json
and set the paths appropriately, the exact same code that you are familiar with will work in Deno, Cloudflare Workers, and Bun.
deno.json
:
{
"imports": {
"hono": "jsr:@hono/hono@^4.4.0"
}
}
Area.mp4
JSR is not exclusive to Deno. You can use it with npm and Bun.
# npm
npx jsr add @hono/hono
# bun
bunx jsr add @hono/hono
And, removing "slow types" has improved the performance of TypeScript type inference.
With the introduction of JSR, the previous package publishing from deno.land/x
will be obsolete.
Introduce ConnInfo Helper
The ConnInfo Helper is a helper helps you to get the connection information. For example, you can get the client's remote address easily.
import { Hono } from 'hono'
import { getConnInfo } from 'hono/deno' // For Deno
const app = new Hono()
app.get('/', (c) => {
const info = getConnInfo(c) // info is `ConnInfo`
return c.text(`Your remote address is ${info.remote.address}`)
})
export default app
Thank you for creating the feature, @nakasyou!
Introduce Timeout Middleware
The Timeout Middleware is a middleware enables you to easily manage request timeouts in your application.
Here is a simple example:
import { Hono } from 'hono'
import { timeout } from 'hono/timeout'
const app = new Hono()
// Applying a 5-second timeout
app.use('/api', timeout(5000))
// Handling a route
app.get('/api/data', async (c) => {
// Your route handler logic
return c.json({ data: 'Your data here' })
})
Thank you for creating the feature, @watany-dev!
Improving JSDoc
We are now trying to improve the JSDocs. In the PR, we've added the JSDocs for all middleware. Thank you, @goisaki!
Other features
- URL utility - decode percent-encoded path in
getPath
#2714 - Body utility - add dot notation support for
parseBody
#2675 - Body utility - specify detailed return type for
parseBody
#2771 - SSG Helper - enhance combined hooks #2686
- JSX DOM - improve compatibility with React - The 2024 May Update #2756
- JSX DOM - introduce react-dom/client APIs and React.version #2795
All Updates
- fix(secure-header): Replace NodeJS Buffer API by @watany-dev in #2761
- fix(http-exception): prioritize the status code by @yusukebe in #2767
- feat: Introduce ConnInfo helper/adapter by @nakasyou in #2595
- feat(middleware): Introduce Timeout Middleware by @watany-dev in #2615
- feat: decode percent-encoded path in getPath by @usualoma in #2714
- feat(utils/body): add dot notation support for
parseBody
by @fzn0x in #2675 - refactor(cloudflare-workers): remove
@cloudflare/workers-types
by @yusukebe in #2773 - feat(jsx/dom): improve compatibility with React - The 2024 May Update by @usualoma in #2756
- feat(utils): specify detailed return type for parseBody by @usualoma in #2771
- feat(ssg): enhance conbined hooks by @watany-dev in #2686
- feat(jsr): support JSR by @yusukebe in #2662
- refactor(request): show user-friendly type for
c.req.param()
by @usualoma in #2780 - refactor(utils/body): minor cleanup by @MathurAditya724 in #2783
- docs(readme): update the badges by @yusukebe in #2785
- chore(actions): update
on
condition forpublish-to-jsr
by @yusukebe in #2786 - chore(deno): change path including deno_dist by @ryuapp in #2788
- fix(middleware/jwt): typo by @euijinkk in #2789
- chore(lint): update eslint rules by @yusukebe in #2790
- fix(middleware): export variables type from each
index.ts
by @yusukebe in #2793 - docs: add module docs by @yusukebe in #2796
- feat(jsx/dom): introduce react-dom/client APIs and React.version by @usualoma in #2795
- docs(readme): update readme and
jsr.json
by @yusukebe in #2803 - Next for
v4.4.0
by @yusukebe in #2769 - chore: update lockfile by @yusukebe in #2805
New Contributors
Full Changelog: v4.3.9...v4.4.0
v4.4.0-rc.1
This is a pre-release.
v4.3.11
v4.3.10
v4.3.9
v4.3.8
What's Changed
- test(validator): compatibility with Node.js
v20.13.1
by @yusukebe in #2682 - refactor(utils/jwt): remove some
any
by @fzn0x in #2684 - refactor(timing): don't use
Partial
for the options by @yusukebe in #2712 - refactor(secure-headers): don't use
Partial
for the options by @yusukebe in #2713 - fix(context): Retain all cookies when passing
ResponseInit
toc.body
by @codeflows in #2690 - fix(hono-jsx): make ref unrequried for forward ref by @dygy in #2715
New Contributors
- @fzn0x made their first contribution in #2684
- @codeflows made their first contribution in #2690
- @dygy made their first contribution in #2715
Full Changelog: v4.3.7...v4.3.8
v4.3.7
What's Changed
- doc(ssg): Define the default value for Content-Type by @watany-dev in #2666
- feat(aws-lambda): add alb event processor by @yiss in #2657
- feat(utils/cookie): allow setting cookie SameSite attribute in lowercase too by @BlankParticle in #2668
- fix(method-override): remove un-needed import of URLSearchParams in method override middleware by @f5io in #2679
New Contributors
- @yiss made their first contribution in #2657
- @BlankParticle made their first contribution in #2668
- @f5io made their first contribution in #2679
Full Changelog: v4.3.6...v4.3.7
v4.3.6
What's Changed
- feat(cache): improved customizability by @MathurAditya724 in #2652
- fix(utils/body): support multiple
File
s by @yusukebe in #2665
New Contributors
- @MathurAditya724 made their first contribution in #2652
Full Changelog: v4.3.5...v4.3.6