News for hackers. Stuff that matters.
Re:State is hard: why SPAs will persist by zelphirkalt on Sunday May 29, 2022 @05:59PM (#31553287)
Every day staples like browsing history, middle click / control click a link to open in new tab, back function, forward function, bookmarkability of specific "subpages" (in quotes, because SPA) are the first things to fly over board in 90% or more of SPAs, which do not have to be SPAs in the first place. Then developers either ignore all of those things, living with the illusion, that this is not impacting UX, or they have to introduce even more dependencies, that aim to fix those very basic things, which by default are broken.

This is one of the main criticism I have for SPA. If you go SPA, it is your responsibility, to make it work at least as well as a traditional website.

The other criticism is, that I expect to at least have a noscript block, telling me about a website not working without JS. And not some nonsense about my browser not being supported. No, it should admit, that the website was created in a way, that does not work without JS. It should be honest. But that is often too low level for SPA frameworks, so that the devs of the website cannot be a*ed to build that into their SPA. They throw around "web components" (actually react components, or any other framework components, because often you cannot copy paste them into another framework, which is not based on the framework, you implemented them for, because they are not standardized), but are unable to include a simple noscript tag.

Basically most SPAs introduce JS as a must have dependency, but if I allow it to run on the page, I first have to trust some random code, and I will have opted into high CPU loads for things I do not need. How often I have experienced 100% of a core being used just by scrolling or for some silly animation no one needed or some hover effect. No one is testing these sites properly or speaks up in those organizations about the unprofessionalism that are apparent in the resulting websites.

Some websites manage to get it right and to make everything work, probably, but usually I just close the tab, when again I only see a white screen with nothing on the page, instead of going through the pain of allowing their 10 CDNs to actually make it work, so I am not so likely to see that SPA, which does everything right and allows me to use an SPA like any normal website.

There are no comments on this comment yet.