[styles] Streaming server-side rendering (original) (raw)

#I'm looking into new features of React 0.16; in particular the new renderToNodeStream() method.
To be able to use that, one would need to provide all the necessary CSS before any other body markup to avoid the Flash Of Unstyled Content issue.

Is it possible with your JSS implementation to utilize this? I do not want to run the renderToString() method since it is slow. I'm looking for a solution where the markup could be parsed and the styles could be calculated pre-render, and then later render the final app with renderToNodeStream().

In pseudo code:

let markup = (); let css = calculateStyles(markup);

let stream = renderToNodeStream(); // stream.pipe etc. ...

I realize this might not be a material-ui specific issue, but rather related to JSS. But I'm curious if you already have thought about this for your framework.