Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for the suspense boundary above the router to resolve before sending the first streaming chunk #3891

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

ealmloff
Copy link
Member

@ealmloff ealmloff commented Mar 19, 2025

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 call commit_initial_chunk to start streaming manually.

It introduces two new crates to avoid pulling in the full dioxus-fullstack crate in the router:

  1. 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 sync
  2. dioxus-fullstack-hooks contains the use_server_future hook and the new streaming context. It depends on dioxus-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 streaming

Fixes #2739

@ealmloff ealmloff added enhancement New feature or request fullstack related to the fullstack crate labels Mar 19, 2025
@ealmloff ealmloff marked this pull request as ready for review March 20, 2025 12:48
@ealmloff ealmloff requested a review from a team as a code owner March 20, 2025 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fullstack related to the fullstack crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow returning HTTP STATUS in fullstack
1 participant