Wait for the suspense boundary above the router to resolve before sending the first streaming chunk #3891
+1,044
−557
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 PR waits until the suspense boundary is finished to send down the first http chunk with the status code, headers and
<head>
element. If no router is present, the user can callcommit_initial_chunk
to start streaming manually.It introduces two new crates to avoid pulling in the full
dioxus-fullstack
crate in the router:dioxus-fullstack-protocol
contains the data and serialization format fullstack needs for streaming on both the server and client side. I would like to keep the serialization and deserialization logic close together so they don't get out of syncdioxus-fullstack-hooks
contains theuse_server_future
hook and the new streaming context. It depends ondioxus-fullstack-protocol
to submit data to be serialized and deserialized in dioxus fullstack. This is the crate the router relies on to tell fullstack when to start streamingFixes #2739