Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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.