Skip to content

fix: compare render-time snapshots in UseReducerHandle::eq to restore child re-renders#4060

Merged
Madoshakalaka merged 1 commit intomasterfrom
fix/use-state-handle-prop-rerender
Mar 9, 2026
Merged

fix: compare render-time snapshots in UseReducerHandle::eq to restore child re-renders#4060
Madoshakalaka merged 1 commit intomasterfrom
fix/use-state-handle-prop-rerender

Conversation

@Madoshakalaka
Copy link
Member

Description

Fixes #4058

Checklist

  • I have reviewed my own code
  • I have added tests

I can confirm the the new test fails without this fix and passes with the fix.

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Visit the preview URL for this PR (updated for commit efde87d):

https://yew-rs-api--pr4060-fix-use-state-handle-luxaqauo.web.app

(expires Mon, 16 Mar 2026 08:27:17 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Benchmark - core

Yew Master

vnode           fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ vnode_clone  2.05 ns       │ 2.13 ns       │ 2.053 ns      │ 2.057 ns      │ 100     │ 1000000000

Pull Request

vnode           fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ vnode_clone  2.152 ns      │ 2.562 ns      │ 2.156 ns      │ 2.167 ns      │ 100     │ 1000000000

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Size Comparison

Details
examples master (KB) pull request (KB) diff (KB) diff (%)
async_clock 99.730 99.730 0 0.000%
boids 167.656 167.656 0 0.000%
communication_child_to_parent 93.058 93.058 0 0.000%
communication_grandchild_with_grandparent 104.896 104.896 0 0.000%
communication_grandparent_to_grandchild 101.201 101.201 0 0.000%
communication_parent_to_child 90.460 90.460 0 0.000%
contexts 105.098 105.213 +0.115 +0.110%
counter 85.794 85.794 0 0.000%
counter_functional 87.807 87.807 0 0.000%
dyn_create_destroy_apps 89.862 89.862 0 0.000%
file_upload 98.869 98.869 0 0.000%
function_delayed_input 93.905 94.026 +0.121 +0.129%
function_memory_game 172.905 173.019 +0.113 +0.066%
function_router 405.833 405.833 0 0.000%
function_todomvc 164.085 164.198 +0.113 +0.069%
futures 234.704 234.704 0 0.000%
game_of_life 104.354 104.354 0 0.000%
immutable 255.427 255.427 0 0.000%
inner_html 80.325 80.325 0 0.000%
js_callback 109.092 109.092 0 0.000%
keyed_list 179.318 179.318 0 0.000%
mount_point 83.718 83.718 0 0.000%
nested_list 112.474 112.474 0 0.000%
node_refs 91.138 91.138 0 0.000%
password_strength 1728.593 1728.593 0 0.000%
portals 92.598 92.598 0 0.000%
router 376.880 376.880 0 0.000%
suspense 113.330 113.330 0 0.000%
timer 88.200 88.200 0 0.000%
timer_functional 97.123 97.123 0 0.000%
todomvc 141.876 141.876 0 0.000%
two_apps 85.743 85.743 0 0.000%
web_worker_fib 135.620 135.620 0 0.000%
web_worker_prime 186.751 186.751 0 0.000%
webgl 82.724 82.724 0 0.000%

✅ None of the examples has changed their size significantly.

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Benchmark - SSR

Yew Master

Details
Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 310.867 311.146 310.999 0.091
Hello World 10 489.434 500.463 492.927 3.619
Function Router 10 33357.798 35008.962 34269.974 511.950
Concurrent Task 10 1006.055 1007.449 1006.887 0.533
Many Providers 10 1067.748 1095.217 1077.739 8.999

Pull Request

Details
Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 310.627 316.529 311.740 1.880
Hello World 10 475.799 485.247 480.427 4.098
Function Router 10 33072.970 34353.850 33623.041 385.069
Concurrent Task 10 1006.441 1007.811 1007.240 0.500
Many Providers 10 1085.484 1115.564 1096.765 9.105

@Madoshakalaka Madoshakalaka marked this pull request as ready for review March 9, 2026 08:45
@Madoshakalaka Madoshakalaka merged commit 84272ce into master Mar 9, 2026
37 checks passed
@Madoshakalaka Madoshakalaka added A-ci Area: The continuous integration A-yew Area: The main yew crate and removed A-ci Area: The continuous integration labels Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-yew Area: The main yew crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breaking change in 0.22.1: UseStateHandle as a prop no longer triggers child re-renders

1 participant