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

Introduce additional information in SSR artifact to facilitate Hydration #2540

Merged
merged 9 commits into from Mar 25, 2022

Conversation

futursolo
Copy link
Member

Description

Originally part of #2453.

This pull request introduces assistive nodes on server-side rendered artifacts to assist hydration.

Checklist

  • I have run cargo make pr-flow
  • I have reviewed my own code
  • I have added tests (coming when hydration lands.)

# Conflicts:
#	.github/workflows/main-checks.yml
#	examples/agents/Cargo.toml
#	examples/boids/Cargo.toml
#	examples/contexts/Cargo.toml
#	examples/counter/Cargo.toml
#	examples/dyn_create_destroy_apps/Cargo.toml
#	examples/file_upload/Cargo.toml
#	examples/function_memory_game/Cargo.toml
#	examples/function_router/Cargo.toml
#	examples/function_router/index.html
#	examples/function_todomvc/Cargo.toml
#	examples/futures/Cargo.toml
#	examples/game_of_life/Cargo.toml
#	examples/inner_html/Cargo.toml
#	examples/js_callback/Cargo.toml
#	examples/keyed_list/Cargo.toml
#	examples/mount_point/Cargo.toml
#	examples/nested_list/Cargo.toml
#	examples/node_refs/Cargo.toml
#	examples/password_strength/Cargo.toml
#	examples/portals/Cargo.toml
#	examples/router/Cargo.toml
#	examples/suspense/Cargo.toml
#	examples/timer/Cargo.toml
#	examples/todomvc/Cargo.toml
#	examples/two_apps/Cargo.toml
#	examples/web_worker_fib/Cargo.toml
#	examples/webgl/Cargo.toml
#	packages/yew-router/Cargo.toml
#	packages/yew/Cargo.toml
#	packages/yew/Makefile.toml
#	packages/yew/src/app_handle.rs
#	packages/yew/src/dom_bundle/bcomp.rs
#	packages/yew/src/dom_bundle/mod.rs
#	packages/yew/src/dom_bundle/traits.rs
#	packages/yew/src/html/component/lifecycle.rs
#	packages/yew/src/html/component/mod.rs
#	packages/yew/src/html/component/scope.rs
#	packages/yew/src/html/mod.rs
#	packages/yew/src/lib.rs
#	packages/yew/src/renderer.rs
#	packages/yew/src/scheduler.rs
#	packages/yew/src/suspense/component.rs
#	packages/yew/src/suspense/mod.rs
#	packages/yew/src/virtual_dom/vcomp.rs
#	tools/website-test/Cargo.toml
#	website/docs/getting-started/build-a-sample-app.mdx
#	website/docs/tutorial/index.mdx
github-actions[bot]
github-actions bot previously approved these changes Mar 21, 2022
@github-actions
Copy link

github-actions bot commented Mar 21, 2022

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

https://yew-rs-api--pr2540-hydration-2-1bhtymj2.web.app

(expires Fri, 01 Apr 2022 11:02:00 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@github-actions
Copy link

github-actions bot commented Mar 21, 2022

Size Comparison

examples master (KB) pull request (KB) diff
boids 309.131 309.131 0
contexts 230.851 230.851 0
counter 162.897 162.897 0
dyn_create_destroy_apps 171.098 171.098 0
file_upload 193.268 193.268 0
function_memory_game 349.064 349.064 0
function_router 22.254 22.254 0
function_todomvc 324.441 324.441 0
futures 361.410 361.410 0
game_of_life 205.580 205.580 0
inner_html 154.726 154.726 0
js_callback 170.219 170.219 0
keyed_list 327.117 327.117 0
mount_point 162.056 162.056 0
nested_list 222.910 222.910 0
node_refs 169.041 169.041 0
password_strength 1849.893 1849.893 0
portals 175.579 175.579 0
router 584.637 584.637 0
suspense 220.350 220.350 0
timer 168.865 168.865 0
todomvc 268.791 268.791 0
two_apps 164.346 164.346 0
webgl 169.007 169.007 0

hamza1311
hamza1311 previously approved these changes Mar 22, 2022
Copy link
Member

@hamza1311 hamza1311 left a comment

Choose a reason for hiding this comment

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

Looks good to me. The one comment I left isn't blocking, feel free to address it here or merge it and take care of it in the future, if you want.

packages/yew/src/virtual_dom/vtag.rs Outdated Show resolved Hide resolved
@futursolo futursolo dismissed stale reviews from hamza1311 and github-actions via b52d63b March 22, 2022 04:32
github-actions[bot]
github-actions bot previously approved these changes Mar 22, 2022
@futursolo futursolo added the A-yew Area: The main yew crate label Mar 22, 2022
Copy link
Member

@WorldSEnder WorldSEnder left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me, just slight nitpicks and one question.

packages/yew/src/html/component/scope.rs Outdated Show resolved Hide resolved
packages/yew/src/server_renderer.rs Outdated Show resolved Hide resolved
packages/yew/src/server_renderer.rs Outdated Show resolved Hide resolved
Copy link
Member

@WorldSEnder WorldSEnder left a comment

Choose a reason for hiding this comment

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

lgtm, everything addressed.

@futursolo futursolo merged commit 2e098f4 into yewstack:master Mar 25, 2022
@futursolo futursolo deleted the hydration-2 branch March 26, 2022 09:20
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
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants