3 ms·
I’ve never used next.js. Wouldn’t pre-rendering a site remove dependence on any framework? It should just be html js and css right?
by c0wb0yc0d3r 2y ago
I’ve never used next.js. Wouldn’t pre-rendering a site remove dependence on any framework? It should just be html js and css right?
- darepublic 2y agoyou can always just do html js and css even without pre-rendering. Just as a vanilla site.
- nextts 2y agoI think here pre-rendering means running React on the server (so the React render method called before the HTML hits the wire). So equivalent of if say Ruby On Rails rendered ERB but with React instead. They call the pregenerated static HTML "SSG" or "Static Site Generation" That should be as fast as hell: basically a CDN job.
- romanovcode 2y agoBut that is not pre-rendering. That is Server-Side Rendering (SSR).
- nextts 2y agoNextJS has its own particular nomenclature: https://nextjs.org/learn/pages-router/data-fetching-pre-rendering https://nextjs.org/learn/pages-router/data-fetching-pre-rend...
- c0wb0yc0d3r 2y agoAh this clears it up for me. No wonder OP’s results were the way they were. Next.js uses “fast” words to describe “slow” processes.
- nextts 2y agoI migrated an app from NextJS to Django to make it fast. Django because there was a lot of python code anyway to interop with. But any of the common MVC frameworks in any language/runtime that let you cache etc. will do. They are pretty mature. The NextJS big killer for me was optimising page speed was nuts. You always get a fatty JS bundle even if the page is pre rendered or not.
- ekojs 2y agoNormally, yes. But there's a couple rendering modes with these frameworks. In this case, the rendering is most likely 'hybrid'. Some routes are statically pre-rendered, some are served via SSR. You'd need a JS server for the SSR ofc.
- 4ndrewl 2y agoThis is the world of js frameworks. It's never _that_ simple because reasons.