October 30th, 2024

Panic at the SPA

The article critiques the complexity and inefficiencies of React and Single Page Applications, highlighting performance issues, SEO compatibility concerns, and a lack of standardization in the JavaScript ecosystem.

Read original articleLink Icon
Panic at the SPA

The article reflects on the evolution of web development, particularly focusing on Single Page Applications (SPAs) and the challenges associated with frameworks like React. The author shares personal experiences from their programming journey, highlighting the transition from PHP and AngularJS to React, which they criticize for its complexity and potential for performance issues. The integration of state management and the DOM in React can lead to inefficiencies, especially as applications grow in complexity. The author also discusses the drawbacks of using routers in SPAs, which can complicate compatibility with SEO and accessibility tools. Performance concerns are raised regarding JavaScript rendering on the server, and the author expresses skepticism about the proliferation of JavaScript tools and packages, suggesting that the ecosystem lacks standardization. The piece concludes with a call for developers to explore alternatives to SPAs, such as PHP, and reflects on the chaotic nature of JavaScript development.

- The author critiques the complexity and inefficiencies of React and SPAs.

- There are concerns about the compatibility of SPAs with SEO and accessibility.

- Performance issues arise from JavaScript rendering on the server.

- The JavaScript ecosystem is seen as lacking standardization and coherence.

- The author encourages developers to consider alternatives to SPAs.

Link Icon 7 comments
By @WD-42 - 5 months
I’m currently migrating a fairly large Vue.js 2 + django rest framework app by moving all the front end to the django backend templates using apline.js and htmx where necessary.

I’m loving evey moment. It’s thousands of lines of code and dependencies removed. It’s faster.

I feel like I’m waking up from a bad fever dream that was web development for the last 10+ years. What were we thinking?

By @peterldowns - 5 months
I don't understand what the author is trying to say. Not hating; to me it was completely incoherent.
By @lelanthran - 5 months
I'm using a self-developed framework (proprietary for now) for my SaaS that almost completely eliminated backend code[1].

The downside is that quite a lot has to be done on the front-end because all the backend can provide are static hosted files and a query-executor[2].

So I looked at quite a lot of front-end frameworks for SPA, nope-ing my way out of each one. I'm still in the process of settling on one of the (very poor, IMHO) options for front-end SPA.

For now I'm still using a bunch of little JS functions on the client because that was faster than learning some framework that might all have to be thrown away some day anyway.

[1] I say "almost", but for my current product it has eliminated all backend code. The only "backend" code I write are PostgreSQL parameterised queries. No Java, C#, Go, Python, JS or anything else. While the framework does have the ability to schedule periodic execution of programs written in anything, for the current product all I have is a script to periodically truncate truncate the log file.

[2] There are no security problems with this: I don't execute queries sent from the client; you can see it in action using `demo.skillful-training.com`, username `one@example.com` .. `ten@example.com` with password set to `1` for all of the users. Just a note, the demo site version is quite far behind the deployments for actual clients.

[EDIT: My `ROADMAP.md` file has actually had `Add in Lua support` for the last year, but I have not had any need yet for coded logic on the backend that cannot be handled by an SQL query. At some point I may add in the ability to handle requests using Lua/$OTHER_PROGRAMMING_LANGUAGE, but for now there is no use-case]

By @haburka - 5 months
This is a weird article. It feels like an LLM was promoted with a few points about how to critique frontend. They don’t really make any substantial claims nor do they back up their claims with real world evidence, instead just referencing general pain.

If this is a real author: There are definitely valid complaints towards SPA but you need to be more specific and not just throw shade on the FE ecosystem as a whole. Talk about your specific failures and how the tooling got in the way of quality engineering. Generalities don’t really help anyone.

By @temporallobe - 5 months
Modern Angular w/ SSR is pretty nice. Angular may be overkill for some folks (and a PIA to learn) but it really does solve a lot of common problems.
By @nosefurhairdo - 5 months
Tl;dr: single page apps (react) are bad, perform badly, have bad tooling, and have a bad ecosystem.

This is a tired critique which fails to mention even one reason why one might choose React (or other SPA framework) in the first place. I work on a big, complex React application and it is a great tool for the job. All of the issues mentioned are easily resolved with a modest amount of research or experience.

By @smitty1e - 5 months
> The truth is that the web was built around the idea of every page being an independent file.

So Perhaps Abusing

Stateless Protocols As

Solo Pane Actors

Screams: "Preventable Angst"