Readit News logoReadit News
codingdave · a month ago
SPAs make sense when your users have long sessions in your app. When it is worth the pain to load a large bundle in exchange for having really small network requests after the load.

Smooth transitions are a nice side effect, but not the reason for an SPA. The core argument of the article, that client-side routing is a solution for page transitions, is a complete misunderstanding of what problems SPAs solve. So absolutely, if you shared that misunderstanding of SPAs and used them to solve the wrong problem, this article is 100% correct.

But SPAs came about in the days of jQuery, not React. You'd have a complex app, and load up a giant pile of jQuery spaghetti, which would then treat each div of your app is its own little mini-app, with lots of small network requests keeping everything in sync. It solved a real problem, of not wanting to reload all that code every time a user on an old browser, with a slow connection, changed some data. jQuery made it feasible to do SPAs instead.

Later, React and other frameworks made it less spaghetti-like. And it really took off. Often, for sketchy reasons. But the strongest argument for SPAs remains using them as a solution to provide a single-load of a large code bundle, that can be cached, to provide minimal network traffic subsequent to the load when the expected session time of a user is long enough to be worth the trouble of the complexity of an SPA.

jbreckmckye · a month ago
This article is full of misrepresentations and lazy takes. The author has had other anti-JS polemics widely upvoted on HN, which were just as carelessly written. But people upvote it anyway.

What is the cause of this?

1. Bad experiences with JavaScript apps that have aggregated complexity (be it essential or incidental complexity)?

2. Non-JS developers mystified and irritated at a bunch of practices they've never really internalised?

3. The undercurrent of "frontend is not real programming" prejudice that existed long before React etc al. and will continue to exist long after it?

j0rd72 · a month ago
I find myself agreeing with the article (although I also agree that it assumes you've chosen an SPA when you shouldn't have). To add my own perspective:

I work on an app, the front-end of which essentially consists of 6 nav tabs, 3 of which show an index of records with corresponding add/edit forms. We don't have any hyper-fancy interactive components that would require heavy JS libraries. And yet... we develop in React.

Yesterday, I needed to add 1 new field (representing by a checkbox input) to both our app and a corresponding back-end application we have, which uses Rails views.

I checked the git logs after to see how long each took. The Rails view took me literally 2 minutes to update (add field to model, add field to controller, add input to HAML with a class on the parent div). The React view took me 52 minutes, plus I later found out that I'd forgotten a damn type on some interface that's a shallow copy of our model.

Is this a problem with React itself? Not really. But it's a problem in the way that it's used, and our 6 nav tabs and 3 forms don't need all the overhead of React. So for people in a similar situation, this article really rings true.

benreesman · a month ago
I don't know that there's "real" programming, that seems like a hard fight to fight on either side, it's like arguing about whether animals are conscious or something. Are people? Who knows, pass the blunt.

But there's been this really sharp over-correction to where now an obvious thing that is just common knowledge and that was never taboo is now considered impolite to even allude to. Frontend programming is among the easier kinds of software work as measured by the number of people who can do it? I bet if I tried really hard, I could probably be pretty kickass at pickleball, small court, not a lot moving around. But to be like, that's the same thing as the NFL. No, no it's not. I would never have been able to try out for the NFL, not if I live a thousand times.

There's pickleball and pro football in programming too.

wredcoll · a month ago
> Non-JS developers mystified and irritated at a bunch of practices they've never really internalised

My current explanation goes something like this:

"I'm a smart guy. Front end development looks simple. If I find it hard to do, that must be the fault of javascript somehow"

reactordev · a month ago
I don’t know, I think reducing bundle sizes and bloated javascript in favor of built in support for view transitions warranted a blog post against one of the primary arguments for why SPA.

I agree with the author. I love React. I shouldn’t need two dozen more dependencies. We ditched server side for client side in 2010 for speed. Now that we have 200x more compute power, more powerful CSS, more robust html (with web components), we can go back to server side rendering and only send what’s required for the user at the time of action.

psychoslave · a month ago
That is considering that front end dev is necessarily implying js, which is exactly the erroneous premise one should try to dodge.
hasanhaja · a month ago
Are we aligned with the claims in the article that a SPA architecture is not a suitable baseline architecture for content-focused sites with shallow sessions (low number of interactions)?

Deleted Comment

cleoxjefbjxis · a month ago
You miss the whole point and the author is correct about this:

Modern CSS is powerful, and HTML is the way to deliver web content.

Every web framework is _literally_ a hack to make the web something it isn’t. People who haven’t seen the evolution often pick up the bad habits as best practice.

For thise JavaScript people, I recommend trying Laravel or Ruby/Rails. And then once you realize that JavaScript sucks you’ll minimize it.

mdavidn · a month ago
Some of us have been building web apps since before Node.js existed, and we remember the problem that CSS was invented to solve.

Dead Comment

Dead Comment

cheema33 · a month ago
> ...if you shared that misunderstanding of SPAs and used them to solve the wrong problem, this article is 100% correct.

Agreed. The article was a frustrating read. The author is an SEO consultant. SEO consultants likely have a heavy focus on marketing websites. Actual apps and not marketing websites do benefit significantly from SPA. Imagine building Google Maps without SPA. You can animate page transitions all you want, the experience will suck!

Tokumei-no-hito · a month ago
to be fair to both points:

he has a really warped view that SPAs are somehow purely about routing.

he does correctly point out that a lot of sites could and should be treated as sites not apps.

danielscrubs · a month ago
I 100% would like to see an MPA Google Maps.

