FormidableLabs/react-ssr-prepass

Does this do a "double render" to catch what needs to be SSRd?

ScriptedAlchemy opened this issue · 2 comments

Hey!

Checking out this project and wanted to get some clarification.

When you are walking the tree in the prepass, is it operating on a double render mechanism of sorts? prepass walks and either renders or executes parts of reacts renderer to suspend on the flushed chunks. Noticed any performance drags with your current implementation method compared to other mechanisms like react-universal-component or loadable-components?

Interested in learning a little more about this project as I was getting ready to patch react-dom.

Looks pretty neat so far!

Per the readme:

You can use it to fetch data before your SSR code calls renderToString or renderToNodeStream.

Hence the "prepass" in the name.

And no this approach isn't particularly performant, but relative to data fetching times it doesn't make a big dent.

Sorry for the late reply. It isn't efficient in the sense of it indeed walking the tree independently of the actual React server-side rendering. But on the other hand it's not doing a real render, so it's as efficient as this approach can be.

I think the other parts of this question have been answered in the above comment :)