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.

Why I hate your Single Page App (2016)

37 pointsby rareitemabout 1 year ago

14 comments

EMM_386about 1 year ago
I&#x27;ve been through cgi-bin, to ASP and PHP, to ASP.Net Web Forms and RoR and ASP.Net MVC.<p>I now work on an Angular 17 enterprise application.<p>Out of all of them, the Angular 17 application is by far the most enjoyable to work with. And I was brought into the SPA world kicking and screaming and muttering &quot;get off my lawn&quot;.<p>But these points are not necessarily valid. We don&#x27;t break the back&#x2F;forward buttons, or page refresh, the initial payload is sizable, but less than many &quot;non-SPA&quot; websites outo there. And it runs a large enterprise. When we release a new update, nobody notices. In the corporate world, downloading a few MB that is compressed over the wire and cached on the client after it&#x27;s sent ... people don&#x27;t notice. There are single <i>images</i> on websites bigger than our platform.<p>The first compliment we got after releasing the Angular project was how incredibly fast it was. It&#x27;s not bloated, I feel that is just an old way of thinking about it. Sure it&#x27;s not pure HTML with bit of vanilla JS sprinkled in, but it&#x27;s not going to slow your machine to a crawl (if done properly). Yes, &quot;view source&quot; is going to be a sea of JavaScript that renders HTML. Pure? No. Slow? No.<p>It&#x27;s not one URI, it&#x27;s &#x2F;users&#x2F;edit&#x2F;104 and &#x2F;departments&#x2F;accounting&#x2F;invoices&#x2F;42. It allows bookmarks via deep linking.<p>Would I use a SPA for my personal blog? No, I&#x27;d use a static site. In fact, I&#x27;ve had them since the early 1990s and I still do have static sites up right now. But would I use HTML and vanilla JS for a large enterprise system? No. As I mentioned, been through almost every web framework since ASP in 2002. JavaScript since 1997. I know the pros&#x2F;cons at this point.<p>There are too many SPAs out there, there is no question about it. It&#x27;s because had a lot of developers go to bootcamps (or teach themselves) which ended up with a <i>lot</i> of JavaScript developers who knew some React. So that has been the go-to for &quot;a website&quot;.<p>But I don&#x27;t feel these points are valid about SPAs. 30 years into it, I&#x27;m happy I greenfielded with Angular on this most recent project. Smooth sailing.
评论 #40110493 未加载
评论 #40123050 未加载
lylejantzi3rdabout 1 year ago
From 2016. SPAs have become much more annoying since then.
jauntywundrkindabout 1 year ago
I opened this expecting the normal grungy tirade of intolerance &amp; an general small &amp; petty disdain for JavaScript. But there was the authors name and I knew this would be something different and higher class! And how!<p>I feel like the essence of this page needs some kind of rallying flag, some moniker. &quot;Web first SPAs&quot; or &quot;browsing-compatible SPAs,&quot; something that can be made recognizable where the web dev tech hipsters can start pressuring each other &amp; companies into doing the right things and not letting their SPAs break the web! This should be <i>critical</i> &amp; visible drive in all web architecture, but its not notable as it&#x27;s own thing, only seen in the absence of normal good functioning; having a good name to rally around &amp; hype up in the noosphere feels needed.<p>&gt; <i>Maybe your single page app is different, but the ones that I know break most of my browser’s features, such as the back and forward buttons, page refresh, bookmarking, sending a link, or opening a link in a new window or tab. They offer no way to link to something that I look at. (Oh, I know there are exceptions to this rule, but they typically require effort — a lot more than many developers are prepared to invest).</i><p>&gt; <i>My main beef with single page apps, or SPAs for short, is that they’re not &quot;on the web&quot;.</i><p>I do see a decent amount of reasonably well built apps, albeit most handle one or two pieces not perfectly. But there&#x27;s also plenty of dark world dark pattern apps where things you click on aren&#x27;t links.<p>(Subrant: this is also one of the things that drives me the most up the wall about PWAs. PWAs throw away most of the best parts of the web! Urls are quasi invisible, there&#x27;s no tabs (unless the app builder specifically builds around Tabbed Application Mode), there&#x27;s no forward&#x2F;back buttons, nor bookmarks. PWAs ironically are as regressively anti-web as it possibly can come! They happen to be built with web technology, but obfuscate all web faculties the user might have. Piss on you PWAs, you are trash.)
CityOfThrowawayabout 1 year ago
I feel that this argument is pretty outdated at this point.<p>Most new SPAs people build use frameworks like NextJS that solve all of the big complaints.<p>Sure, there&#x27;s plenty of old, crufty SPAs from the pre-react-router days still out there. I also dislike those apps.<p>I guess my point is... there was a time when you could blanketly hate SPAs and be mostly right about the category. And you could be mad at a company for even daring to try because they were very likely to screw it up. But I think we are now past that period. SPAs are now pretty awesome and fast and good!<p>Edit: ah, this article is from 2016. Which actually was a very valid time to hate SPAs! Maybe this is a good moment to applaud the hard work of folks at Vercel for fixing the problem :-)
评论 #40110390 未加载
评论 #40110226 未加载
tcfhgjabout 1 year ago
&gt; Maybe your single page app is different, but the ones that I know break most of my browser’s features, such as the back and forward buttons, page refresh, bookmarking, sending a link, or opening a link in a new window or tab. They offer no way to link to something that I look at.<p>In my experience, this is very simple when using the Angular Router. Indeed, it&#x27;s difficult to not get it working.<p><a href="https:&#x2F;&#x2F;angular.io&#x2F;guide&#x2F;router" rel="nofollow">https:&#x2F;&#x2F;angular.io&#x2F;guide&#x2F;router</a>
dexwizabout 1 year ago
&gt; They have a URI, but only for the whole thing, not for all of those valuable things that are inside of it.<p>This isn&#x27;t always true, and I wouldn&#x27;t actually find it to be false more most SPAs I use. Its straightfoward to sync the URL with Javascript state. Most high grade SPAs takes URIs seriously, because they are still the primary way users share views with each other. Traditional URIs point to static resources, but most SPAs contain at least a record identifier, and possibly even a view state. Google Slides is a SPA, but I can easily share a URL with another person, and if they have access they will end up on the same slide as the one I was viewing when I copied the link.<p>&gt; Business logic does not belong in the client, unless you like having to redundantly maintain the same logic in every kind of client you support (in addition to maintaining it on the server, of course — remember that you can never trust any client).<p>I don&#x27;t see how moving view state management from the client to server solves this issue. Of course you can&#x27;t trust the client, anyone can spoof API calls. But even basic forms have this issue. You can&#x27;t trust a form just because you generated options on the server.<p>Also view logic is tightly coupled with the client UX. Moving it to the server does not magically make it reusable. Additionally, having client side logic often is more about displaying a list of possible options, than validating correct choices. Just writing server side validation does not eliminate the need for client side business logic.
megadalabout 1 year ago
Half of the article is just ragging on a specific subset of poorly designed SPAs (those that don&#x27;t use HTML 5 history mode with proper server side routing set up), which the author acknowledges before finally moving onto other points.<p>The other half I&#x27;m not even convinced these are real problems:<p>&gt; A fantastic example of the problems created by the SPA approach is parallelization of work. If you have a team of multiple people, or God forbid, multiple teams working on the same SPA, you need to come up with a good way to support this. Instead, you can just have each of those teams build their own web application. Each of those applications can be connected to every other one built at the same time by the same organization (as well as to every other web application residing anywhere, if you want to) — in fact relying on the core strength of the web.<p>This paragraph I guess presents a problem and it&#x27;s &quot;ROCA&quot; solution, but the solution proposed works for SPAs too. You can just make multiple SPA applications.
vandahmabout 1 year ago
I think that, in 2024, a lot of these problems aren&#x27;t as bad as they once were, but when this article was written in 2016, SPAs really were a mess. Since then, people have mostly solved the URL problem and the back-button problem, and I think that if your organization has the headcount to support it, there are advantages to having the kind of very clean separation between your backend and your user interface that an SPA can provide. For instance, They can be developed by different teams, on different release schedules. Or, you can replatform your backend without rewriting your frontend.<p>Even so, I kind of wish that most websites still used old-school server-rendered HTML. I still run into all kinds of glitches that just could not possibly happen on a server-rendered site. As an example, I like to visit the Deutsche Welle website to catch up on European news stories that don&#x27;t make their way to the US, and sometimes their site just flat-out doesn&#x27;t load, because of some caching problem that I don&#x27;t care about, because it isn&#x27;t my problem as someone who just wants to read the news. Since the best DW&#x27;s SPA architecture can possibly do is to make it look like server-rendered HTML, it&#x27;s just nothing but downside to me personally. It might make sense for Deutsche Welle itself, but I don&#x27;t work for DW, and I don&#x27;t get paid to care about their problems.<p>In the end, I think the overall message of the article still resonates in 2024, even if it doesn&#x27;t resonate as strongly now as it did when it was written. I think SPAs are good technology when they are used in the right way for the right reasons. But there&#x27;s a kind of dogma surrounding heavyweight JavaScript frameworks, and I think it pays to be a little skeptical as a result.
kkfxabout 1 year ago
I smile, because ALL modern tech try to do what classic Smalltalk environment have done in the past, see a Pharo video demo to get an idea, a DocUI, with active elements. Well, no modern tool so far have reached the same level of power. Modern webapps might have some of that power, but fails dramatically in flexibility and user control...
meiralealabout 1 year ago
His reasoning is alright, his solution is bad, not sure if for the lack of knowledge of MPAs (like Astro) which fix the problems he is talking about.
amanziabout 1 year ago
This may say 2016, but so many of these points still apply today. My biggest issue with these JavaScript-first sites (SPAs and React&#x2F;Angular&#x2F;Whatever) is that they break in weird and unpredictable ways. Some of my common complaints that I still see often:<p>- Pages never fully load because some JavaScript file timed out - Browser history disappearing - Middle-clicking or right-clicking links doesn&#x27;t work - Start typing in a form field while the page hasn&#x27;t fully loaded, and then the form field clears itself when the page does finally load - Modal screens only partly load or leave artefacts on-screen when dismissed (e.g. a random spinner icon on the page, or a part of the screen stays dimmed after modal is gone) - Copy&#x2F;pasting into form fields doesn&#x27;t trigger actions (e.g. buttons stay disabled while they wait for a key-press to activate) - Password manager autofill doesn&#x27;t work because of some weird JavaScript validation script - And. So. Much. More.
jpilloraabout 1 year ago
RIP Stefan
7bitabout 1 year ago
The biggest contender for breaking browser history and middle-clicking are the fucking Microsoft Admin Portals, especially the Azure Portal.<p>Oh. My. God.<p>I lost all trust in Microsoft when I started using these. It&#x27;s like the devs don&#x27;t know the very basics of web browsing, or they all use Macs and want to impose their preference onto everybody else.
评论 #40110280 未加载
评论 #40110245 未加载
exabrialabout 1 year ago
I hate your spa bc 100% of the time it breaks
评论 #40110185 未加载