yewstack / yew

Rust / Wasm framework for creating reliable and efficient web applications
https://yew.rs
Apache License 2.0
30.61k stars 1.42k forks source link

use_state: fix/clarify docstring #3570

Closed ydirson closed 9 months ago

ydirson commented 9 months ago

These are a few fixes that ought to make use_state easier to apprehend for newbies.

github-actions[bot] commented 9 months ago

Benchmark - core

Yew Master

vnode           fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ vnode_clone  2.648 ns      │ 2.808 ns      │ 2.658 ns      │ 2.661 ns      │ 100     │ 1000000000

Pull Request

vnode           fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ vnode_clone  2.47 ns       │ 2.659 ns      │ 2.474 ns      │ 2.479 ns      │ 100     │ 1000000000
github-actions[bot] commented 9 months ago

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

https://yew-rs-api--pr3570-docfix-usestate-3nmdtfnw.web.app

(expires Fri, 29 Dec 2023 20:57:21 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

github-actions[bot] commented 9 months ago

Benchmark - SSR

Yew Master

| Benchmark | Round | Min (ms) | Max (ms) | Mean (ms) | Standard Deviation | | --- | --- | --- | --- | --- | --- | | Baseline | 10 | 289.253 | 289.897 | 289.497 | 0.242 | | Hello World | 10 | 492.672 | 513.084 | 497.676 | 6.202 | | Function Router | 10 | 1612.841 | 1629.431 | 1620.665 | 4.772 | | Concurrent Task | 10 | 1005.707 | 1006.929 | 1006.255 | 0.366 | | Many Providers | 10 | 1118.801 | 1161.834 | 1132.940 | 15.296 |

Pull Request

| Benchmark | Round | Min (ms) | Max (ms) | Mean (ms) | Standard Deviation | | --- | --- | --- | --- | --- | --- | | Baseline | 10 | 289.324 | 295.159 | 290.104 | 1.785 | | Hello World | 10 | 494.895 | 512.133 | 500.201 | 5.900 | | Function Router | 10 | 1663.789 | 1686.854 | 1676.673 | 7.591 | | Concurrent Task | 10 | 1005.956 | 1006.845 | 1006.348 | 0.282 | | Many Providers | 10 | 1091.801 | 1177.594 | 1130.241 | 22.673 |
github-actions[bot] commented 9 months ago

Size Comparison

| examples | master (KB) | pull request (KB) | diff (KB) | diff (%) | | --- | --- | --- | --- | --- | | async_clock | 101.083 | 101.083 | 0 | 0.000% | | boids | 174.749 | 174.749 | 0 | 0.000% | | communication_child_to_parent | 93.473 | 93.473 | 0 | 0.000% | | communication_grandchild_with_grandparent | 106.454 | 106.454 | 0 | 0.000% | | communication_grandparent_to_grandchild | 101.708 | 101.708 | 0 | 0.000% | | communication_parent_to_child | 89.813 | 89.813 | 0 | 0.000% | | contexts | 106.581 | 106.581 | 0 | 0.000% | | counter | 86.854 | 86.854 | 0 | 0.000% | | counter_functional | 87.261 | 87.261 | 0 | 0.000% | | dyn_create_destroy_apps | 89.699 | 89.699 | 0 | 0.000% | | file_upload | 100.729 | 100.729 | 0 | 0.000% | | function_memory_game | 173.496 | 173.496 | 0 | 0.000% | | function_router | 350.745 | 350.745 | 0 | 0.000% | | function_todomvc | 162.206 | 162.206 | 0 | 0.000% | | futures | 230.408 | 230.408 | 0 | 0.000% | | game_of_life | 111.113 | 111.113 | 0 | 0.000% | | immutable | 188.435 | 188.435 | 0 | 0.000% | | inner_html | 80.555 | 80.555 | 0 | 0.000% | | js_callback | 110.321 | 110.321 | 0 | 0.000% | | keyed_list | 200.069 | 200.069 | 0 | 0.000% | | mount_point | 83.444 | 83.444 | 0 | 0.000% | | nested_list | 114.665 | 114.665 | 0 | 0.000% | | node_refs | 90.965 | 90.965 | 0 | 0.000% | | password_strength | 1751.691 | 1751.691 | 0 | 0.000% | | portals | 94.197 | 94.197 | 0 | 0.000% | | router | 319.565 | 319.565 | 0 | 0.000% | | simple_ssr | 141.324 | 141.324 | 0 | 0.000% | | ssr_router | 388.956 | 388.956 | 0 | 0.000% | | suspense | 116.551 | 116.551 | 0 | 0.000% | | timer | 89.367 | 89.367 | 0 | 0.000% | | timer_functional | 98.733 | 98.733 | 0 | 0.000% | | todomvc | 142.512 | 142.512 | 0 | 0.000% | | two_apps | 86.574 | 86.574 | 0 | 0.000% | | web_worker_fib | 135.577 | 135.577 | 0 | 0.000% | | web_worker_prime | 185.961 | 185.961 | 0 | 0.000% | | webgl | 83.116 | 83.116 | 0 | 0.000% |

✅ None of the examples has changed their size significantly.