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

add send_stream method for Scope #2619

Merged
merged 5 commits into from
Aug 28, 2022
Merged

add send_stream method for Scope #2619

merged 5 commits into from
Aug 28, 2022

Conversation

laizy
Copy link
Contributor

@laizy laizy commented Apr 17, 2022

Description

Fixes #2405

Checklist

  • I have run cargo make pr-flow
  • I have reviewed my own code
  • I have added tests

@@ -92,6 +92,7 @@ hydration = ["csr"]
trace_hydration = ["hydration"]
doc_test = ["csr", "hydration", "ssr"]
wasm_test = ["csr", "hydration", "ssr"]
nightly = ["futures"]
Copy link
Member

Choose a reason for hiding this comment

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

futures::stream is not nightly?

Copy link
Member

Choose a reason for hiding this comment

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

But AsyncIterator is. Does someone know about the relation of the futures library to the std lib and if their traits will somehow magically migrate to std::async_iter::AsyncIterator or be compatible?

Copy link
Member

Choose a reason for hiding this comment

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

In a future release of futures, they may choose to either impose a blank implementation of Stream for any type that implements AsyncIterator or make it a type alias.

But this does not matter at the moment as both tokio and futures point to futures::Stream and you need StreamExt to poll a stream.

packages/yew/src/html/component/scope.rs Outdated Show resolved Hide resolved
packages/yew/src/html/component/scope.rs Outdated Show resolved Hide resolved
@futursolo futursolo added the A-yew Area: The main yew crate label Apr 17, 2022
@github-actions
Copy link

github-actions bot commented Apr 17, 2022

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

https://yew-rs-api--pr2619-send-stream-ssmlbfab.web.app

(expires Sun, 04 Sep 2022 17:55:27 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@github-actions
Copy link

github-actions bot commented Apr 17, 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 99.572 99.573 +0.001 +0.001%
function_memory_game 162.728 162.727 -0.001 -0.001%
function_router 345.439 345.455 +0.016 +0.005%
function_todomvc 157.712 157.700 -0.012 -0.007%
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 391.035 391.037 +0.002 +0.000%
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.

@WorldSEnder WorldSEnder added the S-waiting-on-author Status: awaiting action from the author of the issue/PR label Apr 21, 2022
@ranile
Copy link
Member

ranile commented Aug 28, 2022

@laizy can you update this PR? I can do it if you can't/don't want to

I went ahead and did it, hope that's okay with you

# Conflicts:
#	packages/yew/Cargo.toml
#	packages/yew/src/html/component/scope.rs
@ranile ranile enabled auto-merge (squash) August 28, 2022 17:51
@github-actions
Copy link

Benchmark - SSR

Yew Master

Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 433.541 455.487 441.461 5.998
Hello World 10 1310.158 1342.200 1322.533 11.122
Function Router 10 3154.746 3230.623 3171.111 21.458
Concurrent Task 10 1012.727 1015.593 1014.268 0.865

Pull Request

Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 436.974 448.834 443.580 4.541
Hello World 10 1313.138 1329.603 1319.723 5.814
Function Router 10 3126.782 3144.821 3132.861 5.444
Concurrent Task 10 1012.156 1016.195 1014.297 1.225

@ranile ranile merged commit fc96543 into yewstack:master Aug 28, 2022
@laizy laizy deleted the send-stream branch August 29, 2022 10:22
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 S-waiting-on-author Status: awaiting action from the author of the issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants