@harmon25 Looks great! is this the same model that NextJS et al use? From looking through the code here, the phoenix side will render an empty html page and then render the <ServerContainer /> component which contains the app, hyrdated with data passed from the server. This is then ‘hydrated’ on the client side using the props passed from the server - is this all correct?
My question is then, when is the <ClientContainer /> rendered?
Also once that initial page is rendered, is it pretty much from then on the same as an SPA? E.g. routing will all take place client side and no more SSR will occur?
I’m guessing the main benefit here (I usually do SPA + GQL API Phoenix) is that it eliminates the need for the intial page fetch from CDN (e.g. netlify) → render → fetch data from api (show loading states) → then show data
and rather:
page loads directly from server → initial data passed to react component → component rendered already with data ?
Just want to make sure I understand this right - so whilst the actual content is no longer served as a single static JS Bundle (typically to a CDN close to the user), it should be faster because it eliminates the need for CDN call + API call (and most likely CORS) and can instead can all be delivered in a single round trip?






















