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

Question:how does react-server achieve stream pre-rendered HTML #1009

Open
HOUCe opened this issue Jul 5, 2019 · 0 comments
Open

Question:how does react-server achieve stream pre-rendered HTML #1009

HOUCe opened this issue Jul 5, 2019 · 0 comments

Comments

@HOUCe
Copy link

HOUCe commented Jul 5, 2019

First of all, many thanks for react-server! It is really amazing!

My question is: how does react-server achieve stream pre-rendered HTML?

I noticed that react-server uses ReactDOMServer.renderToString rather than renderToNodeStream. It seems for me that it is impossible to get stream pre-rendered HTML(I probably get wrong).

I also noticed that you mentioned "react-server has the concept of a RootElement, by RootElement we can get stream pre-rendered HTML". As far as I know, when you use renderToString and get the html string then make a response to client, the request is already finished. (Or use http 2.0 server push?). So how does stream come?

I am new to SSR, and don't know much details about Big-pipe. Please forgive me if the question is strange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant