yew icon indicating copy to clipboard operation
yew copied to clipboard

Change the #[function_component] attribute to #[component] by default

Open tdooms opened this issue 2 years ago • 3 comments

Description

Change the #[function_component] attribute to #[component] by default (the original name is kept as a re-export for backwards compatability).

With the current state of function components, it is no longer required to have a verbose name.

All occurences in the examples, docs and internal use have been changed to #[component].

Checklist

  • [x] I have reviewed my own code
  • [x] I have added tests

tdooms avatar Oct 05 '23 11:10 tdooms

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

https://yew-rs--pr3447-components-315ai2yg.web.app

(expires Thu, 12 Oct 2023 12:12:13 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

github-actions[bot] avatar Oct 05 '23 11:10 github-actions[bot]

Benchmark - SSR

Yew Master

Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 382.319 382.690 382.477 0.098
Hello World 10 773.400 776.621 774.229 1.021
Function Router 10 2459.513 2476.405 2469.237 6.634
Concurrent Task 10 1009.122 1011.866 1010.663 0.813
Many Providers 10 1750.867 1788.010 1766.883 12.450

Pull Request

Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 382.374 384.419 382.760 0.623
Hello World 10 776.463 780.503 778.232 1.428
Function Router 10 2459.141 2475.647 2470.558 5.410
Concurrent Task 10 1008.201 1011.741 1010.204 1.203
Many Providers 10 1748.473 1787.680 1765.321 13.563

github-actions[bot] avatar Oct 05 '23 11:10 github-actions[bot]

Size Comparison

examples master (KB) pull request (KB) diff (KB) diff (%)
async_clock 102.945 102.945 0 0.000%
boids 175.666 175.666 0 0.000%
communication_child_to_parent 95.298 95.298 0 0.000%
communication_grandchild_with_grandparent 109.037 109.037 0 0.000%
communication_grandparent_to_grandchild 105.718 105.718 0 0.000%
communication_parent_to_child 92.784 92.784 0 0.000%
contexts 113.453 113.453 0 0.000%
counter 89.197 89.197 0 0.000%
counter_functional 89.931 89.931 0 0.000%
dyn_create_destroy_apps 92.315 92.315 0 0.000%
file_upload 103.514 103.514 0 0.000%
function_memory_game 174.629 174.629 0 0.000%
function_router 353.632 353.632 0 0.000%
function_todomvc 163.455 163.455 0 0.000%
futures 227.446 227.446 0 0.000%
game_of_life 112.217 112.217 0 0.000%
immutable 188.789 188.789 0 0.000%
inner_html 85.981 85.981 0 0.000%
js_callback 113.457 113.457 0 0.000%
keyed_list 201.198 201.198 0 0.000%
mount_point 89.188 89.188 0 0.000%
nested_list 115.762 115.762 0 0.000%
node_refs 96.291 96.291 0 0.000%
password_strength 1720.994 1720.994 0 0.000%
portals 98.362 98.362 0 0.000%
router 319.566 319.566 0 0.000%
simple_ssr 144.239 144.239 0 0.000%
ssr_router 391.404 391.404 0 0.000%
suspense 119.066 119.066 0 0.000%
timer 91.797 91.797 0 0.000%
timer_functional 100.473 100.473 0 0.000%
todomvc 143.688 143.688 0 0.000%
two_apps 89.897 89.897 0 0.000%
web_worker_fib 138.868 138.868 0 0.000%
web_worker_prime 190.462 190.462 0 0.000%
webgl 88.552 88.552 0 0.000%

✅ None of the examples has changed their size significantly.

github-actions[bot] avatar Oct 05 '23 11:10 github-actions[bot]