3 ms·
You can't even assume a nextjs page is SSR without being on the dev team.
by dawnerd 4y ago
You can't even assume a nextjs page is SSR without being on the dev team.
- teg4n_ 4y agoYou just look at the response from the server… if the site html is fully fleshed out it’s SSRed
- dawnerd 4y agoTrue but you don't know if it's been exported as static, generated as static on build, progressively generated (generated once someone hits the page then cached) or generated on every page load.
- deleted 4y ago[deleted]
- jjice 4y agoGenuine question: what if you disable JavaScript and then load the page? Would you just get the SSR portion of the page and if it wasn't SSR at all then you'd get a blank page?
- dawnerd 4y agoHard to say since it depends(tm) but for the most part it should look like any other html site, react then just hydrates. IMO it's the best of both worlds. On the sites I've been working pages that have been server rendered work mostly perfectly with javascript disabled.
- ec109685 4y agoYou’re paying the price of initializing react twice and generating the dom: once on the serve side and then again on client before page is interactive.
- jayflux 4y agoNot quite, the second time doesn’t “generate the dom”, it just hydrates, fills in the gaps and binds event listeners. It’s not starting from scratch and isn’t a big cost.
- ec109685 4y agoIt generates the shadow dom is what I meant.
- v0idzer0 4y agoThere’s no DOM on the server and you only generate it once on the client. 1) The server generates html (a string). 2) Browser receives html and builds DOM just like in any static website 3) Javascript downloads and react sees the DOM already exists and does nothing
- intelijstupide 4y ago