Being able to come back to a webpage with previous directions? I think it would be glorious.

cosmotic · a month ago
Google maps is a mess these days. Its glitchy, slow, has broken navigation, and is overloaded with unpredictable dynamic content. It's even worse in the native android app. Id totally go for the original version but with the more recent vector maps.
Cthulhu_ · a month ago
> and load up a giant pile of jQuery spaghetti

I'll have you know I spent time on organizing and structuring my code with early JS design patterns like IIFEs to limit scope, lazy loading of modules, and minification.

Anyway, in my experience, AngularJS was the biggest attempt at making structured front-end applications, and it really appealed / appeals (Angular is still very popular apparently) to Java developers; biggest ones was its modularization (which wasn't a thing in JS yet), dependency injection, and testability.

When we started out with an app in Backbone (to replace a Flex app because it wouldn't work on the ipad), I actually advocated against things like testing, thinking that the majority of functionality would be in the back-end. I was wrong, and the later AngularJS rebuild was a lot more intensive in front-end testing.

Of course, nowadays I'm repulsed by the verbosity, complexity and indirection of modern-day Angular code. or Java code for that matter.

aryonoco · a month ago
Angular not only appeals to Java developers, it also appeals to .NET developers. TypeScript of course borrowed a lot from C# (having the same designer) and dependency injection, MVC patterns etc closely resemble .NET patterns.

Interestingly, new Angular is slowly moving away from these, introducing Signals for state management and standalone components, and I see these developers actually struggling a lot to adopt new Angular patterns.

Still, I believe Angular is a really great platform for building B2B or enterprise apps. It’s testing and forms handling is far ahead of every other SPA, and it actually fees like a cohesive framework where people have spent time designing things the right way; something I absolutely cannot say about react frameworks such as Next.js or Remix.

aryonoco · a month ago
PS and I forgot to mention, new Angular patterns such as Signals and standalone components great cut down on the boilerplate and the verbosity. It’s not (and will never be) something like SolidJS, but each new version is clearly moving away from the heavy OO-based and multi layered patterns.
paradox460 · a month ago
Wasn't there the Google closure compiler before angular?
TimTheTinker · a month ago
Low-bandwidth/spotty connections (combined with aggressive caching) are one of the strongest cases in favor of SPAs (emphasis on the A for Application, not website). Visit (and cache) the entire frontend for the app when you have a good-enough connection, then further use of the app can proceed with minimal bandwidth usage.
cosmic_cheese · a month ago
It really depends. There’s a lot of SPAs which are practically unusable on a bad connection simply because it’s a challenge to even get the whole thing loaded in the first place. There’s been several occasions where I’ve had poor cell connectivity and a huge chunk of the web was effectively off limits due to this.

So in addition to aggressive caching, I’d say keeping the app’s file size down is also pretty important to making it useful on poor connections. That’s frequently something that’s barely optimized at all, unfortunately.

throw-the-towel · a month ago
This is not true. In practice SPAs break completely when some network request fails which happens a lot on bad connections.
andersmurphy · a month ago
I think with brotli over SSE you can do just fine with 3G and bad networks without needing to be a SPA. Keeping almost all state on the sever make realtime collaborative apps much simpler than data sync you need with SPA. This demo has zero client side state and handles concurrent interactions over a billion data points [1].

- [1] https://checkboxes.andersmurphy.com

andix · a month ago
Latency might even be more relevant than bandwidth. Especially if it's a good SPA, that uses optimistic updates (or sync), and some kind of caching for fetching data (tanstack query or similar).
wolpoli · a month ago
Honest question: Where are the places with low-bandwidth internet? Are we talking about cruise ships and satellites internet use cases?
wild_egg · a month ago
> in exchange for having really small network requests after the load.

I'd love to see examples of where this is actually the case and it's drastically different from just sending HTML on the wire.

Most SPAs I've worked on/with end up making dozens of large calls after loading and are far far slower than just sending the equivalent final HTML across from the start. And you can't say that JSON magically compresses somehow better than HTML because HTML compresses incredibly well.

Most arguments about network concerns making SPAs a better choice are either propaganda or superstition that doesn't pan out in practice.

raron · a month ago
> I'd love to see examples of where this is actually the case and it's drastically different from just sending HTML on the wire.

There are complete CAD applications running in browsers for PCB and mechanical design with many layers, 3D view, thousands of components, etc.

For example: https://easyeda.com/https://www.onshape.com

> because HTML compresses incredibly well

Haven't compression under TLS have been mostly disabled after CRIME and BREACH attack?

8n4vidtmkvmk · a month ago
With HTML you have to send both the template and the data. With json, it's just the data. So it's less information total. It should compress a little better, but I don't have stats to back that up.
matt_s · a month ago
If you work at a place that has a modern CI/CD pipeline then your multiple deployments per day are likely rebuilding that large bundle of JS on deploy and invalidating any cache.

HTTP 2 has been adopted by browsers for like 10 years now and its multiplexing makes packaging large single bundles of JS irrelevant. SPA’s that use packaging of large bundles doesn’t leverage modern browser and server capabilities.

wldcordeiro · a month ago
Lots of SPAs now are code-split too for what it's worth so you shouldn't really have large bundles to download if you're splitting things well.
paulryanrogers · a month ago
Is this true everywhere? Isn't much of the world still on slow mobile networks?
youngtaff · a month ago
> HTTP 2 has been adopted by browsers for like 10 years now and its multiplexing makes packaging large single bundles of JS irrelevant

H2 doesn’t make packing irrelevant… there’s still an IPC overhead with many small files… and larger bundles tend to compress better (though compression dictionaries might help here)

Large Js bundles are a huge problem though

QuadrupleA · a month ago
Side note, sick of jQuery being always associated with spaghetti in the tech lexicon.

Any Turing-complete system is spaghetti in the hands of bad programmers. And simple & clear in the hands of good ones who know how to design.

bobthepanda · a month ago
Jquery is good for dom manipulation, though most of the best ideas have become vanilla javascript standards.

It isn’t really equipped or opinionated on statefulness, which means that everybody was at one point kludging stuff onto it that didn’t make sense.

sverhagen · a month ago
Languages... (is jQuery a language, I guess so, let's go with that)... live in a context... there is culture, tooling, libraries, frameworks. Some languages have good culture, some have bad culture. I guess it's not even so black and white: language have good or bad culture in different areas: testing, cleanliness, coding standards, security, etc. If jQuery is misused in the hands of bad programmers ALL THE TIME, that becomes the culture. Not much to do about it anymore once the concrete has set. You can't still be an exception to rules, good for you! But that doesn't change the culture...?
PaulHoule · a month ago
It drives me crazy when it used together with React —- I want to have one authoritative copy of the state of my app, and jQuery bypasses that, at least if I’m using controlled forms.

Now I used to hate uncontrolled forms but now I like react-hook-form.

jiggawatts · a month ago
The real reason SPAs are popular is because JavaScript is the new Visual Basic and there are millions of developers that know nothing else.

Workforce market forces like that have a vastly greater effect than “bandwidth optimisation”.

My evidence for this is simple: every SPA app I’ve ever seen is two orders of magnitude slower than ordinary HTML would have been. There is almost never a bandwidth benefit in practice. Theoretically, sure, but every app I come across just dumps half the database down the wire and picks out a few dozen bytes in JS code. There's a comment right here in this discussion advocating for this! [1]

Another angle is this: if you had a top 100 site with massive bandwidth costs, then sure, converting your app to a SPA might make financial sense. But instead what I see is tiny projects start as a SPA from day one, and no chance that their bandwidth considerations — either cost or performance — will ever be a factor. Think internal apps accessed only over gigabit Ethernet.

I’ve seen static content presented as a SPA, which is just nuts to me.

[1] "It's much better ux when a user downloads the whole catalogue" from: https://news.ycombinator.com/item?id=44688834

geraldwhen · a month ago
Can’t hire for anything else. Competence in development no longer exists. And AI is making this march to idiocy worse.
Zanfa · a month ago
Does a real-world example of bandwidth saving even exist for SPAs? It’s always the other way around where what could’ve been a single page load, ends up being 6 separate asynchronous calls to different APIs to fetch random bits and pieces while the user stares at spinners.
dsego · a month ago
And the frontend-backend paradigm has seeped into the engineering culture and even the non-engineers on the team understand things in those terms. The main way we break apart work into tickets is API endpoints and client-side UI stuff.
nemothekid · a month ago
>every SPA app I’ve ever seen is two orders of magnitude slower than ordinary HTML would have been.

I'd argue then you don't have an SPA. However I don't see how you could have a application like Figma or Discord and say "ordinary HTML is faster" (or even possible).

jongjong · a month ago
SPAs are nice when your app requires complex state; multiple rows of nested tabs, modals, multiple interlinked select inputs which load data dynamically, charts or graphs which can lazy-load data and update on the fly in response to user actions.

There is a certain level of complexity beyond which you need to load data on the fly (instead of all up front on page load) and you literally cannot avoid an SPA. Choosing to build an SPA is not just some arbitrary whimsical decision that you can always avoid.

Sometimes people just go straight to SPA because they're unsure about the level of complexity of the app they're building and they build an SPA just to be sure it can handle all the requirements which might come up later.

One of my first jobs involved rebuilding a multi-page EdTech 'website' as an SPA, the multi-page site was extremely limiting, slow and not user-friendly for the complex use cases which had to be supported. There was a lot of overlay functionality which wouldn't make sense as separate pages. Also, complex state had to be maintained in the URL and the access controls were nuanced (more secure, easier enforce and monitor via remote API calls than serving up HTML which can mix and match data from a range of sources).

I think a lot of the critiques of SPAs are actually about specific front end frameworks like React. A lot of developers do not like React for many of the reasons mentioned like 'resetting scrollbars' etc... React is literally a hack to try to bypass the DOM. It was built on the assumption that the DOM would always be unwieldy and impossible to extend, but that did not turn out to the the case.

Nowadays, with custom web components, the DOM is actually pretty easy to work with directly but info about this seems to be suppressed due to React's popularity. Having worked with a wide range of front end frameworks including React for many years, the developer experience with Web Components is incomparably superior; it works exactly as you expect, there are no weird rendering glitches or timing issues or weird gotchas that you have to dig into to. You can have complex nested components; it's fast and you have full control over the rendering order... You can implement your own reactivity easily by watching attributes from inside a Web Component. The level of flexibility and reliability you get is incomparable to frameworks like React; also you don't need to download anything, you don't need to bundle any libraries (or if you do, you can choose how to bundle them and to what extent; you have fine-grained control over the pre-loading of scripts/modules), the code is idiomatic.

dannye · a month ago
> there are no weird rendering glitches or timing issues or weird gotchas that you have to dig into to.

Ehm... define the Web Component render blocking in the head, because you want to prevent FOUCs. Then try to access the .innerHTML of your Web Component in the connectedCallback

https://dev.to/dannyengelman/web-component-developers-do-not...

Tokumei-no-hito · a month ago
i remember seeing web components years ago, it sounds like they've improved a lot.

what do you do about the lack of (i assume) ecosystem? due to the ready ubiquity there's practically a library for everything. do you find that using WC you are having to hand roll a lot? i don't mean to be a package slave but for complex and tedious things like graphs / charts.

KronisLV · a month ago
> SPAs make sense when your users have long sessions in your app.

SPAs also make sense when you want to decouple the front end from the back end, so that you have a stable interface like a RESTful API and once AngularJS gets deprecated you can move to something else, or that when your outdated Spring app needs to be updated, you'll have no server side rendering related dependencies to update (or that will realistically prevent you from doing updates, especially when JSF behavior has changed between versions, breaking your entire app when you update).

> When it is worth the pain to load a large bundle in exchange for having really small network requests after the load.

The slight difference in user experience might not even enter the equation, compared to the pain that you'd have 5 years down the line maintaining the project. As for loading the app, bundle splitting is very much a thing and often times you also get the advantage of scoped CSS (e.g. works nicely in Vue) and a bunch of other things.

camillomiller · a month ago
Not sure what kind of clients you work with, but in my experience this is actually accurate and you won’t believe how many times I had to put my hands and fix SPAs that should have been a static website to begin with. I think this is a consequence of a generation of webdevs, especially front-end, that graduated from bootcamps teaching them only JS frameworks and React as if that’s the only way the Web works. They were given a hammer, told how to use it, and everything then just looks like a nail.
buffalobuffalo · a month ago
I don't know if a bunch of sloppy jQuery modules were ever really a viable option for an SPA. People tried to do it, sure, but I'd say the SPA era really started with backbone.js
kassner · a month ago
ExtJS/Sencha was quite powerful and complete. I’ve built tons of SPAs with it in the late 00s.

Deleted Comment

dsego · a month ago
I mostly remember doing $(document).ready blocks in php templates :)
PaulHoule · a month ago
I wrote my first SPA, a knowledge graph editor, using GWT (Google Web Toolkit) which compiled a dialect of Java to JavaScript circa 2006 or so.
youngtaff · a month ago
> SPAs make sense when your users have long sessions in your app. When it is worth the pain to load a large bundle in exchange for having really small network requests after the load.

Only for certain types of applications… the route change time for many SPA’s is way higher than for the equivalent MPA

thro1 · a month ago
> But SPAs came about in the days of jQuery, not React.

(viper.pl 2000, philips.pl 2001 .. - are.. 'unreal' ??

'µloJSON': https://web.archive.org/web/20020702120539js_/http://www.vip...

historised chained htmls restart onerror: https://web.archive.org/web/20020402025320js_/http://www.aut...

)

jQuery 2006, React 2013

tomhallett · a month ago
Depends on the definition of SPA, but in the days of jquery, I hardly consider any of that single page app. For example, the server rendered page had most of the html initial rendered, jquery would attach a bunch of listeners, and then on an update it incrementally. If lucky, we had a duplicated x-template-mustache tag which had a logic-less template that we could use to update parts. Jquery and duplication was the “problem” which drove everyone to SPAs.
matwood · a month ago
A SPA also makes it much easier to package your site into an app that you can put on the stores.
layer8 · a month ago
> It solved a real problem, of not wanting to reload all that code every time a user on an old browser, with a slow connection, changed some data.

Why would the browser have to reload the code (JS files) on every page transition, with proper caching headers?

jazzypants · a month ago
Click on a link on Amazon and take notice of all the kb of data in the head of every document that doesn't get cached.
twelve40 · a month ago
> When it is worth the pain to load a large bundle in exchange for having really small network requests after the load

...and yet, i keep running into web (and even mobile apps) that load the bundle, and subsequent navigation is just as slow, or _even slower_. Many banking websites, checking T-Mobile balance... you wait for the bundle to load on their super-slow website, ok, React, Angular, hundreds of megs, whatever. Click then to check the balance, just one number pulled in as tiny JSON, right? No, the website starts flashing another skeleton forever, why? You could say, no true SPA that is properly built would do that, but I run into this daily, many websites and apps made by companies with thousands of developers each.

jazzypants · a month ago
Yeah, I see a lot of poorly written back-end APIs too.
chaps · a month ago
Is this true? When I think of old SPAs I think of java apps running in a browser. Those are definitely older than jQuery.

(I love this silly site for downvoting this question.)

brailsafe · a month ago
Java applets and ASP.Net did have a superficial answer to this, as well as Flash, but they varied in terms of their ability to actually function as raw web interfaces using the URL to navigate between sections.

Being able to reliably and programmatically interact with client-side storage and the url, as well as improvements in DOM apis and commodification of hardware with more ram and faster faster CPUs, among many others factors, seem to have contributed.

kassner · a month ago
ExtJS came about in the late 00s, and it was possible to build SPAs with it, overlay/draggable windows, and had powerful grid/form components.
chrisweekly · a month ago
Java applets are entirely distinct from SPAs, at least as that term is used in the webdev community.
threatofrain · a month ago
Those apps came from an era when these terms weren't even coined yet.
pstuart · a month ago
I think of java applets as being more akin to wasm; SPAs were/are a collection of html that recreate the experience of a "plain old" html web site.
zeroq · a month ago
SPA is not only about seamless transitions but also being able to encapsulate a lot of user journey on the client side, without the need of bothering server too much.

Let me give you an example - one of my biggest gripes about web ux is the fact that in 2025 most shops still requires you to fully reload (and refetch) content when you change filters or drill down a category.

A common use case is when you come to a shop, click on "books" (request), then on "fantasy" subsection (another request), realize the book you're looking for is actually a "sci-fi", so you go back (request, hopefully cached) and go to "sci-fi" (another request).

It's much better ux when a user downloads the whole catalogue and then apply filters on the client without having to touch the server until he wants to get to the checkout.

But it's a lot of data - you may say - maybe on Amazon, but you can efficiently pack sections of most shops in data that will enable that pattern in less kilobytes that takes one product photo.

I've been building web apps like that since ca. 2005 and I still can't understand why it's not more common on the web.

da_chicken · a month ago
I don't know, I think the most painful aspect of having to do a full reload is how I efficient the site is. The actual data is a few KB, but the page itself has to download 100 MB and the web browser is burning through a GB of RAM.

Like I don't find Hacker News to be egregious to navigate, and nearly every nav is a reload. It runs fine on my 2008 laptop with 4 GB of RAM.

But I go to DoorDash on the same device, and it takes 30s to load up a list of 50 items. They give you a countdown for a double dash, and I genuinely don't think it's possible to order some curry and get a 6 pack of soda in less than 3 minutes. And 2.5 minutes is waiting for it to render enough to give me the interface. Almost none of it is a full reload.

nine_k · a month ago
An SPA can be lean and fast. React is the prevailing Web framework today? Preact is like 5 KiB of code.

What makes SPAs unwieldy is not the technology but the lack of desire to optimize. It loads fine on yesteryear's Macbook Air? Enough, push it.

I very well remember heavy, slow-loading websites of, say, year 2000, without any SPA stuff, even though lightweight, quick-loading pages existed even then, in the epoch of dial-up internet. It's not the technology, it's the desire to cram in more, and to ship faster, with least thinking involved.

cosmic_cheese · a month ago
Yeah, the enemy isn’t the need to reload, it’s reloading taking a long time due to too much garbage that’s not the content the user is interested in having to come down off the wire and render. A site that requires an occasional split second reload is always going to be preferred to a behemoth that doesn’t need reloading but has me staring at blank screens and loading spinners half the time I’m using it.
Aurornis · a month ago
> But I go to DoorDash on the same device, and it takes 30s to load up a list of 50 items.

> And 2.5 minutes is waiting for it to render enough to give me the interface.

I have a very old MacBook Air (one of the painfully slow ones) that I use for development reference for what a slow machine looks like.

I just tried clicking around DoorDash and didn’t see anything nearly this bad. Not even close.

Every time there’s a Hacker News thread about how slow websites are, there are dozens of comments like this claiming extremely large latency numbers. I can’t tell how much of it is exaggeration for effect, or if some people have configurations with weird quirks that make them abnormally slow.

I suspect it’s a lot of this:

> on my 2008 laptop with 4 GB of RAM.

Sorry, but I don’t think it makes sense for companies to optimize their websites for computers that are nearly two decades old and don’t even have enough RAM to run a modern operating system.

The intersection between people who spend money on a expensive luxury service like food delivery to their door and people who won’t spend the cost of a couple DoorDash deliveries to upgrade from a 2008 laptop to a 2018 laptop in 2025 is negligibly small.

mym1990 · a month ago
Hmm, I would say comparing Hacker News to DoorDash is not exactly apples to apples. There may also be ulterior motives to make a website slow(or at least not optimized) if the company wants to funnel people towards an app on the phone.
dzhiurgis · a month ago
Gmail takes 3s to load. And HN is a website, not an app.
mirkodrummer · a month ago
Thing is, and I believe it's a valuable example counterpoint, if I shift-click on a link, like sci-fi category, to open it in a new tab(very common thing people do), having a multi page application is zero work added, on an spa you have to manage that. If the link doesn't exist and categories can only be accessed by a select input then ux isn't that great
paffdragon · a month ago
This is so annoying when SPAs break browser functionality like open link in new tab. Even if it works often it has to reload a bunch of JS again, which makes things veeery slow. This is why I really don't like Linear, I often open issues in separate tabs, which is every time a pain, browser freezes for seconds just to open a link in a tab...
brulard · a month ago
Modern SPA frameworks give you this by default. You can deep link and get the specific page with all the parameters/filters etc applied server rendered in remix/react-router, next, sveltekit and most other frameworks. I agree that too many apps have basic things like CMD+click broken
Zanfa · a month ago
Please no. Whenever I see an online store as a SPA catalogue I shudder, because it usually breaks after browsing a bit in a weird state. And it resets to somewhere random should you hit back, refresh or try to send a link to somebody.
lblume · a month ago
Yes, SPAs should store simple user state in the URL as well.
throwaway7783 · a month ago
HTMX (and similar) solves a lot of this. It so happens that we end up building two apps one frontend and one backend with SPAs as built today. I'd rather build a lot of it on the server side, and add some dumb interactivity on the client (show/hide, collapse/expand, effects). There is still a place for SPA though.
naet · a month ago
HTMX does the opposite of this, it requires many more round trips to the server instead of using client side JS to do work.
SenHeng · a month ago
> It's much better ux when a user downloads the whole catalogue and then apply filters on the client without having to touch the server until he wants to get to the checkout.

This is what we[0] do too. We have a single JSON with a thousand over BOMs that's loaded directly into the browser. Previously we loaded the inventory data via an API as is usually expected. The fact that there's even an API meant requiring progress and loading bars, API unavailability scenarios, etc.

Having it all as a single preloaded JSON meant that all of the above goes away. Response is instantaneous.

[0]: https://chubic.com

crazygringo · a month ago
Generally speaking, companies don't want you to download their entire catalog. They don't want competitors to be able to analyze it easily like that.

And if a store is selling books, it might have hundreds of thousands of them. No, it's not a good experience to transfer all that to the client, with all the bandwidth and memory usage that entails.

zeroq · a month ago
That's really weak argument.

If it's one their website the competitors can write a simple crawler and create that catalog.

And you don't have to send every single field you have in your database. Once the user selects a category you can send a metadata that enable the client to scaffold the UI. Then you cache the rest while user interacts with the site.

Barnes and Nobles - according to their FAQ - has 1 million unique items in their catalog. But they also have tons of different categories. A single book cover weights around 30kb.

I'll leave it as an excercise to figure out how much data you can fit into 30kb to make usable filtering system.

btw: opening their front page downloads 12.1MB already.

ec109685 · a month ago
In almost all cases the back swipe in the spa resets you to the top of the page, navigating out of the app and back in doesn’t work, etc. It’s really hard to build a multi page spa that feels good.
zeroq · a month ago
It's funny you've mentioned that.

It reminded me of the time when I joined Wikia (now Fandom) back in, I think it was 2006. One of the first things that landed on my desk was (I can't recall the context) deeplinking.

And I remember being completely flabergasted, as I came Flash/games background, and for us that problem was completely solved for at least 4 years at the time (asual swfaddress package). I felt kind of stupid having to introduce that concept to much more senior engineers that I was at the time.

dzhiurgis · a month ago
Never thought about scroll position (tho SPA I’ve built recently I think does it ok). How do you solve it?
kerkeslager · a month ago
> SPA is not only about seamless transitions but also being able to encapsulate a lot of user journey on the client side, without the need of bothering server too much.

True, but as a user, I don't want you encapsulating my journey. You can wax poetic about hypothetical book categories, but the reality of SPAs is that they break back buttons, have terrible accessibility anti-patterns, attempt to control my attention, and expose my computer to all your bad security practices. SPAs usually contain half-assed implementations of half the features that ship standard in a modern browser, and the only motivation for all that effort is to make the site more favorable to the server's owner.

When a site is implemented with simple HTML and careful CSS, I can configure it to my needs in the browser quite easily. That's a site that favors me, not your opaque blob nonsense.

uxcolumbo · a month ago
Why is this being downvoted.

I agree, as user make it fast and don’t break the web. I see so many SPAs with bad usability, like back button not working.

A shopping site doesn’t need to be SPA.

A drawing app, 3D modeller, collaborative whiteboard, video chat, those type of apps fit the SPA model.

ThatPlayer · a month ago
In a similar use, a few of my hobby projects are hosted on static web servers. So instead of rendering out everything into individual pages, which would've been tens of thousands of pages, I have a JSON file that gets rendered by the client in a SPA. I have even used Github Pages for this

I'm playing around with a newer version that uses a sqlite database instead. Sqlite officially has wasm builds, and the database file is already built to be separated into pages. With HTTP Range Requests, I can grab only the pages I need to fulfill any queries.

Sqlite full text search even works! Though I'm hesitant to call that a success because you do end up grabbing the entire FTS table for shorter searches. Might be better to download the entire database and build the FTS table locally.

brulard · a month ago
This wouldn't work for 90% of apps out there. While I would love that approach, it has so many problems that in practice it never worked out for me. First problem is that data change. Either you edit it, or you need updates from server applied to your copy. This is quite complex (although there are some solutions, I had little luck in making this work reliably). Second - you don't want to share the whole catalog in one request. Third - in most cases there is a lot of data. It's not uncommon to have tens of thousands of items and for each you likely need some kilobytes. Four - you are downloading the whole catalog even for deep links which might not care about all but a tiny fraction of that data.
isleyaardvark · a month ago
In my experience, state is the devil, and the approach of filtering things on the client moves a bunch of state management from the back end to the browser, which is the worst place to handle state.
ndriscoll · a month ago
You can do that with checkbox selectors. e.g. see [0]. Note that I don't really do frontend and I asked chatgpt to vibe code it, so this may not be the best way to do it.

[0] https://html-preview.github.io/?url=https://gist.githubuserc...

danielscrubs · a month ago
Pjax was the goat.
threatofrain · a month ago
I don't know what universe this SEO-consultant author lives in. The author gives Next & Nuxt as an example of the kind of frameworks going against his prescription, but that is so wrong.

1. Next won the war in the west, big time. Very very big time. Whenever people talk about new React apps they inadvertently mean Next. On the Vue side Nuxt is the default winner, and Nuxt is just the Next of Vue. That means that by default, by reflexive instinct, people are choosing Next and MPA as their strategy. If you want to correct the overly extreme pendulum motion then you should be telling people to try out SPA. The last 8 years has been a feverish push for MPA. Even the Facebook docs point straight to Next, totally deprecating Create React App. This is also Facebook ceding their battle to Next.

2. Whenever people complain about the complexity of Next, they are complaining about the difficulties of cutting edge MPA strategy, which evolves on a year to year basis. SPA on the other hand is a story that has frozen in time for who knows how many years. Almost a decade?

3. Doing MPA is strictly harder than doing SPA, much much harder. You have to observe the server/client distinction much more closely, as the same page may be split down the middle in terms of server/client rendered.

4. If you're writing an SPA and want to be more like MPA and load data at the time of hitting a user-navigable endpoint, that's on you, benefits and costs and all. You can also load data with anticipation so the client navigation is basically instant.

5. For every sexy SEO-able front-facing property you're going to have many teams with internal apps or dashboards backing that front-facing property. That's where many React devs are employed. Do not unnecessarily take on burden because you're so eager to ship the first "frame" of your app in a perfect way.

brulard · a month ago
How did next win the React framework war? Is it not few years already that see exodus from next to remix/react router, and more recently to tanstack start etc. because of unnecessary complexity, difficulty to run next on anything but vercel, misguided API changes etc.?

You mentioning facebook docs pointing to next, when they explicitly mention remix and other is quite misleading.

threatofrain · a month ago
Well, you must know how to look at download stats, search metrics, GitHub activity, social media temperature, or job posts. I feel that seeing is believing with your own eyes is sufficient for anyone who wants to investigate the issue of whether there’s any winner in popularity.

To not be misleading I wouldn’t have brought up the existence of remix lest people think Microsoft belongs in the same discussion as my software consultancy.

To be clear I’m using Tanstack Start right now.

jbreckmckye · a month ago
> I don't know what universe this SEO-consultant author lives in.

After looking over the author's blog I can see

1. Very high output

2. Lots of AI images

3. Weird writing and editing lapses in several posts

I am moderately confident this post was written with an AI. It may not be totally AI produced, I think the author has probably edited the work, but I think we are mostly debating synthetic content.

Deleted Comment

ivape · a month ago
There was a war? News to me. Saying Next won is like saying React won. Nothing won, everyone just latched on to what they thought the crowd vetted. The blind can't lead each other. Most people that stuck to Angular or minimal or no-frameworks are truly wondering what the fuck are all these people talking about?.

Even the Facebook docs point straight to Next

Startups and SV jerk each other off by promoting each other (think affiliates). None of it means shit.

Next is probably a garbage framework, but it's people's livelihoods. It's very hard to erase something that literally defines people (yes, your resume is YOU).

frollogaston · a month ago
Kinda is a war unless you're working solo, cause you're gonna get forced to use something or another. When I tried a few solo web projects instead of just being a backend guy, I picked up React on my own because it was the only thing that makes sense. The page does what the code says. And that was after trying other things.

Now I gotta occasionally use Angular, and it's boilerplate hell. Adding one button involves editing 30 classes and files even if you don't use templates. I took a course at work where even the instructor got confused adding a button. Why would anyone ever use this besides Google, or do they even use it?

threatofrain · a month ago
> Startups and SV jerk each other off by promoting each other (think affiliates). None of it means shit.

No, this is FB ceding the battle. They absolutely didn't want this. They dropped CRA because social media celebrities were shitting on CRA. Dan Abramov had to do a complete 180 in a single day, after writing a long thoughtful essay in defense of CRA.

Deleted Comment

Deleted Comment

markbao · a month ago
The point of SPAs was never page transitions. I can’t name a single major SPA that does good page transitions, can you? They all just replace the content. And to take a popular SPA framework as an example, it’s almost impossible to do page transitions in Next.js because of the way routes are loaded. I know this because I added proper page transitions to Next.js and it has been an absolute nightmare.

There are two good reasons for SPAs that I can see:

1. Your app probably needs interactivity anyway; for most apps, it’s not just going to be HTML and CSS. Writing your app in some unholy combination of React and HTML is not fun especially when you need to do things like global state.

2. Loading the structure of pages up front so that subsequent data loads and requests are snappy. Getting a snappy loading screen is usually better than clicking and getting nothing for 500ms and then loading in; the opposite is true below I’d say 100ms. Not needing to replace the whole page results in better frontend performance, which can’t really be matched today with just the web platform.

Basecamp has probably invested the most in making a fairly complex webapp without going full SPA, but click around for like 30 seconds and you’ll see it can’t hold a candle in performance to SPAs, never mind native apps.

With that said, I agree that I’d want the web to work more like the web, instead of this weird layer on top. All the complexity that Next.js and SPAs have added over the years have resulted in more responsive but sometimes more tedious-to-build apps, and gigantic bundles. I just don’t think you can match the performance of SPAs yet with just HTML.

causal · a month ago
3. APIs. If you already have a client facing API for your iOS and Android apps, and maybe one for developers, a SPA is just another app to plug into that backend.
gizzlon · a month ago
> Basecamp has probably invested the most in making a fairly complex webapp without going full SPA, but click around for like 30 seconds and you’ll see it can’t hold a candle in performance to SPAs

Really? I just started using it, and it feels fast. Most SPA's are slow and/or buggy (in the "fails to mimic real browser behaviour" kind of way)

pas · a month ago
tiny correction Next is not an SPA (you can in theory write one using NextJS, but by default it's an MPA with aggressive prefetch)
nromiun · a month ago
Lots of pushback here in the comments. But I can't think of the last time I enjoyed using a SPA website over a multi-page one. The initial loading feels delayed, the page scrolling feels unnatural and jarring (completely opposite of how a native app feels).

Also, one of my banks recently changed their old website to a new SPA one. And it is now completely useless. It can't load information in time, so most of the forms are empty. You can't even go back because it is a SPA. So I can only log out, log in and try again. Kind of scary when you are handling a lot of money.

And it is not just one website. As I said I can't recall ever using a good SPA website. So yeah, I can't wait until they are all gone.

croes · a month ago
You think bad programming is restricted to SPAs?

If they botch the back button in an SPA they will botch other things in an MPA

nromiun · a month ago
But this bank's old MPA worked pretty well. By trying to modernize it they completely broke it instead.
kertoip_1 · a month ago
Yeah, the worst thing is when parts of the same application are under the hood different SPAs.

First example that comes to my mind: web version of ProtonMail. Going to settings feels like loading a completely separate website. Or OVH dashboard.

maccard · a month ago
The toupee fallacy strikes again here. Gmail, slack[0], Netflix and Spotify are top tier examples - they actually work. Most are true garbage though.

[0] I am firmly on the slack-performance-is-a-disgrace train, but their web client is a great example of a well done SPA - it’s miles better than the app other than notifications.

nromiun · a month ago
Gmail really? The same one that takes 10-20 seconds on 5G to even show the loading page? What is it doing in that time? Loading emails or downloading an AAA game? It is not just a one time penalty either, you reload and get the same loading page again.

Just a few days ago I had to get an OTP via email and it was completely frustrating. No indication nothing, just a loading circle. The old MPA version was much better.

jeremy8883 · a month ago
if you're receiving jarring page scrolling, it is not the fault of the spa, it's something else at play. it is not they typical spa experience.

if the back button doesn't work, the site was poorly programmed, since any routing library will handle that for you.

austin-cheney · a month ago
SPAs do not exist to benefit the user. They exist to benefit the developer who writes them.
tossandthrow · a month ago
> But I can't think of the last time I enjoyed using a SPA website over a multi-page one.

You likely don't even notice that most of what you browse are SPAs.

The reason why there is pushback is because the article is straight up misinformation.

nromiun · a month ago
Actually the static address bar and the refresh button behavior makes it obvious.
elendee · a month ago
I like the pushback because it means less competition in the native framework space
dkarl · a month ago
I think this article is unfair to SPAs. SPAs are a lot more effort, but they are better. For a long time they have been the only way to "make it feel like an app." (I think the author says "make it feel like an app" because they know we all resent app fatigue, all the apps we have to download that should just be web sites, but I think we also all know that when something really is an application, it's rare for a "web app" to match the experience of a local native application, and an SPA is the only way to make a sincere attempt.)

The comparison of bloated SPAs with lean web sites is bogus. If someone takes the effort to make their web site lean, they'd do the same with an SPA. If someone makes a slow, bloated SPA with megabytes of Javascript, they'd make a slow, bloated web site with megabytes of Javascript. I think we've all seen enough of the web to know this is true.

I click on articles like these because I've seen the effort that goes into a good SPA, and I'm interested in anything that would allow people to deliver an equivalent experience with less effort. All I see here is a tiny bit of cosmetic polish. Polish is appreciated, but this doesn't seem like something that would tip the balance between building an SPA or not. Am I missing something?

adamtaylor_13 · a month ago
“But they are better”

By what measure?

nfw2 · a month ago
Performance, developer experience, user experience
nosefurhairdo · a month ago
This argument is tired and ignorant. Try building linear.app without a SPA framework. The idea that "Native CSS transitions have quietly killed the strongest argument for client-side routing," is dubious at best.
0xCMP · a month ago
This doesn't seem fair to say. Linear is special even among SPAs; it's by far not the norm. No one said "ban SPAs and remove javascript from the browser".

Linear's speed comes from being "offline-first", but I challenge you to name almost any other product in common usage that does it that way. It's just not common. On the other hand if I want to buy tickets I'd rather most of that website be SSR and do SPA where you actually still need it. Or forums, news sites, blogs, and informational sites.

There is so much out there that would be better developed with SSR and then use CSS to make it feel SPA-like than to actually be a SPA.

nfw2 · a month ago
The article's title is it's time to kill SPAs

Dead Comment

epolanski · a month ago
No one said SPAs have no place, but 99% of websites out there don't need to be one.
zarzavat · a month ago
SPA means single page app. For example, Google docs, Figma, Google calendar, etc. Apps that use web technologies instead of being native apps.

A long time ago some webdevs started abusing the SPA concept to build simple websites. However that is not within the original meaning of the term SPA, because simple websites are not web apps. The author assumed that everyone would just understand that they are talking about SP"A"s and not SPAs, because for a certain subset of webdevs working on websites, the antonym of SPA is MPA, and it's normal to refer to your website as an "app". However for a certain other subset of webdevs, the antonym of SPA is simple website, and what the author is talking about are not SPAs at all.

nfw2 · a month ago
What does it's time to kill SPAs mean to you other than they have no place.
40four · a month ago
This article is getting a lot of pushback from the SPA champions, deservedly so, but it makes some good points to. I can’t be the only one, but I myself am getting very tired of the amount of websites where I have to sit and look at a skeleton loading for way too many seconds, then the data loads and it looks nothing like the skeleton. There is an over abundance of really crappy SPAs out there. Sorry not sorry
pyman · a month ago
I thought about your comment, and IMO the reason some (or most) SPAs are badly built comes down to the inexperience of developers and hiring managers. They don't know much about performance, they don't measure it, they don't handle errors properly, they ignore edge cases, and some are learning as they go.

Bottom line: they build the SPA, but leave behind a terrible UX and tech debt the size of Mount Everest.

maccard · a month ago
They would have done the same thing with a MPA too though.
tossandthrow · a month ago
This is not intrinsic to SPAs.

You'd likely have to wait an equal amount of time for a non SPA - just without any skeleton