bluwy / create-vite-extra

Extra Vite templates
Other
391 stars 62 forks source link

Improve react SSR render to `renderToPipeableStream` #51

Closed Ibadichan closed 6 months ago

Ibadichan commented 7 months ago

Using current react ssr template lazy loading does not work because renderToString does not support Suspense on server. We can use renderToPipeableStream and listen for onAllReady callback to "simulate" renderToString behavior.

https://github.com/bluwy/create-vite-extra/pull/50

bluwy commented 7 months ago

Thanks for opening a PR. I'm not able to do a proper review to test it locally as I'll be away for the next week, but I'll make sure to do so when I return.

From a glance, I think I'd prefer adding a streaming specific template like https://github.com/bluwy/create-vite-extra/pull/46 (for Vue), so that users can choose between both. Ideally the code pattern should look as close as possible to that PR so that the templates are consistent.

Ibadichan commented 7 months ago

Ok, i will try to create similar template, thanks.

Ibadichan commented 6 months ago

Hi @bluwy, please check new react templates. https://github.com/bluwy/create-vite-extra/pull/54.