Hacker News new | ask | show | jobs
by untog 2288 days ago
Serious question: why are you using React for a blog? What interactive elements are there on the page that require it?

EDIT: Saw the link in your profile. I see lower numbers than you, though not by much. But I also see 2.6 seconds time to interactive with 3.1 seconds of main thread work.

Broadly speaking, that's fine for your blog. But if it was a site that you expect to add more and more features to over time that number is only going to go up. 3.1 seconds of main thread work to render an entirely static page isn't good. It's acceptable at best.

1 comments

There are no interactive elements, I just enjoy using React more than the alternatives, even for static content. Instead of asking "what requires react", a better question is "what are the tradeoffs of using react in this situation". In my case React allows me to use Gatsby, a wonderful static site generator, and it also makes it easy for me to add any interactive content I want in the future.

My site will load fine without javascript, so it's hard to imagine react is slowing things down much (although if you've visited before the PWA will mess it up if you try to turn JS off).

For something like Wikipedia, time to interactive isn't that important (which is good, because lighthouse tells me that this page [1] has a TTI of 7.4s). First meaningful paint matters much more. I really disagree with the narrative that anything written with React is going to have a much worse user experience compared to the "old" stack.

[1]: https://en.wikipedia.org/wiki/Matthias_Hansen_House

I’d say your use case isn’t really all that applicable to how React is normally used. Zero interactive elements and doesn’t require JS... that really isn’t typical for a React deployment.

> I really disagree with the narrative that anything written with React is going to have a much worse user experience compared to the "old" stack.

Why only compare to the old stack? When you’re evaluating a brand new solution would should be looking for the best one, not any solution that improves your current situation.