4 ms·
I thought Next.js and Remix were SSR-based frameworks, both created as alternatives to building a SPA. After the initial "SPA fever" died down, these framework
by floydnoel 2y ago
I thought Next.js and Remix were SSR-based frameworks, both created as alternatives to building a SPA.
After the initial "SPA fever" died down, these frameworks cropped up to address the shortcomings of SPAs such as a lack of SEO-compatibility.
- emmanueloga_ 2y agoNext.js and similar tools redefine server-side rendering (SSR) to mean generating HTML on the server using the same code that runs on the frontend, requiring server-side JavaScript and what they call "hydrating" on the client. Next.js and friends are very much SPA frameworks, they just try to address the shortcomings of SPA architecture and in the process introduce a lot of complicated layers. Since the term SSR has been... "repurposed" now, what I was talking about a simpler CGI-style approach—no JavaScript, no async complications like Suspense. Rendering React components server-side often requires special tricks, especially when components interact with DOM APIs or make HTTP calls. As an example, Templ has a detailed guide on using React in a traditional architecture without server-side rendering React components [1]. --- 1: https://templ.guide/syntax-and-usage/using-react-with-templ/ https://templ.guide/syntax-and-usage/using-react-with-templ/