Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow functions returning unit in use_effect #2849

Merged
merged 3 commits into from Aug 28, 2022

Conversation

hamza1311
Copy link
Member

Description

Add a new TearDown trait as that is used as destructor for use_effect hook

Fixes #2844

Checklist

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

@hamza1311 hamza1311 added this to the v0.20 milestone Aug 28, 2022
@hamza1311 hamza1311 added the A-yew Area: The main yew crate label Aug 28, 2022
github-actions[bot]
github-actions bot previously approved these changes Aug 28, 2022
@github-actions
Copy link

github-actions bot commented Aug 28, 2022

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

https://yew-rs-api--pr2849-use-effect-teardown-0oqr1a6s.web.app

(expires Sun, 04 Sep 2022 14:30:56 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@github-actions
Copy link

github-actions bot commented Aug 28, 2022

Benchmark - SSR

Yew Master

Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 353.678 355.743 354.502 0.691
Hello World 10 1054.496 1060.380 1057.540 2.494
Function Router 10 2628.538 2641.555 2635.113 4.093
Concurrent Task 10 1009.622 1013.104 1011.007 1.056

Pull Request

Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 336.640 337.998 337.271 0.467
Hello World 10 1049.996 1057.001 1052.495 2.291
Function Router 10 2633.351 2641.998 2637.087 2.295
Concurrent Task 10 1009.893 1011.705 1010.784 0.578

@github-actions
Copy link

github-actions bot commented Aug 28, 2022

Size Comparison

examples master (KB) pull request (KB) diff (KB) diff (%)
boids 169.355 169.356 +0.001 +0.001%
contexts 107.389 107.380 -0.009 -0.008%
counter 84.911 84.911 0 0.000%
counter_functional 85.535 85.537 +0.002 +0.002%
dyn_create_destroy_apps 87.863 87.868 +0.005 +0.006%
file_upload 101.433 101.433 0 0.000%
function_memory_game 162.726 162.727 +0.001 +0.001%
function_router 345.443 345.455 +0.012 +0.003%
function_todomvc 157.710 157.700 -0.010 -0.006%
futures 221.990 221.991 +0.001 +0.000%
game_of_life 105.071 105.069 -0.002 -0.002%
immutable 180.744 180.736 -0.008 -0.004%
inner_html 82.010 82.011 +0.001 +0.001%
js_callback 110.732 110.722 -0.011 -0.010%
keyed_list 193.483 193.482 -0.001 -0.001%
mount_point 84.694 84.694 0 0.000%
nested_list 112.012 112.011 -0.001 -0.001%
node_refs 91.855 91.854 -0.001 -0.001%
password_strength 1546.345 1546.344 -0.001 -0.000%
portals 95.437 95.434 -0.003 -0.003%
router 314.906 314.905 -0.001 -0.000%
simple_ssr 151.382 151.391 +0.009 +0.006%
ssr_router 390.930 390.935 +0.005 +0.001%
suspense 108.431 108.426 -0.005 -0.005%
timer 87.706 87.707 +0.001 +0.001%
todomvc 139.212 139.213 +0.001 +0.001%
two_apps 85.557 85.557 0 0.000%
web_worker_fib 150.537 150.532 -0.005 -0.003%
webgl 85.688 85.691 +0.003 +0.003%

✅ None of the examples has changed their size significantly.

@hamza1311 hamza1311 merged commit 0e0d694 into yewstack:master Aug 28, 2022
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.

Allow functions returning unit in use_effect
2 participants