DEV Community

Discussion on: Fast Pages with React

Collapse
 
christiankozalla profile image
Christian Kozalla

I understand the convenience of using react for such simple websites, because we're so used to writing JSX. Plus, it is admirable to render the react app to static HTML with no hydration in the client. Effectively, you're using JSX as a plain old templating language.

Yet, when I saw the simple website, I couldn't help to think of a proverb: "mit Kanonen auf Spatzen schießen"
Could the same website have been build with a single index.html, a style.css and assets on the side? Without computation, and all the dependencies?

Collapse
 
florianrappl profile image
Florian Rappl

Sure. But that does not scale - even for a page of this simplicity. If you just look at the HTML unminified you see it's already quite lengthy.

The picture also does show why this is not only convenient, but actually very efficient. The CSS part would not scale, too. It would be a separate sheet (not good) that just contains everything unminified (not good). The approach shown here only takes what I actually use.

If you think this is "mit Kanonen auf Spatzen schießen" then I think you've not seen any pages with Next.js, Gatsby, or others.

Collapse
 
christiankozalla profile image
Christian Kozalla

True, compared to Next.js and Gatsby, this is a dream :D

Some comments have been hidden by the post's author - find out more