fix: Update SuspenseList
to handle hydration context and add unit tests for resolveSSRNode
and createResource
functions
#2531
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.
Summary
Objective: To make
SuspenseList
usable in SSR and add some simple tests.Currently,
SuspenseList
is a fairly reliable implementation of the component in CSR, but it doesn't work well in SSR.This modification aims to improve the reliability of
SuspenseList
by aligning the hydration key with the client-side.How did you test this change?
In addition to the issue with
SuspenseList
and direct DOM elements injected, it also fails to follow the specification in CSR.For example, it currently fails to drive in the following situations:
SuspenseList
and direct DOM elements injected - [Bug?]: SuspenseList hydration error #2124This commit is an incomplete solution because it fails to express
revealOrder
. However, the existing component does not perform deferred initial loading at all, sorevealOrder
itself is never expressed.So I'm requesting a pull because I don't think this commit breaks existing functionality, and I think it should be prioritized in terms of making the component more stable to run.