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

Simple NodeRef passing to <Link> for yew-router #2877

Merged
merged 2 commits into from
Sep 19, 2022

Conversation

athanclark
Copy link
Contributor

Description

Implementation of the proposal to add NodeRef access to a <Link> component.

Discussion: #2876

Checklist

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

@athanclark athanclark changed the title simple NodeRef passing Simple NodeRef passing to <Link> for yew-router Sep 16, 2022
@athanclark athanclark changed the title Simple NodeRef passing to <Link> for yew-router Simple NodeRef passing to <Link> for yew-router Sep 16, 2022
@github-actions
Copy link

github-actions bot commented Sep 17, 2022

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

https://yew-rs-api--pr2877-link-noderef-7yej881h.web.app

(expires Sun, 25 Sep 2022 01:35:01 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@github-actions
Copy link

github-actions bot commented Sep 17, 2022

Benchmark - SSR

Yew Master

Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 406.443 454.724 425.669 15.710
Hello World 10 674.826 732.906 695.776 19.150
Function Router 10 2680.836 2786.075 2736.772 35.286
Concurrent Task 10 1009.181 1011.747 1010.243 0.702

Pull Request

Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 362.322 408.826 380.294 12.494
Hello World 10 688.797 733.384 709.103 13.825
Function Router 10 2697.362 2812.108 2750.644 34.146
Concurrent Task 10 1009.434 1011.639 1010.396 0.710

@github-actions
Copy link

github-actions bot commented Sep 17, 2022

Size Comparison

examples master (KB) pull request (KB) diff (KB) diff (%)
boids 170.248 170.258 +0.010 +0.006%
communication_child_to_parent 90.466 90.463 -0.003 -0.003%
communication_grandchild_with_grandparent 105.417 105.421 +0.004 +0.004%
communication_grandparent_to_grandchild 101.315 101.315 0 0.000%
communication_parent_to_child 87.604 87.604 +0.001 +0.001%
contexts 107.846 107.840 -0.006 -0.005%
counter 85.478 85.477 -0.001 -0.001%
counter_functional 86.006 86.006 0 0.000%
dyn_create_destroy_apps 88.380 88.378 -0.002 -0.002%
file_upload 100.058 100.056 -0.002 -0.002%
function_memory_game 163.800 163.792 -0.008 -0.005%
function_router 348.431 348.715 +0.284 +0.082%
function_todomvc 158.613 158.610 -0.003 -0.002%
futures 222.003 221.986 -0.017 -0.007%
game_of_life 105.742 105.740 -0.002 -0.002%
immutable 181.693 181.695 +0.002 +0.001%
inner_html 82.344 82.343 -0.001 -0.001%
js_callback 111.375 111.374 -0.001 -0.001%
keyed_list 195.562 195.559 -0.004 -0.002%
mount_point 85.095 85.095 0 0.000%
nested_list 112.596 112.593 -0.003 -0.003%
node_refs 93.000 92.999 -0.001 -0.001%
password_strength 1547.428 1547.425 -0.003 -0.000%
portals 96.286 96.287 +0.001 +0.001%
router 318.092 318.441 +0.350 +0.110%
simple_ssr 152.123 152.120 -0.003 -0.002%
ssr_router 393.963 394.151 +0.188 +0.048%
suspense 109.239 109.235 -0.004 -0.004%
timer 88.319 88.319 0 0.000%
todomvc 139.713 139.713 0 0.000%
two_apps 86.088 86.089 +0.001 +0.001%
web_worker_fib 152.225 152.224 -0.001 -0.001%
webgl 84.785 84.782 -0.003 -0.003%

✅ None of the examples has changed their size significantly.

@@ -24,6 +24,9 @@ where
pub query: Option<Q>,
#[prop_or_default]
pub disabled: bool,
/// [`NodeRef`](yew::html::NodeRef) for the `<a>` element.
#[prop_or_default]
pub a_ref: NodeRef,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub a_ref: NodeRef,
pub anchor_ref: NodeRef,

I think a_ref should be given a more descriptive name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree, I'll change right now.

@futursolo futursolo added the A-yew-router Area: The yew-router crate label Sep 18, 2022
@WorldSEnder WorldSEnder merged commit 89dd3b3 into yewstack:master Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-yew-router Area: The yew-router crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants