TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Why do we walk away from Single Page Applications?

22 pointsby WolfOliverover 1 year ago
Before server side components, if I wanted a native app (iphone, android, ..) I had to rebuild my SPA, now with SSC/SSR/HTMLX I need to rebuild my backend as well?!?!? Just to save some microseconds?

9 comments

joshuanapoliover 1 year ago
The trends to and from SPA are driven by improvements in &quot;edge&quot; service to support dynamic content:<p>In the old days, we built dynamic web content with &quot;AJAX&quot;. There was a lot of latency to for a request to reach your application server. It was also kind of hard to make the servers respond with low latency.<p>So we added more client-side scripting. We had things like script.aculo.us, and settled into jQuery. This improved the responsiveness of some aspects, but split the user&#x27;s front-end experience across different systems, written in different languages, possibly developed by different people.<p>So the SPA unified things again. It maximized the part of the application delivered by the low-latency CDN. Only the essential dynamic data was transferred from the higher-latency back-end server. It fixed the cohesion of front-end development, by moving entirely into JavaScipt frameworks. So, done well, this improved responsiveness for the user of dynamic web content. On the other hand, maximizing the SPA resulted in a new problem: users get slow or inconsistent performance because of downloading a big JavaScript application. So this new kind of load time turns out to be pretty hard to optimize.<p>Now in 2023, it&#x27;s easier to build low-latency back-end servers. We have various options of &quot;edge compute&quot;. It&#x27;s not too hard to put a copy of your application server in each region around the world. So it makes sense to run the application in the server again, not that it&#x27;s distributed. Moreover, our web development frameworks are helping to keep the web application design cohesive.<p>So moving to SPA and now moving away from SPA are driven by the desire to have a low-latency experience for our users. Changes in the available infrastructure have changed the optimal balance of server-side and client-side execution of the application. And improvements in our development frameworks makes it easier to take advantage of the infrastructure improvements.
评论 #38243328 未加载
评论 #38243010 未加载
评论 #38243962 未加载
Jtsummersover 1 year ago
You don&#x27;t <i>need</i> to do anything. If you&#x27;re rewriting based on trends and not need, you&#x27;re just following fashion. Does your app work? Keep it as is.
评论 #38248066 未加载
0xblinqover 1 year ago
I find the combination of a component framework such as React with a fully fledged backend such as Laravel or Rails with Inertia.js is perfect. The best of both worlds.<p>All this server side components is just over engineering no one needs, and even if you think you need it the complexity and vendor lock in introduced is not a trade off worth to do in my opinion.
littlecranky67over 1 year ago
Why would you need to rebuild the Backend? A SPA usually consumes data from services, being it HTTP&#x2F;JSON, gRPC or whatnot. You server-side components can consume the very same services with no changes in the backend.
评论 #38241509 未加载
评论 #38241362 未加载
gpjanikover 1 year ago
SSR is almost always slower than SPAs. It&#x27;s forcing a waterfall on first page dispaly (you can&#x27;t stream HTML of something that hasn&#x27;t been fetched from the database yet), and generally SPAs fail mainly at SEO. If you&#x27;re not e-commerce, you probably just don&#x27;t need it.
sylvain_kerkourover 1 year ago
Honestly? I believe that the new hype of Server Side Rendering (SSR) frameworks is only a matter of vendor lock-in: when you have SSR, you *NEED* edge rendering, which only a few vendors can provide today.<p>Single Page Applications (SPA) are totally fine. My blog is an SPA (<a href="https:&#x2F;&#x2F;kerkour.com" rel="nofollow noreferrer">https:&#x2F;&#x2F;kerkour.com</a>) and has no problem being indexed by the major search engines.<p>It&#x27;s actually way faster than most webapps using new shiny new SSR frameworks as I can cache with precision the different chunks&#x2F;assets.<p>Finally, everything is served from a server than barely uses more than 50 MB of RAM even under high load. Last time I looked, Next apps needed around 500MB-1GB of RAM to serve only a few visitors.
评论 #38241629 未加载
评论 #38241358 未加载
评论 #38241510 未加载
评论 #38241675 未加载
graypeggover 1 year ago
There&#x27;s tradeoffs with anything. Sending HTML over the wire has benefits you&#x27;re dismissing like faster response times since responses are cacheable. (The benefit can easily exceed some microseconds, especially if we&#x27;re measuring time-till-the-user-can-actually-do-something.)<p>SPAs also have tons of benefits. Local state is awesome for instant reactivity once the page is loaded. But you also introduced an API that you now need to maintain, that 9&#x2F;10 times, will only ever be used on this SPA and no where else.<p>It&#x27;s just acronyms, pick whatever works for you. There doesn&#x27;t HAVE to be one &quot;best practice&quot; that covers all use cases.
评论 #38241609 未加载
aogailiover 1 year ago
Hype.<p>Only apply for small use cases yet frameworks (especially next.js) want to sell you stuff.
sshineover 1 year ago
I read a hype piece about “multi-page applications” and thought “so we’re back to making websites.”<p>SPAs seem like a good choice when the app should be able to preserve full functionality when offline.