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

[Hydration] Detect hydration mismatches when scoped templates are wrong #4866

Open
nolanlawson opened this issue Nov 14, 2024 · 0 comments
Open
Labels
bug hydration Having to do with hydration after SSR

Comments

@nolanlawson
Copy link
Collaborator

Say you have two templates:

<!-- client.html -->
<template></template>
/* client.css */
:host {
  color: red;
}
<!-- server.html -->
<template></template>
/* server.scoped.css */
:host {
  color: blue;
}

If you use a dynamic render():

render() {
  return this.showA ? a : b
}

... and if showA is different on the client vs the server, then this should produce different lwc-*-host classes in the HTML versus the vdom.

With #4865 we essentially ignore the server's host scope token, so you will not see a hydration mismatch in the above case because we simply ignore the lwc-*-host given by the server.

Instead of ignoring the host scope token, we should truly validate it in the server vs the client's output.

Repro: 882ef03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug hydration Having to do with hydration after SSR
Projects
None yet
Development

No branches or pull requests

1 participant