Hacker News new | ask | show | jobs
by midway 2686 days ago
This is the wrong question. I use React for SPA use cases and then initial loading time is secondary but I tell you something, my stock React SPA with tons of js and assets has following loading times:

  DOMContentLoad: 1.08sec, Load: 2.26sec
and let's look at nextjs.org:

  DOMContentLoad: 1.09sec, Load: 2.31sec
I mean this comparison doesn't make sense because you don't know my SPA and I could write anything here but test it yourself. I just don't see a clear use case for Next.js. Just make an example, you sell some SaaS. Make the web product as React SPA but the marketing landing pages as normal express/pug site. Both the web product and the landing pages have different use cases: one needs to create leads and the other one has to increase customer satisfaction. These are different goals, so maybe you should also use different tools.
2 comments

My own react app, not using next with a rather heavy payload (async splitting in webpack broke in the past 3 months and haven't been able to get it working again) is under a load of 1.24s Finished time, locally (static content server, with 2 db queries via api).

Unless you MUST have the absolute best SEO, I'm not sure that it really matters having SSR for most people/apps. I don't know how much traffic is really driven from search engines depending on the site, and I really don't know how much you get penalized for having an SPA anymore. I mean if your initial load is under 2-3s and in-site navigation is fast, you'll probably be fine.

The past few sites/apps I've consulted on got the majority of their traffic from outside SEO.

DOMContentLoaded isn't as relevant with SSR, because the markup and styles come rendered on the first response, so you never see an initial blank white page.

More relevant metrics are TTFB (time to first byte) and TTI (time to interactive).

I wouldn't want to implement a marketing site in express/pug. I want the flexibility of components and all the other benefits that React offers.

> How can that be possible? The DNS lookup takes longer than that and you still haven't even gotten to your site.

Me too. But if you ever did marketing landing pages for products you might know that one landing page is not enough. You need thousands which match to Ad Word campaigns or which are optimized to different SEO fields, domains and whatever. While you still could manage this with Next and nice components, Next's subpar routing might be an obstacle.