Skip to content

Proposal#64

Closed
JoviDeCroock wants to merge 1 commit intojacob-ebey:v3-preactfrom
JoviDeCroock:proposal
Closed

Proposal#64
JoviDeCroock wants to merge 1 commit intojacob-ebey:v3-preactfrom
JoviDeCroock:proposal

Conversation

@JoviDeCroock
Copy link
Copy Markdown

@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.

@pkg-pr-new
Copy link
Copy Markdown

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