You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.
Prism SSR functions will only return once the whole page/content has been string concatenated. This is okay but a technique known as progressive render improves on this process by yielding chunks back that can be written / streamed to the response. Using Transfer-Encoding: chunked in the response header means the client will gradually render in content before the server has ended the response.
These would mean ditching the current template literal approach and instead using yield with a generator function. And there would need to be some figuring out to where to draw the end of chunks while still being correctly parsable by the client.
The other thing is that progressive render is to get content to client before all the data / state has been fully formed on the server rather than to send content before the full concatenation is done. aka progressive render is for dealing with the speed issue of getting data for the view (e.g. accessing and making db requests) rather than the time it takes to do the string concatenation (which is already fast).
This complicates things as rather than sending a fully formed data structure to the render function it requires some sort of partial unresolved state. This can be done is JavaScript with getters, promises and generators but I am unsure of how it would work out in Rust (#19).
The text was updated successfully, but these errors were encountered:
Prism SSR functions will only return once the whole page/content has been string concatenated. This is okay but a technique known as progressive render improves on this process by yielding chunks back that can be written / streamed to the response. Using
Transfer-Encoding: chunked
in the response header means the client will gradually render in content before the server has ended the response.These would mean ditching the current template literal approach and instead using yield with a generator function. And there would need to be some figuring out to where to draw the end of chunks while still being correctly parsable by the client.
The other thing is that progressive render is to get content to client before all the data / state has been fully formed on the server rather than to send content before the full concatenation is done. aka progressive render is for dealing with the speed issue of getting data for the view (e.g. accessing and making db requests) rather than the time it takes to do the string concatenation (which is already fast).
This complicates things as rather than sending a fully formed data structure to the render function it requires some sort of partial unresolved state. This can be done is JavaScript with getters, promises and generators but I am unsure of how it would work out in Rust (#19).
The text was updated successfully, but these errors were encountered: