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

Proposal #64

Closed
wants to merge 1 commit into from
Closed

Conversation

JoviDeCroock
Copy link

@JoviDeCroock JoviDeCroock commented Feb 4, 2025

This proposal counteracts hydration mismatches, the client components are delayed until hydration completes. When the server-components render enters the screen it will look like

<main>
  <ui>
  <gap>
  <ui>
  <gap>

These gaps are where the client components will slot in, if the lazy promises are present during hydration then Preact will "reserve" DOM-nodes to account for the yet-to-resolve component so it can resume hydration from there. Which we don't want, we can ofcourse already start fetching the component as an optimisation but we should not render the promise.

In preactjs/preact#4442 we are actually fixing this but I am not sure whether that approach would work here as we aren't trying to render these promises on the server nor are we even willing to hydrate them so I think this is the best option to remove potential missmatches.

Copy link

pkg-pr-new bot commented Feb 4, 2025

Open in Stackblitz

npm i https://pkg.pr.new/jacob-ebey/turbo-stream@64

commit: 47e1592

@JoviDeCroock JoviDeCroock deleted the proposal branch February 4, 2025 19:42
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.

1 participant