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

fix: rewrite SSR client-side hydration #6067

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

johnjenkins
Copy link
Contributor

@johnjenkins johnjenkins commented Nov 28, 2024

What is the current behavior?

There are lots of rough edges around the use of Stencil's proprietary non-shadow components during SSR

GitHub Issue Number:

What is the new behavior?

A partial re-write of client-hydrate.ts (and few minor tweaks in the accompanying files) fixes all these issues.

Documentation

Does this introduce a breaking change?

  • Yes
  • No

^ no breaking changes, but I should mention that during / after hydrating now, there are some changes to the outputted markup:

  • A couple more internal tags / comments from the server generated markup
  • Fewer Stencil-generated comment nodes left behind after hydration

These changes could potentially cause users' test snapshots to fail.

Users would just need to update their snapshots

Testing

New spec tests. New e2e tests.

Other information

Referring to the linked issues, here's the same repo with the fixes applied:

image

image

image

image

I appreciate, with a re-factor to client-hydrate.ts this big, there's a degree of 'trust me bra' involved - it's difficult to grok. I've done my best to add lots of comments to help elucidate it's dark magic, but if it's too much or too little just let me know. If you'd like me to talk through what it's doing just let me know :)

@johnjenkins johnjenkins requested a review from a team as a code owner November 28, 2024 13:58
@johnjenkins johnjenkins marked this pull request as draft November 28, 2024 13:59
@johnjenkins johnjenkins changed the title fix(hydration): refactoring client hydration fix: rewrite SSR client-side hydration Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant