benchmarks
benchmarks copied to clipboard
fix(deps): update dependency hono to v4
This PR contains the following updates:
Package | Change | Age | Adoption | Passing | Confidence |
---|---|---|---|---|---|
hono (source) | 2.7.8 -> 4.6.1 |
Release Notes
honojs/hono (hono)
v4.6.1
What's Changed
- fix(build): improve addExtension esbuild plugin by @kt3k in https://github.com/honojs/hono/pull/3405
New Contributors
- @kt3k made their first contribution in https://github.com/honojs/hono/pull/3405
Full Changelog: https://github.com/honojs/hono/compare/v4.6.0...v4.6.1
v4.6.0
Hono v4.6.0 is now available!
One of the highlights of this release is the Context Storage Middleware. Let's introduce it.
Context Storage Middleware
Many users may have been waiting for this feature. The Context Storage Middleware uses AsyncLocalStorage
to allow handling of the current Context object even outside of handlers.
For example, let’s define a Hono app with a variable message: string
.
type Env = {
Variables: {
message: string
}
}
const app = new Hono<Env>()
To enable Context Storage Middleware, register contextStorage()
as middleware at the top and set the message
value.
import { contextStorage } from 'hono/context-storage'
//...
app.use(contextStorage())
app.use(async (c, next) => {
c.set('message', 'Hello!')
await next()
})
getContext()
returns the current Context object, allowing you to get the value of the message
variable outside the handler.
import { getContext } from 'hono/context-storage'
app.get('/', (c) => {
return c.text(getMessage())
})
// Access the variable outside the handler.
const getMessage = () => {
return getContext<Env>().var.message
}
In the case of Cloudflare Workers, you can also access the Bindings
outside the handler by using this middleware.
type Env = {
Bindings: {
KV: KVNamespace
}
}
const app = new Hono<Env>()
app.use(contextStorage())
const setKV = (value: string) => {
return getContext<Env>().env.KV.put('key', value)
}
Thanks @marceloverdijk !
New features
- feat(secureHeader): add Permissions-Policy header to secure headers middleware https://github.com/honojs/hono/pull/3314
- feat(cloudflare-pages): enable
c.env.eventContext
in handleMiddleware https://github.com/honojs/hono/pull/3332 - feat(websocket): Add generics type to
WSContext
https://github.com/honojs/hono/pull/3337 - feat(jsx-renderer): set
Content-Encoding
whenstream
is true https://github.com/honojs/hono/pull/3355 - feat(serveStatic): add
precompressed
option https://github.com/honojs/hono/pull/3366 - feat(helper/streaming): Support
Promise<string>
or (async)JSX.Element
instreamSSE
https://github.com/honojs/hono/pull/3344 - feat(context): make fetch Response headers mutable https://github.com/honojs/hono/pull/3318
- feat(serve-static): add
onFound
option https://github.com/honojs/hono/pull/3396 - feat(basic-auth): added custom response message option https://github.com/honojs/hono/pull/3371
- feat(bearer-auth): added custom response message options https://github.com/honojs/hono/pull/3372
Other changes
- chore(jsx-renderer): fix typo in JSDoc by @taga3s in https://github.com/honojs/hono/pull/3378
- chore(deno): use the latest jsr libraries for testing by @ryuapp in https://github.com/honojs/hono/pull/3375
- fix(secure-headers): optimize getPermissionsPolicyDirectives function by @kbkn3 in https://github.com/honojs/hono/pull/3398
- fix(bearer-auth): typo by @yusukebe in https://github.com/honojs/hono/pull/3404
New Contributors
- @kbkn3 made their first contribution in https://github.com/honojs/hono/pull/3314
- @hayatosc made their first contribution in https://github.com/honojs/hono/pull/3337
- @inetol made their first contribution in https://github.com/honojs/hono/pull/3366
Full Changelog: https://github.com/honojs/hono/compare/v4.5.11...v4.6.0
v4.5.11
What's Changed
- fix(jsx): race condition in ErrorBoundary with event loop by @usualoma in https://github.com/honojs/hono/pull/3343
- perf(jsx): skip the special behavior when the element is in the head. by @usualoma in https://github.com/honojs/hono/pull/3352
- refactor(utils/body): shorten the code by @yusukebe in https://github.com/honojs/hono/pull/3353
- docs:
Twitter
toX
by @yusukebe in https://github.com/honojs/hono/pull/3354 - chore: fix typo in JSDoc by @taga3s in https://github.com/honojs/hono/pull/3364
- refactor(utils/basic-auth): Moved Internal function to utils by @sugar-cat7 in https://github.com/honojs/hono/pull/3359
New Contributors
- @taga3s made their first contribution in https://github.com/honojs/hono/pull/3364
- @sugar-cat7 made their first contribution in https://github.com/honojs/hono/pull/3359
Full Changelog: https://github.com/honojs/hono/compare/v4.5.10...v4.5.11
v4.5.10
What's Changed
- feat(compress): improve compress middleware by @nitedani in https://github.com/honojs/hono/pull/3317
- feat(jsx): add popover api attributes by @ssssota in https://github.com/honojs/hono/pull/3323
- feat(jsx): improve form attribute types by @ssssota in https://github.com/honojs/hono/pull/3330
- chore(test): migrate to vitest v2 by @yasuaki640 in https://github.com/honojs/hono/pull/3326
- chore(test): replace deprecated vitest type by @yasuaki640 in https://github.com/honojs/hono/pull/3338
- fix(logger): removing spaces from logger by @marceloverdijk in https://github.com/honojs/hono/pull/3334
New Contributors
- @nitedani made their first contribution in https://github.com/honojs/hono/pull/3317
- @marceloverdijk made their first contribution in https://github.com/honojs/hono/pull/3334
Full Changelog: https://github.com/honojs/hono/compare/v4.5.9...v4.5.10
v4.5.9
What's Changed
- test(types): broken test in future versions of typescript by @m-shaka in https://github.com/honojs/hono/pull/3310
- fix(utils/color): Deno does not require permission for
NO_COLOR
by @ryuapp in https://github.com/honojs/hono/pull/3306 - feat(jsx): improve
type
(MIME) attribute types by @ssssota in https://github.com/honojs/hono/pull/3305 - feat(pretty-json): support custom query by @nakasyou in https://github.com/honojs/hono/pull/3300
Full Changelog: https://github.com/honojs/hono/compare/v4.5.8...v4.5.9
v4.5.8
Security Fix for CSRF Protection Middleware
Before this release, in versions 4.5.7 and below, the CSRF Protection Middleware did not treat requests including Content-Types
with uppercase letters (e.g., Application/x-www-form-urlencoded
) as potential attacks, allowing them to pass.
This could cause unexpected behavior, leading to a vulnerability. If you are using the CSRF Protection Middleware, please upgrade to version 4.5.8 or higher immediately.
For more details, see the report here: https://github.com/honojs/hono/security/advisories/GHSA-rpfr-3m35-5vx5
v4.5.7
What's Changed
- fix(jsx/dom): Fixed a bug that caused Script elements to turn into Style elements. by @usualoma in https://github.com/honojs/hono/pull/3294
- perf(jsx/dom): improve performance by @usualoma in https://github.com/honojs/hono/pull/3288
- feat(jsx): improve a-tag types with well known values by @ssssota in https://github.com/honojs/hono/pull/3287
- fix(validator): Fixed a bug in hono/validator where URL Encoded Data could not be validated if the Content-Type included charset. by @uttk in https://github.com/honojs/hono/pull/3297
- feat(jsx): improve
target
andformtarget
attribute types by @ssssota in https://github.com/honojs/hono/pull/3299 - docs(README): change Twitter to X by @nakasyou in https://github.com/honojs/hono/pull/3301
- fix(client): replace optional params to url correctly by @yusukebe in https://github.com/honojs/hono/pull/3304
- feat(jsx): improve input attribute types based on react by @ssssota in https://github.com/honojs/hono/pull/3302
New Contributors
- @uttk made their first contribution in https://github.com/honojs/hono/pull/3297
Full Changelog: https://github.com/honojs/hono/compare/v4.5.6...v4.5.7
v4.5.6
What's Changed
- fix(jsx): handle async component error explicitly and throw the error in the response by @usualoma in https://github.com/honojs/hono/pull/3274
- fix(validator): support multipart headers without a separating space by @Ernxst in https://github.com/honojs/hono/pull/3286
- fix(validator): Allow form data will mutliple values appended by @nicksrandall in https://github.com/honojs/hono/pull/3273
- feat(jsx): improve meta-tag types with well known values by @ssssota in https://github.com/honojs/hono/pull/3276
New Contributors
- @Ernxst made their first contribution in https://github.com/honojs/hono/pull/3286
- @ssssota made their first contribution in https://github.com/honojs/hono/pull/3276
Full Changelog: https://github.com/honojs/hono/compare/v4.5.5...v4.5.6
v4.5.5
What's Changed
- fix(jsx): allow null, undefined, and boolean to be returned from function component by @usualoma in https://github.com/honojs/hono/pull/3241
- feat(context): Add types for
c.header
by @nakasyou in https://github.com/honojs/hono/pull/3221 - fix(jsx): fix draggable type to accept boolean by @yasuaki640 in https://github.com/honojs/hono/pull/3253
- feat(context): add Context-Type types to
c.header
by @nakasyou in https://github.com/honojs/hono/pull/3255 - fix(serve-static): supports directory contains
.
and not end/
by @yusukebe in https://github.com/honojs/hono/pull/3256
Full Changelog: https://github.com/honojs/hono/compare/v4.5.4...v4.5.5
v4.5.4
What's Changed
- fix(jsx): corrects the type of 'draggable' attribute in intrinsic-elements.ts by @yasuaki640 in https://github.com/honojs/hono/pull/3224
- feat(jsx): allow to merge CSSProperties declaration by @jonasnobile in https://github.com/honojs/hono/pull/3228
- feat(client): Add WebSocket Provider Integration Tests and Enhance WebSocket Initialization by @naporin0624 in https://github.com/honojs/hono/pull/3213
- fix(types):
param
inValidationTargets
supports optional param by @yusukebe in https://github.com/honojs/hono/pull/3229
New Contributors
- @jonasnobile made their first contribution in https://github.com/honojs/hono/pull/3228
Full Changelog: https://github.com/honojs/hono/compare/v4.5.3...v4.5.4
v4.5.3
What's Changed
- fix(validator): Add double quotation marks to multipart checker regex by @CPlusPatch in https://github.com/honojs/hono/pull/3195
- fix(validator): support
application/json
with a charset as JSON by @yusukebe in https://github.com/honojs/hono/pull/3199 - fix(jsx): fix handling of SVG elements in JSX. by @usualoma in https://github.com/honojs/hono/pull/3204
- fix(jsx/dom): fix performance issue with adding many new node listings by @usualoma in https://github.com/honojs/hono/pull/3205
- fix(service-worker): refer to
self.fetch
correctly by @yusukebe in https://github.com/honojs/hono/pull/3200
New Contributors
- @CPlusPatch made their first contribution in https://github.com/honojs/hono/pull/3195
Full Changelog: https://github.com/honojs/hono/compare/v4.5.2...v4.5.3
v4.5.2
What's Changed
- fix(helper/adapter): don't check
navigator
isundefined
by @yusukebe in https://github.com/honojs/hono/pull/3171 - fix(types): handle readonly array correctly by @m-shaka in https://github.com/honojs/hono/pull/3172
- Revert "fix(helper/adapter): don't check
navigator
isundefined
by @yusukebe in https://github.com/honojs/hono/pull/3173 - fix(type): degradation of generic type handling by @m-shaka in https://github.com/honojs/hono/pull/3138
- fix:(csrf) fix typo of csrf middleware by @yasuaki640 in https://github.com/honojs/hono/pull/3178
- feat(secure-headers): remove "X-Powered-By" should be an option by @EdamAme-x in https://github.com/honojs/hono/pull/3177
Full Changelog: https://github.com/honojs/hono/compare/v4.5.1...v4.5.2
v4.5.1
What's Changed
- chore: remove rimraf and use bun shell by @nakasyou in https://github.com/honojs/hono/pull/3146
- chore: moving the setup file of vitest by @EdamAme-x in https://github.com/honojs/hono/pull/3157
- fix(middleware/jwt): Changed the jwt-secret type to SignatureKey by @JulesVerner in https://github.com/honojs/hono/pull/3167
- feat(bearer-auth): Allow empty bearer-auth middleware prefixes by @prevostc in https://github.com/honojs/hono/pull/3161
- chore(factory): remove
@experimental
fromcreateApp
by @yusukebe in https://github.com/honojs/hono/pull/3164 - fix(client): support array values for
query
inws
by @yusukebe in https://github.com/honojs/hono/pull/3169 - fix(validator): ignore content-type mismatches by @yusukebe in https://github.com/honojs/hono/pull/3165
New Contributors
- @JulesVerner made their first contribution in https://github.com/honojs/hono/pull/3167
- @prevostc made their first contribution in https://github.com/honojs/hono/pull/3161
Full Changelog: https://github.com/honojs/hono/compare/v4.5.0...v4.5.1
v4.5.0
v4.4.13
What's Changed
- chore: update benchmark by @yusukebe in https://github.com/honojs/hono/pull/3102
- chore: replace tsx with Bun by @nakasyou in https://github.com/honojs/hono/pull/3103
- refactor(http-status): remove unnecessary line of types and use common types by @EdamAme-x in https://github.com/honojs/hono/pull/3110
- fix(jsx): redefine scope attribute as enum type by @yasuaki640 in https://github.com/honojs/hono/pull/3118
- fix(types): allow
string[] | File[]
for RPC form value by @yusukebe in https://github.com/honojs/hono/pull/3117 - fix(validator-types): type Alignment with Web Standards by @EdamAme-x in https://github.com/honojs/hono/pull/3120
- fix(types):
app.use(path, mw)
return correct schema type by @yusukebe in https://github.com/honojs/hono/pull/3128
Full Changelog: https://github.com/honojs/hono/compare/v4.4.12...v4.4.13
v4.4.12
What's Changed
- fix(aws-lambda): set cookies with comma is bugged by @NamesMT in https://github.com/honojs/hono/pull/3084
- fix(types): infer
path
when chaining afteruse
by @yusukebe in https://github.com/honojs/hono/pull/3087 - chore: update outdated links in JSDoc by @ryuapp in https://github.com/honojs/hono/pull/3089
- fix(jsx): changes behavior when
download
attribute is set to a boolean value. by @oon00b in https://github.com/honojs/hono/pull/3094 - chore: add the triage label by @mvares in https://github.com/honojs/hono/pull/3092
- feat(types): improve JSONParsed by @m-shaka in https://github.com/honojs/hono/pull/3074
- fix(helper/streaming): remove slow types by @yusukebe in https://github.com/honojs/hono/pull/3100
- chore(utils/jwt): add
@module
docs by @yusukebe in https://github.com/honojs/hono/pull/3101
New Contributors
- @oon00b made their first contribution in https://github.com/honojs/hono/pull/3094
Full Changelog: https://github.com/honojs/hono/compare/v4.4.11...v4.4.12
v4.4.11
What's Changed
- refactor: remove unnecessary async keyword from router tests by @K-tecchan in https://github.com/honojs/hono/pull/3061
- fix(validator): don't return a FormData if formData is cached by @yusukebe in https://github.com/honojs/hono/pull/3067
- fix(client): Add Query Parameter Support to WebSocket Client in
hono/client
by @naporin0624 in https://github.com/honojs/hono/pull/3066 - refactor(types): move
HandlerInterface
's(path, handler)
s overloads down by @NamesMT in https://github.com/honojs/hono/pull/3072 - test(helper/dev): fix typo of test case name by @yasuaki640 in https://github.com/honojs/hono/pull/3073
- fix(stream): Fixed a problem that onAbort() is called even if request is normally closed in deno by @usualoma in https://github.com/honojs/hono/pull/3079
New Contributors
- @K-tecchan made their first contribution in https://github.com/honojs/hono/pull/3061
Full Changelog: https://github.com/honojs/hono/compare/v4.4.10...v4.4.11
v4.4.10
What's Changed
- chore(jsr): export JWT utils by @ryuapp in https://github.com/honojs/hono/pull/3056
- fix(streaming): call stream.abort() explicitly when request is aborted by @usualoma in https://github.com/honojs/hono/pull/3042
- fix(client): set Path as the default of Original by @m-shaka in https://github.com/honojs/hono/pull/3058
New Contributors
- @m-shaka made their first contribution in https://github.com/honojs/hono/pull/3058
Full Changelog: https://github.com/honojs/hono/compare/v4.4.9...v4.4.10
v4.4.9
What's Changed
- perf(context): improve initializing
Context
by @yusukebe in https://github.com/honojs/hono/pull/3046 - fix(types): correct inferring env when routes channing by @yusukebe in https://github.com/honojs/hono/pull/3051
- docs: update the description of
package.json
and README by @yusukebe in https://github.com/honojs/hono/pull/3052 - fix(timing): prevent duplicate applications by @yusukebe in https://github.com/honojs/hono/pull/3054
Full Changelog: https://github.com/honojs/hono/compare/v4.4.8...v4.4.9
v4.4.8
What's Changed
- fix(jsx): add an explicit type by @yusukebe in https://github.com/honojs/hono/pull/3007
- ci: use
env
for codecov GitHub Actions by @yusukebe in https://github.com/honojs/hono/pull/3010 - chore: Fix typos in JSDoc by @NicoPlyley in https://github.com/honojs/hono/pull/3002
- fix: change to allow use of websocket options by @EdamAme-x in https://github.com/honojs/hono/pull/2999
- perf: parseAccept without spread operator by @Jayllyz in https://github.com/honojs/hono/pull/3003
- test: add tests for buffer.ts by @yasuaki640 in https://github.com/honojs/hono/pull/3004
- chore: upload bun test coverage to CodeCov by @exoego in https://github.com/honojs/hono/pull/3022
- refactor: remove unneeded import statements by @EdamAme-x in https://github.com/honojs/hono/pull/3014
- perf(utils/buffer): use promise all for better performance by @yasuaki640 in https://github.com/honojs/hono/pull/3031
Full Changelog: https://github.com/honojs/hono/compare/v4.4.7...v4.4.8
v4.4.7
What's Changed
- use correct return type for c.html depending on input by @asmadsen in https://github.com/honojs/hono/pull/2973
- test: test uncovered return statement by @yasuaki640 in https://github.com/honojs/hono/pull/2985
- test: Update request.test.ts to remove duplicate checks by @JoaquimLey in https://github.com/honojs/hono/pull/2984
- fix(types): env variables override ContextVariableMap by @KaelWD in https://github.com/honojs/hono/pull/2987
New Contributors
- @asmadsen made their first contribution in https://github.com/honojs/hono/pull/2973
- @JoaquimLey made their first contribution in https://github.com/honojs/hono/pull/2984
- @KaelWD made their first contribution in https://github.com/honojs/hono/pull/2987
Full Changelog: https://github.com/honojs/hono/compare/v4.4.6...v4.4.7
v4.4.6
What's Changed
- fix(aws-lambda): handle multiple cookies in streaming responses by @KnisterPeter in https://github.com/honojs/hono/pull/2926
Full Changelog: https://github.com/honojs/hono/compare/v4.4.5...v4.4.6
v4.4.5
What's Changed
- fix(cors): allow custom vary header by @fzn0x in https://github.com/honojs/hono/pull/2934
- fix(jsx): rename
Hono
toJSX
and exportJSX
namespace by @yusukebe in https://github.com/honojs/hono/pull/2937 - refactor(hono-base): make 2nd arg of
app.route()
required by @yusukebe in https://github.com/honojs/hono/pull/2945 - refactor(hono-base): don't check 1st argument of
app.on()
by @yusukebe in https://github.com/honojs/hono/pull/2946 - refactor(context): remove unnecessary initialization add add tests for Context by @yusukebe in https://github.com/honojs/hono/pull/2949
- test(hono-base): add tests for covering 100% by @yusukebe in https://github.com/honojs/hono/pull/2952
- fix(context): default JSONRespond and TextRespond StatusCode generic arg by @EdamAme-x in https://github.com/honojs/hono/pull/2954
- refactor(request): shorten
parseBody
and remove unnecessary check by @yusukebe in https://github.com/honojs/hono/pull/2947 - refactor(jsx): reduce code size and improve maintainability by @usualoma in https://github.com/honojs/hono/pull/2956
Full Changelog: https://github.com/honojs/hono/compare/v4.4.4...v4.4.5
v4.4.4
What's Changed
- fix(typo): Fix typo in request.test.ts by @yasuaki640 in https://github.com/honojs/hono/pull/2899
- feat(hono-base): skip import HTTPException by using HTTPResponseError by @usualoma in https://github.com/honojs/hono/pull/2898
- chore: improve unfinalized response error by @Cherry in https://github.com/honojs/hono/pull/2902
- chore: create .gitpod.yml by @EdamAme-x in https://github.com/honojs/hono/pull/2868
- fix(cloudflare-workers): export getConnInfo() by @ryuapp in https://github.com/honojs/hono/pull/2906
- fix(hono-base): return 404 if lacking response in a single sync handler by @yusukebe in https://github.com/honojs/hono/pull/2909
- refactor: remove
Prettify
as duplicated withSimplify
by @NamesMT in https://github.com/honojs/hono/pull/2914 - fix(types): #2912: interfaces array's respond typed as
never
by @NamesMT in https://github.com/honojs/hono/pull/2915 - feat(context):
c.redirect()
supportsTypedResponse
by @yusukebe in https://github.com/honojs/hono/pull/2908 - feat(jsx): support htmlfor attribute alias by @akira-tsuno in https://github.com/honojs/hono/pull/2916
- fix(filepath): allow suffix includes
-
and_
by @yusukebe in https://github.com/honojs/hono/pull/2910 - fix(types): add
_
prefix toTypedResponse
properties by @yusukebe in https://github.com/honojs/hono/pull/2917 - fix(types):
SimplifyDeepArray
should now actually be "deep" by @NamesMT in https://github.com/honojs/hono/pull/2920 - refactor(middleware/serve-static): call getContent only once if the file does not exist by @usualoma in https://github.com/honojs/hono/pull/2922
- chore: add
text
andhtml
for coverage reporter by @yusukebe in https://github.com/honojs/hono/pull/2923 - refactor(conninfo): create
types.ts
for type definitions by @yusukebe in https://github.com/honojs/hono/pull/2924
New Contributors
- @yasuaki640 made their first contribution in https://github.com/honojs/hono/pull/2899
- @Cherry made their first contribution in https://github.com/honojs/hono/pull/2902
- @akira-tsuno made their first contribution in https://github.com/honojs/hono/pull/2916
Full Changelog: https://github.com/honojs/hono/compare/v4.4.3...v4.4.4
v4.4.3
What's Changed
- ci: Update workflow name of release.yml by @siguici in https://github.com/honojs/hono/pull/2874
- refactor: removed unnecessary line by @EdamAme-x in https://github.com/honojs/hono/pull/2869
- ci: change name of workflow jobs by @EdamAme-x in https://github.com/honojs/hono/pull/2875
- docs(jsdoc): add jsdoc of some modules by @EdamAme-x in https://github.com/honojs/hono/pull/2836
- ci: Report coverage with CodeCov by @exoego in https://github.com/honojs/hono/pull/2862
- docs: update readme and migrate guide for migrating
deno.land/x
to JSR by @yusukebe in https://github.com/honojs/hono/pull/2879 - chore: add coverage badge to README by @exoego in https://github.com/honojs/hono/pull/2881
- fix(websocket): the onopen event cannot be triggered during delayed operations in deno by @JetLua in https://github.com/honojs/hono/pull/2864
- fix(cloudflare-workers): Update websocket.ts to return 101 status code by @ronkeiser in https://github.com/honojs/hono/pull/2886
- test(workerd): rename the runtime test
wrangler
toworkerd
by @yusukebe in https://github.com/honojs/hono/pull/2888 - test(workerd): add tests for WebSocket by @yusukebe in https://github.com/honojs/hono/pull/2891
- refactor(aws-lambda): merge custom-context into types by @exoego in https://github.com/honojs/hono/pull/2889
- chore: Exclude type-only files from coverage by @exoego in https://github.com/honojs/hono/pull/2890
- test(presets): add tests for
hono/quick
andhono/tiny
by @yusukebe in https://github.com/honojs/hono/pull/2892 - fix(types): fix typo for unofficial status code type by @ryuapp in https://github.com/honojs/hono/pull/2894
- feat(hono-base): add
replaceRequest
option forapp.mount
by @yusukebe in https://github.com/honojs/hono/pull/2852
New Contributors
- @siguici made their first contribution in https://github.com/honojs/hono/pull/2874
- @JetLua made their first contribution in https://github.com/honojs/hono/pull/2864
- @ronkeiser made their first contribution in https://github.com/honojs/hono/pull/2886
Full Changelog: https://github.com/honojs/hono/compare/v4.4.2...v4.4.3
v4.4.2
What's Changed
- fix: add return types of void function by @EdamAme-x in https://github.com/honojs/hono/pull/2870
Full Changelog: https://github.com/honojs/hono/compare/v4.4.1...v4.4.2
v4.4.1
What's Changed
- refactor(pretty-json): remove useless condition by @6km in https://github.com/honojs/hono/pull/2815
- fix(aws-lambda): Update handler.ts getQueryString by @qualipsolutions in https://github.com/honojs/hono/pull/2782
- refactor(aws-lambda): Object.hasOwn is recommended by @exoego in https://github.com/honojs/hono/pull/2831
- fix(client): allow multiple files on the same key in form by @olivier-drieux in https://github.com/honojs/hono/pull/2791
- fix(helper/ssg): fix bug of joinPaths by @EdamAme-x in https://github.com/honojs/hono/pull/2809
- chore: Author should include JSDoc by @fzn0x in https://github.com/honojs/hono/pull/2840
- fix(middleware/body-limit): set default duplex option for readable stream by @fzn0x in https://github.com/honojs/hono/pull/2837
- refactor(websocket): remove unused condition by @fzn0x in https://github.com/honojs/hono/pull/2839
- feat(bun): WebSocket helper supports that env be
{ server: server }
by @nakasyou in https://github.com/honojs/hono/pull/2812 - refactor: added paths-ignore for ignore files of dont need tests by @EdamAme-x in https://github.com/honojs/hono/pull/2850
- ci: include node22 tests by @Jayllyz in https://github.com/honojs/hono/pull/2851
- docs(src/*): Add TSDoc comments to improve code documentation by @fzn0x in https://github.com/honojs/hono/pull/2841
- fix(types): allow blank env by @fzn0x in https://github.com/honojs/hono/pull/2834
- refactor: removed v4 branch in actions. by @EdamAme-x in https://github.com/honojs/hono/pull/2849
- refactor(helper/adapter): improve runtime detection by @6km in https://github.com/honojs/hono/pull/2846
- fix(jsx/dom): Fixed to not add "px" for certain properties, even if numeric value is given by @usualoma in https://github.com/honojs/hono/pull/2845
- refactor(aws-lambda): remove unused setHeadersToResult by @exoego in https://github.com/honojs/hono/pull/2828
- fix(validator): support json api header by @dil-borosz in https://github.com/honojs/hono/pull/2855
- refactor(helper/testing): remove some any of helper/testing by @EdamAme-x in https://github.com/honojs/hono/pull/2833
- docs: change to shell highlight by @EdamAme-x in https://github.com/honojs/hono/pull/2848
- refactor(compose): Remove type definition of ComposeContext that was defined twice by @chimame in https://github.com/honojs/hono/pull/2858
New Contributors
- @6km made their first contribution in https://github.com/honojs/hono/pull/2815
- @qualipsolutions made their first contribution in https://github.com/honojs/hono/pull/2782
- @olivier-drieux made their first contribution in https://github.com/honojs/hono/pull/2791
- @Jayllyz made their first contribution in https://github.com/honojs/hono/pull/2851
- @dil-borosz made their first contribution in https://github.com/honojs/hono/pull/2855
- @chimame made their first contribution in https://github.com/honojs/hono/pull/2858
Full Changelog: https://github.com/honojs/hono/compare/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"
}
}
https://github.com/honojs/hono/assets/10682/e2269e61-60c4-418b-9e5b-acead219362c
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
https://github.com/honojs/hono/pull/2714 - Body utility - add dot notation support for
parseBody
https://github.com/honojs/hono/pull/2675 - Body utility - specify detailed return type for
parseBody
https://github.com/honojs/hono/pull/2771 - SSG Helper - enhance combined hooks https://github.com/honojs/hono/pull/2686
- JSX DOM - improve compatibility with React - The 2024 May Update https://github.com/honojs/hono/pull/2756
- JSX DOM - introduce react-dom/client APIs and React.version https://github.com/honojs/hono/pull/2795
All Updates
- fix(secure-header): Replace NodeJS Buffer API by @watany-dev in https://github.com/honojs/hono/pull/2761
- fix(http-exception): prioritize the status code by @yusukebe in https://github.com/honojs/hono/pull/2767
- feat: Introduce ConnInfo helper/adapter by @nakasyou in https://github.com/honojs/hono/pull/2595
- feat(middleware): Introduce Timeout Middleware by @watany-dev in https://github.com/honojs/hono/pull/2615
- feat: decode percent-encoded path in getPath by @usualoma in https://github.com/honojs/hono/pull/2714
- feat(utils/body): add dot notation support for
parseBody
by @fzn0x in https://github.com/honojs/hono/pull/2675 - refactor(cloudflare-workers): remove
@cloudflare/workers-types
by @yusukebe in https://github.com/honojs/hono/pull/2773 - feat(jsx/dom): improve compatibility with React - The 2024 May Update by @usualoma in https://github.com/honojs/hono/pull/2756
- feat(utils): specify detailed return type for parseBody by @usualoma in https://github.com/honojs/hono/pull/2771
- feat(ssg): enhance conbined hooks by @watany-dev in https://github.com/honojs/hono/pull/2686
- feat(jsr): support JSR by @yusukebe in https://github.com/honojs/hono/pull/2662
- refactor(request): show user-friendly type for
c.req.param()
by @usualoma in https://github.com/honojs/hono/pull/2780 - refactor(utils/