by bryik · 3y ago · 0 comments
This reads to me like "Next.js can do SPAs (like CRA) plus static sites and SSR". Next.js' site even says "The core of Next.js has been designed to enable starting as a static site (or Single-Page Application)" [1].
0 - https://react.dev/learn/start-a-new-react-project
1 - https://nextjs.org/docs/advanced-features/static-html-export
Just use vuejs which is the only one truly never forces SSR on you if you do not want to have anything to do with it.
In the new market, there will be much more scrutiny on costs and the complexity that creates it. The prospect of hiring a “React Engineer” with 7+ years of experience to build a cookie cutter UI, will be just as questionable as forcing the front end and backend to use the same technology and framework governed by one single vendor.
I predict vercel will have a rough time.
Looking forward to see how this plays out.
For example, let’s consider a site with two pages. In the SSR case, if I click the link to page 2, then I have to wait a whole network roundtrip for the page to appear.
In the SPA case you can decide when you want to load the content for page 2: with page 1 (if it’s a small amount of content), if the user scrolls to a certain point, … it’s completely up to you. You can cleverly hide the latency so that when the user does navigate to page 2, it’s instant.
Only people who haven't had to set all this up themselves think Vercel isn't amazing.
It is handling a LOT of devops heavy lifting for you.
[1] https://rauchg.com/2014/7-principles-of-rich-web-application...
[2] https://twitter.com/rauchg/status/1637136013083684864
[3] https://twitter.com/timneutkens/status/1636693508223270912
[4] https://twitter.com/dan_abramov/status/1636827365677383700
We (just today) updated the Next.js docs linked based on feedback around this to make it more clear. Hopefully this helps, let me know if you have other feedback.
That said, I'm not sure why running `next export` is considered 'advanced'.
I'm not saying Next.js is doing that with static export, but I'm not sure they aren't either. It fits the pattern too well. I'm still suspicious about how the Image implementation (which nearly every website needs) breaks `export` and the only solution is "roll your own image handler." I'm not sure if that fits into the understandable lack off investment or the intentional difficult/obscure.