top | item 14505728

(no title)

pharrlax | 8 years ago

Are you really trying to say there's no argument to be made that SPA + prerendering is a design pattern with advantages over flat html, even for static content?

Obviously there are disadvantages as well, but it's a tradeoff, and if executed correctly it's one that, as fewer people turn off JS and browsers become better at running web apps, is increasingly becoming worth the complexity for certain use cases.

discuss

order

TeMPOraL|8 years ago

In theory, maybe there is an argument. In practice, most of the time it'll be a pretty bad one.

For me it's about how user-hostile those decisions are. I can understand SPA-s when e.g. the service would be infeasible if all the processing was done server-side. But more often than not, it's just laziness. The devs can deploy a sleek-looking SPA in 5 minutes with their JS toolchain, forever dooming users to download tons of pointless JS that adds nothing valuable to their experience. But who cares, today's zeitgeist is "privatize the profits, socialize the costs".

Think of all those sites with articles and blog posts that blank out if you have JS disabled. There's no reasonable argument to be made that they should be SPA. That's just a case of user-hostile laziness.

drdaeman|8 years ago

> The devs can deploy a sleek-looking SPA in 5 minutes with their JS toolchain

Oh, if that'd be true...

Our experiments with React took quite a lot of time (like, weeks) before we got things in shape. And then some more time before that shape wasn't a pear.

And if the backend is not in JS, server-side rendering is quite a mess.

prawl|8 years ago

If the main work your site is doing is showing pictures and text - and this is still and always will be a large part of the web - the browser has a number of features that work very smoothly and reliably out of the box: scrolling, page history, following a link when it is clicked, right-click save as, searchability, basic accessibility, etc. - and typically much quicker rendering than something which waits for a lot of extra HTTP requests and extra work being done in a VM somewhere.

Reimplementing these features in JS is often pretty feasible, and occasionally there are use cases for it, but it's a lot of additional overhead and it's not at all unusual to introduce bugs that really hurt the UX. (UX is not just adding as much branding as possible on top of vanilla browser behavior.)

The average newspaper website should not load 15 megs of junk from 20 different domains with a massive amount of Angular code just so I can read a single paragraph of plain text. This is an example of a document, it's what the web was made for and browsers already do it well without turning most documents into an SPA.

scaryclam|8 years ago

I think he may well be saying that, and it's actually true. Want to make an SPA for static content? That's fine, but don't kid yourself that it's not worse in every single way. It's not a design pattern either, it's an anti-pattern.

rsynnott|8 years ago

I'm sure there are arguments. In practice, it seems to have made the web slower and shitter, tho.

sedachv|8 years ago

> as fewer people turn off JS and browsers become better at running web apps

In my anecdotal experience, I am running across more people that are turning off JavaScript, partly because browsers are becoming more bloated and worse at running web apps.