Skip to content

fix(jsx/dom): align useActionState with React 19 - #5635

Merged
yusukebe merged 1 commit into
mainfrom
hono-kun/use-action-state-queue
Nov 16, 2026
Merged

yusukebe merged 1 commit into
mainfrom
hono-kun/use-action-state-queue

Conversation

@hono-kun

@hono-kun hono-kun Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Hono-kun here, an AI maintainer, posting on behalf of @yusukebe.

Makes useActionState in hono/jsx/dom behave like React 19.

  • Actions now run one at a time, and each gets the state returned by the previous one. Before, two quick calls got the same state, so one update was lost.
  • It returns isPending as a third value, and dispatch stays the same function across renders.
  • When no action is running, the action starts right away, so the timing of a single call does not change.

Based on the fix by @ashunar0. Closes #5561.

Co-authored-by: Ashunar0 <asahi.gaia1530@gmail.com>
@github-actions

Copy link
Copy Markdown

Bundle size check

main (0809e48) #5635 (7405d6b) +/-
Bundle Size (B) 20,137B 20,137B 0B
Bundle Size (KB) 19.67K 19.67K 0K

Compiler Diagnostics (tsc)

main (0809e48) #5635 (7405d6b) +/-
Files 83 83 0
Lines 59,460 59,460 0
Identifiers 60,641 60,641 0
Symbols 106,536 106,536 0
Types 163,092 163,092 0
Instantiations 414,023 414,023 0
Memory used 208,504K 207,748K -756K
I/O read 0.01s 0.01s 0s
I/O write 0s 0s 0s
Parse time 0.31s 0.24s -0.07s
Bind time 0.1s 0.08s -0.02s
Check time 1.26s 1.01s -0.25s
Emit time 0s 0s 0s
Total time 1.68s 1.33s -0.35s

Compiler Diagnostics (typescript-go)

main (0809e48) #5635 (7405d6b) +/-
Files 215 215 0
Lines 121,022 121,022 0
Identifiers 107,365 107,365 0
Symbols 181,168 181,168 0
Types 262,348 262,348 0
Instantiations 621,588 621,588 0
Memory used 154,137K 154,114K -23K
Memory allocs 1,783,914 1,784,004 +90
Config time 0.001s 0.001s 0s
BuildInfo read time 0.001s 0s -0.001s
Parse time 0.092s 0.067s -0.025s
Bind time 0s 0s 0s
Check time 0.502s 0.383s -0.119s
Emit time 0.004s 0.003s -0.001s
Changes compute time 0.024s 0.022s -0.002s
Total time 0.659s 0.502s -0.157s

Reported by octocov

@github-actions

Copy link
Copy Markdown

HTTP Performance Benchmark

Framework Runtime Average Ping Query Body
hono (origin/main) bun 36,503.37 50,119.13 32,529.27 26,861.71
hono (current) bun 36,455.68 49,603.96 32,768.15 26,994.94
Change -0.13% -1.03% +0.73% +0.50%

@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.26%. Comparing base (f6fbaf0) to head (b3c6d84).

Files with missing lines Patch % Lines
src/jsx/dom/hooks/index.ts 81.81% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5635      +/-   ##
==========================================
+ Coverage   80.25%   80.26%   +0.01%     
==========================================
  Files         150      150              
  Lines       10677    10693      +16     
  Branches     2392     2393       +1     
==========================================
+ Hits         8569     8583      +14     
- Misses       2108     2110       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@yusukebe
yusukebe merged commit 0d43a74 into main Nov 16, 2026
35 of 36 checks passed
@yusukebe
yusukebe deleted the hono-kun/use-action-state-queue branch November 16, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hono/jsx/dom: useActionState behaves differently from React 19

1 participant