15 ms·
This sounded more like a anti-SPA post. Maybe the title should be "Reasons for not building a SPA".
by ithrow 6y ago
This sounded more like a anti-SPA post. Maybe the title should be "Reasons for not building a SPA".
- timw4mail 6y agoSPAs are an anti-pattern. Let's rebuild html rendering, navigation history, forms, etc, all with Javascript, because it's the hip thing to do.
- Grimm1 6y agoYou're not using that word correctly, since this is not a pattern it's an architecture. Please don't misuse words, especially in a negative context to mean "something I don't like", it cheapens the word in legitimate cases. No comment on whether SPAs are worth anything though, I reserve my opinion.
- Kaze404 6y agoThere are very clear reasons for SPAs to exist. 1) Prevent reloading of the page every time the user clicks a link, reducing the overhead of fetching common content between pages multiple times (headers, menus, etc) and providing a more seamless experience to the user. 2) Better emulate the feel of mobile applications, for users who spend most of their time on their phones and don't often or have never interacted with a computer. Yes, those exist. 3) Improved network performance (by sacrificing initial load time). Once the browser downloads and caches the bundle on initial load, the user can revisit the page on regardless of their connection stability or speed. This isn't to say SPAs are a perfect choice in all cases (they also have just as clear drawbacks), but saying "it's what everyone does" is the only reason they exist is downright false.
- randompwd 6y ago> Prevent reloading of the page every time the user clicks a link, You don't need a SPA for that. And page load/render times are much shorter when html is delivered straight to browser fr most applications > Better emulate the feel of mobile applications, That's pretty weak defense. > Once the browser downloads and caches the bundle on initial load, the user can revisit the page Giving we're now in the world of Continuous Deployment, I doubt the cache lasts long. All 3 of those reasons sound very reaching to me. And here's the kicker - doing a SPA well enough to be seamless and performant is hard enough that most sites suck if they're delivering a SPA. Also, if, for example, you do your payments or other sensitive pages in a SPA, you're still running 3rd party scripts on those pages for no reason. Let me know when unloading scripts(&their in mem code) is doable.
- Kaze404 6y agoFew things annoy me more in this world than when someone "responds" to arguments by quoting half of them to construct and attack a strawman instead of the argument they're supposedly discussing. Please don't dilude conversations like this, it doesn't do anyone any favors.
- shreddish 6y ago> Also, if, for example, you do your payments or other sensitive pages in a SPA, you're still running 3rd party scripts on those pages for no reason. Let me know when unloading scripts(&their in mem code) is doable. Are you legitimately worried about unloading third party libraries into memory on the browser??
- randompwd 6y agounloading third party libraries _from_ memory. or else gaining the ability to freeze their code and all derived/generated code from accessing the dom/network/etc.
- merb 6y agoI've never heard that somebody disliked vmware vsphere as an spa. the older flash one however...
- Scarbutt 6y agoYou still need js for interactive apps, SPAs avoid the spaghetti mix of html rendering and rendering client side.
- osrec 6y agoThe way in which we consume and deliver via internet has moved on from the early days of the web. It's no longer just text, images and links. There's much more to it now, and SPAs are a reasonable step forward to providing richer experiences online with more functionality. Not sure you could ever call them an anti-pattern.
- timw4mail 6y ago> It's no longer just text, images and links. Assuming you add video, 99% of the web is just text,images,links,forms, and video. None of these things even require Javascript.
- osrec 6y agoI'd say a big part of the web is gaming, chatting, interacting. A lot of that content updates every few seconds. Without JS, websockets, ajax requests etc, do you suggest users load the entire page again whenever they want to see an updated view?! Or is your opinion that it should only be possible to do those things in native, purpose-built apps? Because in that case, how do you justify using an operating system? Perhaps we should exclusively use purpose-built assembly code that you flash to some writable media every time you want to run a particular program!
- timw4mail 6y agoAs another poster said: The right tool for the right job. Also, a SPA is not the only option with Javascript.
- chipotle_coyote 6y agoHow would the site we’re communicating on right now be improved if it were rebuilt as an SPA?
- osrec 6y agoThreading could be clearer. Less data would need to be loaded on each page load. I can imagine that a lightweight SPA to handle the a few standard views (e.g. listItems, itemDetails, profile, changePassword, submit) would cut down data transfer by a significant margin (20-30%, maybe more). The UI could also be much better on mobile, and we could give users the option to cache certain pieces of content offline.
- yagodragon 6y agoI also love when i visit a website with a simple markup and minimal js. Not everything should be a react/graphql isomorphic SPA, but have you checked NotionHQ[0]? The whole thing is a single page react app. People use it to build wikis, manage projects and even create blogs and job postings. All that using client-side rendering. It doesn't load as fast as hackernews but most people seem to love it either way. [0] https://www.notion.so/ https://www.notion.so/
- Nextgrid 6y agoI’ve had the displeasure to use this once at a client and I was amazed that they managed to make text editing lag.
- austincheney 6y agoThe most common reasons for building a SPA: * That is the design pattern dictated by your large framework. * Maintaining state is absurdly simple, but it requires original code if not using a big framework. * The browser provides a simple standard API for interacting with HTML, but your framework provides abstractions you didn’t know you could live without. That’s it. Developers twist themselves in knots trying to qualify their opinions as anything more valid than what sounds like incompetence, but with any level of informed discussion it’s clearly about competence (or insecurity).
- osrec 6y agoAnother big reason is that developers want to deliver a specific user experience that is simply not possible with the default page loading functionality of most browsers.
- masa331 6y agoYou mean the specific experience when back buttons aren't working? Or when urls don't make sense? Or when you can't just share the content by copying the url because it no longer identifies the conten? Or when you can't say if something is loading, missing, or broken? This is my user experience with SPAs regarding navigation.
- robertoandred 6y agoUse better SPAs.
- osrec 6y agoAgree. There are a lot of bad SPAs out there, but that's a testament to how easy they are to get started with and their popularity. That doesn't mean good SPAs don't exist - many do!
- ehutch79 6y agoIf an spa is behaving like that, the coders have failed at their job.
- jmchuster 6y agoIt's already in the name Single Page _App_. If you're not building an app, you probably aren't best served using an app framework.