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

Use SSR rendered as initial html for runtime hydration test #4444

Merged

Conversation

tanhauhau
Copy link
Member

@tanhauhau tanhauhau commented Feb 22, 2020

When running runtime (hydration) test, we are expecting the component to create the DOM while failing to claim elements from HTML.

This may fail to surface bugs such as hydrated DOM different from client rendered DOM.

Fixes:

  • claiming HtmlTag element
  • hydrating extra attributes from SSR

Not fixed for now:

  • claiming HtmlTag in head

@tanhauhau
Copy link
Member Author

@Conduitry I'm thinking about this PR, should we test for both:

  • claiming from empty HTML, repair/reconstruct when needed
  • claiming from SSR rendered HTML, making sure no breaking during hydration

@Conduitry
Copy link
Member

Yeah I think that makes sense to run the hydration tests starting with both the SSR output and from an empty document.

@tanhauhau
Copy link
Member Author

wow.. finally circling back to this PR! okay. let me tidy up the PR for that.

@tanhauhau tanhauhau force-pushed the tanhauhau/better-runtime-hydration-test branch from 83fb842 to b629ae4 Compare April 20, 2020 13:46
@tanhauhau
Copy link
Member Author

@Conduitry updated the PR!

@tanhauhau tanhauhau force-pushed the tanhauhau/better-runtime-hydration-test branch from b629ae4 to 3707b9a Compare June 15, 2021 03:02
Copy link
Member

@benmccann benmccann left a comment

Choose a reason for hiding this comment

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

This is great. Thank you so much! 😄

If I put the change from #6204 back in then I get more test failures than I can count, so this makes me much more optimistic about our ability to make hydration improvements

test/runtime/index.ts Outdated Show resolved Hide resolved
@tanhauhau tanhauhau force-pushed the tanhauhau/better-runtime-hydration-test branch from efac66e to 841137a Compare June 18, 2021 16:53
@benmccann benmccann merged commit 3f990a9 into sveltejs:master Jun 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants