hono icon indicating copy to clipboard operation
hono copied to clipboard

fix(types): correct types when middleware return Promise<void>

Open yusukebe opened this issue 1 month ago • 11 comments

Fixes #4517

The author should do the following, if applicable

  • [ ] Add tests
  • [ ] Run tests
  • [ ] bun run format:fix && bun run lint:fix to format the code
  • [ ] Add TSDoc/JSDoc to document the code

yusukebe avatar Nov 21 '25 08:11 yusukebe

Bundle size check

main (8fe7fee) #4529 (98b6287) +/-
Bundle Size (B) 18,363B 18,363B 0B
Bundle Size (KB) 17.93K 17.93K 0K

Compiler Diagnostics (tsc)

main (8fe7fee) #4529 (98b6287) +/-
Files 303 303 0
Lines 140,900 140,916 16
Identifiers 128,526 128,544 18
Symbols 269,140 269,183 43
Types 198,856 201,545 2,689
Instantiations 639,355 657,625 18,270
Memory used 350,260K 358,685K 8,425K
I/O read 0.02s 0.02s 0s
I/O write 0s 0s 0s
Parse time 0.84s 0.72s -0.12s
Bind time 0.37s 0.31s -0.06s
Check time 3.34s 2.98s -0.36s
Emit time 0s 0s 0s
Total time 4.55s 4.02s -0.53s

Compiler Diagnostics (typescript-go)

main (8fe7fee) #4529 (98b6287) +/-
Files 272 272 0
Lines 118,789 118,805 16
Identifiers 117,959 117,977 18
Symbols 378,470 378,586 116
Types 360,479 364,398 3,919
Instantiations 3,764,726 3,797,300 32,574
Memory used 250,891K 252,148K 1,257K
Memory allocs 10,583,219 10,627,439 44,220
Parse time 0.089s 0.094s 0.005s
Bind time 0.048s 0.04s -0.008s
Check time 1.476s 1.688s 0.212s
Emit time 0s 0s 0s
Total time 1.617s 1.826s 0.209s

Reported by octocov

github-actions[bot] avatar Nov 21 '25 08:11 github-actions[bot]

HTTP Performance Benchmark

Framework Runtime Average Ping Query Body
hono (origin/main) bun 37,957.57 51,751.26 33,697.84 28,423.60
hono (current) bun 37,891.61 50,851.11 33,972.34 28,851.39
Change -0.17% -1.74% +0.81% +1.51%

github-actions[bot] avatar Nov 21 '25 08:11 github-actions[bot]

Bundle size check

main (342ff3b) #4529 (fbf6b04) +/-
Bundle Size (B) 18,363B 18,363B 0B
Bundle Size (KB) 17.93K 17.93K 0K

Compiler Diagnostics (tsc)

main (342ff3b) #4529 (fbf6b04) +/-
Files 303 303 0
Lines 140,900 140,916 16
Identifiers 128,526 128,544 18
Symbols 269,140 269,183 43
Types 198,856 201,545 2,689
Instantiations 639,355 657,625 18,270
Memory used 371,793K 358,518K -13,275K
I/O read 0.04s 0.02s -0.02s
I/O write 0s 0s 0s
Parse time 0.74s 0.71s -0.03s
Bind time 0.3s 0.29s -0.01s
Check time 2.83s 3.15s 0.32s
Emit time 0s 0s 0s
Total time 3.87s 4.15s 0.28s

Compiler Diagnostics (typescript-go)

main (342ff3b) #4529 (fbf6b04) +/-
Files 272 272 0
Lines 118,789 118,805 16
Identifiers 117,959 117,977 18
Symbols 378,470 378,586 116
Types 360,479 364,398 3,919
Instantiations 3,764,726 3,797,300 32,574
Memory used 250,948K 252,224K 1,276K
Memory allocs 10,583,093 10,627,567 44,474
Parse time 0.071s 0.094s 0.023s
Bind time 0.027s 0.027s 0s
Check time 1.542s 1.563s 0.021s
Emit time 0s 0s 0s
Total time 1.65s 1.698s 0.048s

Reported by octocov

github-actions[bot] avatar Nov 22 '25 09:11 github-actions[bot]

HTTP Performance Benchmark

Framework Runtime Average Ping Query Body
hono (origin/main) bun 37,898.49 51,988.80 34,006.93 27,699.74
hono (current) bun 37,684.05 52,296.17 33,407.78 27,348.19
Change -0.57% +0.59% -1.76% -1.27%

github-actions[bot] avatar Nov 22 '25 09:11 github-actions[bot]

Bundle size check

main (342ff3b) #4529 (e338371) +/-
Bundle Size (B) 18,363B 18,363B 0B
Bundle Size (KB) 17.93K 17.93K 0K

Compiler Diagnostics (tsc)

main (342ff3b) #4529 (e338371) +/-
Files 303 303 0
Lines 140,900 140,934 34
Identifiers 128,526 128,572 46
Symbols 269,140 289,648 20,508
Types 198,856 205,193 6,337
Instantiations 639,355 1,041,936 402,581
Memory used 371,793K 400,546K 28,753K
I/O read 0.04s 0.03s -0.01s
I/O write 0s 0s 0s
Parse time 0.74s 0.73s -0.01s
Bind time 0.3s 0.3s 0s
Check time 2.83s 3.6s 0.77s
Emit time 0s 0s 0s
Total time 3.87s 4.64s 0.77s

Compiler Diagnostics (typescript-go)

main (342ff3b) #4529 (e338371) +/-
Files 272 272 0
Lines 118,789 118,823 34
Identifiers 117,959 118,005 46
Symbols 378,470 419,425 40,955
Types 360,479 372,078 11,599
Instantiations 3,764,726 4,689,515 924,789
Memory used 250,948K 271,278K 20,330K
Memory allocs 10,583,093 12,346,467 1,763,374
Parse time 0.071s 0.073s 0.002s
Bind time 0.027s 0.027s 0s
Check time 1.542s 1.847s 0.305s
Emit time 0s 0s 0s
Total time 1.65s 1.956s 0.306s

Reported by octocov

github-actions[bot] avatar Nov 22 '25 10:11 github-actions[bot]

HTTP Performance Benchmark

Framework Runtime Average Ping Query Body
hono (origin/main) bun 36,096.72 48,929.37 31,741.98 27,618.82
hono (current) bun 35,610.19 47,537.32 31,717.07 27,576.19
Change -1.35% -2.85% -0.08% -0.15%

github-actions[bot] avatar Nov 22 '25 10:11 github-actions[bot]

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 91.52%. Comparing base (a5f3958) to head (51765d1). :warning: Report is 25 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4529   +/-   ##
=======================================
  Coverage   91.52%   91.52%           
=======================================
  Files         172      172           
  Lines       11221    11221           
  Branches     3254     3254           
=======================================
  Hits        10270    10270           
  Misses        950      950           
  Partials        1        1           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Nov 22 '25 10:11 codecov[bot]

Bundle size check

main (342ff3b) #4529 (4bffc55) +/-
Bundle Size (B) 18,363B 18,363B 0B
Bundle Size (KB) 17.93K 17.93K 0K

Compiler Diagnostics (tsc)

main (342ff3b) #4529 (4bffc55) +/-
Files 303 303 0
Lines 140,900 140,950 50
Identifiers 128,526 128,577 51
Symbols 269,140 289,611 20,471
Types 198,856 203,450 4,594
Instantiations 639,355 1,039,267 399,912
Memory used 371,793K 396,776K 24,983K
I/O read 0.04s 0.02s -0.02s
I/O write 0s 0s 0s
Parse time 0.74s 0.73s -0.01s
Bind time 0.3s 0.3s 0s
Check time 2.83s 3.73s 0.9s
Emit time 0s 0s 0s
Total time 3.87s 4.76s 0.89s

Compiler Diagnostics (typescript-go)

main (342ff3b) #4529 (4bffc55) +/-
Files 272 272 0
Lines 118,789 118,839 50
Identifiers 117,959 118,010 51
Symbols 378,470 419,388 40,918
Types 360,479 369,694 9,215
Instantiations 3,764,726 4,686,990 922,264
Memory used 250,948K 270,666K 19,718K
Memory allocs 10,583,093 12,329,606 1,746,513
Parse time 0.071s 0.102s 0.031s
Bind time 0.027s 0.047s 0.02s
Check time 1.542s 2.023s 0.481s
Emit time 0s 0s 0s
Total time 1.65s 2.179s 0.529s

Reported by octocov

github-actions[bot] avatar Nov 22 '25 10:11 github-actions[bot]

HTTP Performance Benchmark

Framework Runtime Average Ping Query Body
hono (origin/main) bun 36,578.76 50,306.13 31,365.39 28,064.75
hono (current) bun 37,618.29 50,918.75 33,757.68 28,178.45
Change +2.84% +1.22% +7.63% +0.41%

github-actions[bot] avatar Nov 22 '25 10:11 github-actions[bot]

Bundle size check

main (342ff3b) #4529 (07bd6c3) +/-
Bundle Size (B) 18,363B 18,363B 0B
Bundle Size (KB) 17.93K 17.93K 0K

Compiler Diagnostics (tsc)

main (342ff3b) #4529 (07bd6c3) +/-
Files 303 303 0
Lines 140,900 140,948 48
Identifiers 128,526 128,576 50
Symbols 269,140 289,624 20,484
Types 198,856 201,122 2,266
Instantiations 639,355 1,030,892 391,537
Memory used 371,793K 391,504K 19,711K
I/O read 0.04s 0.03s -0.01s
I/O write 0s 0s 0s
Parse time 0.74s 0.82s 0.08s
Bind time 0.3s 0.36s 0.06s
Check time 2.83s 3.79s 0.96s
Emit time 0s 0s 0s
Total time 3.87s 4.97s 1.1s

Compiler Diagnostics (typescript-go)

main (342ff3b) #4529 (07bd6c3) +/-
Files 272 272 0
Lines 118,789 118,837 48
Identifiers 117,959 118,009 50
Symbols 378,470 419,422 40,952
Types 360,479 365,724 5,245
Instantiations 3,764,726 4,672,600 907,874
Memory used 250,948K 269,780K 18,832K
Memory allocs 10,583,093 12,295,305 1,712,212
Parse time 0.071s 0.081s 0.01s
Bind time 0.027s 0.016s -0.011s
Check time 1.542s 1.702s 0.16s
Emit time 0s 0s 0s
Total time 1.65s 1.801s 0.151s

Reported by octocov

github-actions[bot] avatar Nov 22 '25 10:11 github-actions[bot]

HTTP Performance Benchmark

Framework Runtime Average Ping Query Body
hono (origin/main) bun 37,708.95 52,921.71 33,584.66 26,620.48
hono (current) bun 37,455.66 51,865.85 33,761.57 26,739.56
Change -0.67% -2.00% +0.53% +0.45%

github-actions[bot] avatar Nov 22 '25 10:11 github-actions[bot]

The issue was resolved by https://github.com/honojs/hono/pull/4552. Closing.

yusukebe avatar Dec 14 '25 22:12 yusukebe