Denote suspenseful components with comment markers #376
+178
−26
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.
Relates to preactjs/preact#4442
This adds the comments approach described in the RFC, these comments will be used with resumed hydration to correctly allocate the DOM-children required to rehydrate a Suspense boundary. Currently this purposefully excludes streaming renders.
This needs a lot more tests and will probably lead to a major version of RTS and Preact (to be discussed).
The algorithm we'd use in Preact for this would entail us searching for the comment boundary, so in the most ideal scenario this would look like
but there will be time where it looks like
due to adjacent suspending children, we'd have to look for 2 end nodes then so the search algorithm would have to count the amount of contained suspensions as well.