News for hackers. Stuff that matters.
Re:Plain Vanilla Web by panstromek on Sunday May 11, 2025 @02:29PM (#43955847)
Might be a bit of a selection bias though. I certainly remember a lot of crappy MPAs before SPAs got big. The crappines just moved to SPAs as they became mainstream. Overall I agree that MPAs are better default, though, good SPAs are hard to build.
Re:Plain Vanilla Web by listenallyall on Sunday May 11, 2025 @02:40PM (#43955961)
Part of the complaints about MPAs originally was that navigating all the different pages was slow, because loading new pages was slow. But plenty of today's SPAs deliver content even slower and the user is staring at a spinner for lengthy stretches. The key is quick, efficient server responses, whether using SPA or MPA approaches.
Re:Plain Vanilla Web by whstl on Sunday May 11, 2025 @04:30PM (#43956884)
Yeah. In theory SPAs should be faster, but in practice rendering/sending the whole template is not as bad. And as you mention, both can be slow, due to the non-cached API/DB call, so...
Re:Plain Vanilla Web by const_cast on Sunday May 11, 2025 @06:27PM (#43957711)
Even in theory, producing json is just typically slower than producing HTML.

It seems unintuitive, but traversing an object tree using reflection to generate json is just slower than using an HTML template, which is probably a rope data structure.

Re:Plain Vanilla Web by zelphirkalt on Sunday May 11, 2025 @11:35PM (#43959410)
Rendering the template or JSON response is the last and probably often the least computationally expensive step though.
Re:Plain Vanilla Web by whstl on Monday May 12, 2025 @08:47AM (#43962328)
I guess the rendering itself is pretty much the same for both SPAs and MPAs, since in the end it can be pretty much the same markup, but the SPA is also at a disadvantage here because it has to combine template/components + JSON to generate the HTML :/
Re:Plain Vanilla Web by whstl on Monday May 12, 2025 @08:48AM (#43962340)
That reminds me of when I first benchmarked a Rails app and noticed that JSON rendering was significantly slower than the remote database call. No lie, jbuilder was taking about 80% of the request time for about 90% of all endpoints.
Re:Plain Vanilla Web by panstromek on Monday May 12, 2025 @02:54AM (#43960302)
Oh, totally. I myself have written on how GitHub manages to make client side navigation 2x slower than full page reload: https://yoyo-code.com/why-is-github-ui-getting-so-much-slowe...
Re:Plain Vanilla Web by listenallyall on Monday May 12, 2025 @07:55PM (#43968546)
great article!
Re:Plain Vanilla Web by astura on Monday May 12, 2025 @10:24AM (#43963324)
Issues with old school websites before SPAs were usually "kinda clunky/hard to navigate/find stuff" and "ugly/inconsistent UI."

Issues with SPAs are "core features straight up don't work " and "page is now just an endless spinner."

I know which I prefer.