Hacker News new | ask | show | jobs
by sbazerque 1875 days ago
What does he mean by pre-rendering? Do they spin-up a browser-like environment on the server and use that to render the page and cache it? Or has that idea been improved upon?
3 comments

They render HTML on the server. Revolutionary idea.
No, it's more like server side rendering with PHP or Ruby, back in the days.

I wrote a bit about this topic here: https://dev.to/fllstck/where-when-should-you-render-your-htm...

Good article!
At the end of your SPA build process, you spin up a dummy HTTP server and run headless chromium on it (e.g. with puppeteer) to render each route and save the output html.

Instead of only /dist/index.html, you have /dist/index.html, /dist/about/index.html etc.

Surely you meant this facetiously?
I think not, what he describes is really the way some of these tools work.
Why render headless and repackage the output though?
The main benefit is for SEO tags on each individual route and proper 404 status code
This seems... convoluted.
We, the people doing front-end, like to keep things exiting.