3 ms·
Using react-static here. Has some issues and not always free of regressions, but also not as bloated as say Gatsby. If you write React components in a way that
by strogonoff 6y ago
Using react-static here. Has some issues and not always free of regressions, but also not as bloated as say Gatsby.
If you write React components in a way that leaves them functioning when statically rendered, I think it is relatively straightforward to roll your own generator that calls React’s built-in renderToString() on top-level app component during HTML generation, and bundles basic JS that does hydrate() in case user agent happens to have JS enabled (those two methods do a lot of the heavy-lifting). Devil’s in the details, of course, but have been low-key looking into that lately.