|
|
|
|
|
by Bartkusa
3603 days ago
|
|
Each page is split into sections.
Each section may wait for async data and API responses.
When all the data arrives, the section is rendered as an HTML string. The server streams each section's static HTML to the client as soon as it's ready, and after all prior sections are streamed. The server also streams the async data to the browser. This avoids the latency of the client downloading some HTML, then downloading some JS, then making the requisite API calls for the page's data. (Think of it as a hacky version of HTTP Server Push.) On the client-side, React and your JS are downloaded, React will recycle as much of the static DOM as possible (writing isomorphic JS isn't always easy), then take over and do its thing. |
|
Where are these waiting sections? On the browser client or the server?
Is the React code that is to be rendered on the browser served up automatically by ReactServer?
I'm sure it's a wonderful framework, but a diagram is really needed to understand any of this.