FormidableLabs / react-ssr-prepass

A custom partial React SSR renderer for prefetching and suspense
MIT License
592 stars 26 forks source link

Example with vite-plugin-ssr #73

Closed brillout closed 3 years ago

brillout commented 3 years ago

Author of vite-plugin-ssr here. Many of my users are using react-ssr-prepass; an example showcasing the plugin + react-ssr-prepass would be lovely for both our users.

Thoughts?

JoviDeCroock commented 3 years ago

Hey @brillout I've quickly thrown together an example using urql https://github.com/JoviDeCroock/vite-ssr-prepass-example running into an issue where prepass throws an error where it can't find React currently (from esbuild) 😅

EDIT: made it work, will squash into one commit on top of boilerplate

brillout commented 3 years ago

Just saw that, neat love it 👌.

JoviDeCroock commented 3 years ago

@brillout does this suffice to show the gist of it? It basically shows how we can leverage it to resolve data suspense boundaries which are for instance used in urql, there are other appliances like going through the tree and calling methods that are defined on components 😅

brillout commented 3 years ago

Perfect.

https://vite-plugin-ssr.com/urql https://github.com/brillout/vite-plugin-ssr/tree/master/examples/urql/

Let me know if you want me to PR a little section "Vite" with the above links to https://formidable.com/open-source/urql/docs/advanced/server-side-rendering/ I'll maintain the urql example for the foreseeable future.

Love our tools combo :-).