4 ms·
> SPAs will be slow no matter what. Uh…no? You’re presumably talking about specific terrible prebuilt frameworks - not someone building a nice vanilla SPA.
by DANmode 1mo ago
> SPAs will be slow no matter what.
Uh…no?
You’re presumably talking about specific terrible prebuilt frameworks - not someone building a nice vanilla SPA.
- grishka 1mo agoAt this point SPA pretty much implies React. But even if you optimize everything the best you could and avoid any third-party runtime dependencies, it's still going to be significantly more work to make API requests and do client-side rendering vs just rendering HTML server-side.
- dvdkon 1mo agoNot always. Consider an SPA that connects via WebSockets and streams in data, adding points to a chart. The JS-less alternative would be refreshing an SVG or even the whole page once a second. The SPA is clearly more efficient here (unless someone screws it up badly).
- grishka 1mo agoI wouldn't consider that an SPA at all, it's just a page with an interactive element. An SPA is something that renders everything client-side and uses a generic client API to talk to the backend. A telltale sign of an SPA is that the first thing you see when you open it is some sort of loading indicator instead of the actual page you're visiting.
- DANmode 1mo agoNo, the telltale sign of a SPA is that it’s an app that’s a single fucking page, lol Please stop changing the definitions of explicit words and phrases - to anyone reading this!
- preg_match 1mo agoRight but the implication of a SPA is that it’s an application which has many logical pages, but only one real page. The logical pages are constructed by dynamically updating the DOM using JavaScript. As opposed to navigating to a new, server-provided page. For example, a search function. For a MPA, each search query would be a new page. For a SPA, each query is a new logical page, served on the same real page. Technically yes, a SPA may have minimal client side rendering. But then it’s not doing much of anything at all - it’s just a site. When people say SPA, they typically mean an application with client side rendering.
- DANmode 1mo ago> it’s just a site sigh …does someone else want to finish this up?
- preg_match 1mo agoThis reply means basically nothing to me or anyone. To expand on what I mean, if the implication isn’t obvious: a SPA with no client side rendering is just a single HTML page. It’s a document, not an application. So SPA naturally implies client side rendering. The difference between a SPA and MPA isn’t the amount of pages, they both have about the same amount of logic pages. It’s about where those pages are rendered. Dynamically on the front end, or on the back end. EDIT: okay okay to expand, my website has a contact form. With JS enabled, the form submit displays a little box that says “thank you for submitting”. With JS disabled, it navigates you to a “thank you for submitting” page. Both are the same logic page, they have the same function. One page is just rendered client side, and one server side. Most websites or applications are hybrids. There’s very few true single page applications, and very few true multi page applications. Most SPAs have multiple real pages for different things. Most MPAs combine multiple logic pages into one real page.
- DANmode 1mo agoSingle HTML files / pages can be fully-featured, full-purpose-fulfilling applications. > Most websites or applications are hybrids. and some are emphatically not. But…where were you going with that?
- DANmode 1mo ago> At this point SPA pretty much implies React At this point, app pretty much implies React - ask an LLM for an app and see if that’s not what you get.
- realusername 1mo agoI've never seen an SPA which scales properly and doesn't become a bloated mess, maybe that's possible but it's definitely harder to make it work than using traditional server side template rendering
- DANmode 1mo agoPlenty of app usecases don’t need to “scale” - immediately or ever!
- realusername 1mo agoThat's a good point but you never know that from the start, "this app won't scale well" is a hard sell for a new project in my opinion
- DANmode 1mo agoEspecially today, single-user stuff, especially in categories of things like health, especially when you’re writing your own stuff, that’s when you know from the start that scaling doesn’t matter! =] Related, and more powerful than my comments in this thread are going to be: https://www.robinsloan.com/notes/home-cooked-app/ https://www.robinsloan.com/notes/home-cooked-app/
- realusername 1mo agoI don't only mean "scale" in terms of users but also scale in terms of features. So you have to guarantee that your product will stay low users and low features forever or spend a very high effort to try to partially overcome that block when you change your mind. And guaranteeing that it will stay low features is much harder than low users I think. In exchange for that you get a better talent pool for recruiting but does that matter if your product has to stay low scale anyways?
- DANmode 1mo agoOr you have to distribute your code in such a fashion, and structure your business model in such a way, that “scale” doesn’t require you doing things that have nothing to do with providing the feature set (most SaaS).