Hacker News new | ask | show | jobs
by brtkdotse 1600 days ago
I'd argue that Gatsby et al aren't in fact SSGs but rather thinly veiled React apps.
2 comments

Gatsby generates a React app, and it embeds that in a set of pages, and renders the content to a set of JSON files as well. When a page is requested the pre-generated page downloads, using only HTML+CSS to display the content for that page. If the user has JS enabled the React app runs and attaches itself to the links in the page to take over how they work. When the user navigates to different page it downloads the content as JSON, and renders it as any other React app would. I think it can also preload content as well.

So in a sense you're correct, it does generate a React app, but it is also true that a Gatsby site works like any other SSG'ed website when you don't have JS enabled. Arguably it's the best of both worlds. It's classic progressive enhancement.

The downside is that it makes the code more complex.

Gatsby does have other rendering options as well - https://www.gatsbyjs.com/docs/conceptual/rendering-options/

My experience is that vanilla Gatsby, out of the box, performs horribly on things like PageSpeed compared to “true” SSGs like Hugo or Jekyll.

And progressive enhancement is kind of a solution looking for a problem, there are a lot of low hanging perf fruits you can pick before considering PE.

progressive enhancement is kind of a solution looking for a problem

Progressive enhancement is a solution to the problem of giving users the best experience possible without serving unnecessary code, or breaking the site, for users who don't have the capability to run particular features. It's not a perf thing. It's a features thing. And it's a very real problem (see every site that only works in Chrome for details.)

I think 11ty and Astro are better in this regard.