News for hackers. Stuff that matters.
Re:js;dr = JavaScript required; Didn’t Read. by mistersys on Sunday January 17, 2021 @03:06PM (#25814418)
Some people don't seem to understand what the whole JS SPA thing is about, and it's quite strange to me.

It's not popular because it's a fad, it's not about replacing good old static websites with fancy over-engineered JS code.

It's about making desktop-class applications more accessible via the web. Desktop-class Apps have lower latency requirements then server rendered frameworks are capable of delivering, plain and simple. You could certainly build Facebook as a fully server-rendered PHP app, but that would hurt Facebook's business because its servers would need to do more work and its users would have to wait longer for content.

Fully server-rendered frameworks are not capable of delivering low-latency desktop-class applications. If your app doesn't require low-latency updates, then you can certainly use a classic PHP or Ruby on Rails stack with no problem.

Sure, you can use JQuery style code to make your PHP app more interactive, but you're probably just going to end up with a messy, hard to understand JS code base eventually if you you don't have some sort of low-latency client-side declarative templating framework.

There's certainly some companies that are caught in the hype and build a SPA app when they would probably be better served with a simple PHP site, but on every project I've worked on that used React across a few companies (interactive apps for ex: cropping & manipulating images, building visualizations and reporting on data), not using an SPA framework would have slowed down development dramatically, or left us with a really poor product.

Re:js;dr = JavaScript required; Didn’t Read. by kortilla on Sunday January 17, 2021 @03:34PM (#25814668)
> It's about making desktop-class applications more accessible via the web.

Everyone understands this is what devs are trying to do. The complaint is that my local newspaper doesn’t need a desktop class application. Nor does my bank, nor does Reddit for that matter.

There are vanishingly few websites that need a “desktop application” performance profile. Most websites are just viewing documents. The size of the SPA frameworks is frequently higher than the actual content being viewed.

Finally, if matching desktop app performance is truly the goal, the majority of SPAs fail horribly. Poor request patterns and transitions make the pages just as slow as server side rendered html. I would rather wait one second to get a JS-free response than look at another damn spinning circle for 5 seconds as the page sputters new elements in.

Re:js;dr = JavaScript required; Didn’t Read. by mistersys on Sunday January 17, 2021 @04:17PM (#25815047)
Are there really that many local newspapers using SPAs though? I feel like advertisers delivering boatloads of JS with their ads sometimes gets conflated in this discussion.

Another point, it's true Reddit doesn't need a SPA. However, while I hate their new design, at the scale of Reddit an SPA can have real effects on server costs as well as user engagement. And, if you look at their growth numbers it seems to be working out for them, despite their design churning me as a user.

Third, the ecosystem of well-built components means that even if you don't really need a SPA, using React could save you money in launching your MVP, which is a big consideration for startups.

In the end, widgets with lower-latency interactivity, even when not absolutely necessary, is a better experience (for example, a form field that tells you what's wrong with your password as you're typing). Also, because the SPA crowd are building richer applications, you're going to have access to richer open-source widgets when building with that technology. So it's a hard thing to ask people to avoid React when it could be the difference between a great user experience and a mediocre one down the line.

Let's just continue to build better SSR tools so we can have the best of both worlds. We can build tools to help developers cut JS from their app, because it's true, eventually the latency bottle-neck isn't the speed of a round-trip request with PHP but the speed of downloading and executing all that JS with your SPA.

I believe this is a loosing battle, not because of hype, but because of the business reasons for using frameworks that are capable of delivering richer widgets. We can have our cake and eat it too, instead of fighting the shift in technology.

Re:js;dr = JavaScript required; Didn’t Read. by ASalazarMX on Sunday January 17, 2021 @08:21PM (#25817175)
Our government's COVID statistics site[0] is a SPA. It doesn't need to be, it just shows tables and graphs, but these days any new page seems to needlessly be made as a sluggish SPA.

If you want to check hospital bed occupancy by state, it's 3 clicks, a 5 second spinner while it loads the results and shows the first 20 rows. It doesn't sound that bad, unless you refresh, in that case it throws you back at the landing page.

This should be a static site, but even if not, this is actually slower than a server-side rendered page. SPAs are not desktop-like when they constantly request server data, even if they hide it with slow animations and spinners.

[0] https://www.gits.igg.unam.mx/red-irag-dashboard/reviewHome

Re:js;dr = JavaScript required; Didn’t Read. by asddubs on Monday January 18, 2021 @03:06AM (#25819380)
I've found that the new SPAified paypal is also unbelievably sluggish. I'm sure this is because they're doing something dumb rather than some intrinsic quality to SPAs, but SPAs sure do make it easy to do something dumb without noticing. especially if you're developing in 0-latency environments
Re:js;dr = JavaScript required; Didn’t Read. by ASalazarMX on Monday January 18, 2021 @12:12PM (#25823911)
Yes, SPAs can easily get horribly sluggish. The Josh Hopkins University dashboard[0] has been the de facto international source on this pandemic, and man, while I'm grateful for it, it is horribly sluggish. How much power has been wasted by clients rendering the exact same map and data over and over all over the world?

Compare their approach to Worldmeters' COVID statistics page[1], which while less functional, it's very lightweight and responsive.

[0]. https://coronavirus.jhu.edu/map.html

[1]. https://www.worldometers.info/coronavirus/

Re:js;dr = JavaScript required; Didn’t Read. by xellisx on Sunday January 17, 2021 @08:53PM (#25817323)
Yeah our county covid stats are the same. Static pages would work great here, instead of having to hit the API and DB for the data, since the data is updated once a day.
Re:js;dr = JavaScript required; Didn’t Read. by midrus on Monday January 18, 2021 @03:48AM (#25819645)
> Third, the ecosystem of well-built components means that even if you don't really need a SPA, using React could save you money in launching your MVP, which is a big consideration for startups

In my experience, that ecosystem of components does not compensate the cost os having to take a thousand decisions and making an equal amount of discussions and considerations and trade/off evaluations within your team (How to do state management, what router to use, class or funcion components, do we do SSR or not? Should we use typescript? etc,etc vs just using Ruby On Rails / Symfony / etc.

> Let's just continue to build better SSR tools so we can have the best of both worlds

Yes, just adding more and more complexity to compensate what you get by default with traditional MVC seems to be the right approach (irony).

Almost none of the SPAs I've been involved in in the last 5 years, required "desktop like" interativity. All of those would have been served a lot better by more traditional approaches.

I think SPAs and in general frontend-heavy frameworks are an amazing technology, but certainly overused. Bussiness wise, it makes no sense. Most of us, building SPAs, shouldn't. Problem is, it is not trendy or hip to use RoR, and everyone wants to have fun too.

Re:js;dr = JavaScript required; Didn’t Read. by azangru on Sunday January 17, 2021 @05:20PM (#25815732)
Don't know about local, but The New York Times is server-side-rendered React, ditto The Intercept, or Latvia-based Russian media called Meduza. The Times seems to be using server-side-rendered React and graphql/apollo as well.

In 2014-2015, React was eating the world, and newspapers didn't want to get left behind.

Re:js;dr = JavaScript required; Didn’t Read. by kortilla on Sunday January 17, 2021 @09:43PM (#25817569)
>Are there really that many local newspapers using SPAs though? I feel like advertisers delivering boatloads of JS with their ads sometimes gets conflated in this discussion.

Yes, I encounter it frequently. Some slow fucking main page loads for 5 seconds with no article in sight (presumably chewing on all of the trackers, assets, whatever, but no story nonetheless). Then a spinner starts to load the article and something stutters in after another 5 seconds and I get false hope that I can start reading. Another two seconds and gdpr cookie notice pops over, then a subscribe widget, then maybe a local weather widget. Close all this shit and now read the article on half of my screen because the top half is occupied by a banner with a breaking news ticker.

> Another point, it's true Reddit doesn't need a SPA. However, while I hate their new design, at the scale of Reddit an SPA can have real effects on server costs as well as user engagement. And, if you look at their growth numbers it seems to be working out for them

I’m sure their developers smoke some pot too, but we don’t attribute that to their growth. Why would you think an SPA helps when it’s one of the most widely hated features of the site? Has it occurred to you that the growth might be happening for a different reason?

> Third, the ecosystem of well-built components means that even if you don't really need a SPA, using React could save you money in launching your MVP, which is a big consideration for startups.

The ecosystem of server side stuff is far deeper and more mature. I don’t buy this argument.

> believe this is a loosing battle, not because of hype, but because of the business reasons for using frameworks that are capable of delivering richer widgets. We can have our cake and eat it too, instead of fighting the shift in technology.

Unlikely. Once the hype dies down people will realize SPAs are like mobile apps. You don’t need them for the vast majority of use cases and their instability and general shit performance will result in punishment by the search engines to the point where people with html5+css sites will rank higher and suffocate the bloated turds.

Re:js;dr = JavaScript required; Didn’t Read. by hmottestad on Sunday January 17, 2021 @03:58PM (#25814884)
I use 3 different banks quite regularly and there is a huge difference between them. My latest bank has great interest rates but also the worst UI experience mostly due to every interaction causing a page reload. I’m very much hoping for more JS usage in the banking world to make the experience a bit smoother!
Re:js;dr = JavaScript required; Didn’t Read. by TeMPOraL on Sunday January 17, 2021 @04:51PM (#25815393)
Between my wife and I we actively use 3 different banks (until recently 4), and we've also been through a bunch of redesigns, modernizations and acquisitions. I must have used some 10 banking UIs by now, not counting mobile apps.

One thing I can tell is: they get worse over time, and the more JS they involve, the worse they end up being. I can talk a lot about the UI design itself and it won't be nice (suffice to say: it's getting worse, and it's most likely because the goal of the bank isn't to provide a productive financial management UI, but to confuse you and upsell you financial products), but beyond that, performance goes down with each iteration.

(My least favorite piece of garbage of user interfaces is the offering of IDEA Bank in Poland - an Angular.js monstrosity where every operation - like opening account history, or downloading a PDF with transaction details - seems to take 30 second to one minute on a good day. The interface itself lags a lot, starts to visibly slow down if listing more than couple dozen items - say, transaction history for the past 6 months. But showing such long lists isn't a good idea anyway, because if you scroll to the end of it, some random XHR will fire and reset the list to "last month" or something like that, because of course it's a reasonable thing to do.)

Banking pages absolutely do not have anything in them that would require "desktop like functionality". They're the poster child of the document model - their job is literally to be digitized bureaucracy. They present you with forms and respond to queries. Every interaction you want to have on a banking interface boils down to that. Request a list of this. Request details about that. Send that much money there.

Re:js;dr = JavaScript required; Didn’t Read. by Closi on Sunday January 17, 2021 @04:19PM (#25815064)
> My latest bank has great interest rates but also the worst UI experience mostly due to every interaction causing a page reload.

I think this is heavily dependent on how fast the screen refresh is. Page reloads can be quick enough to appear pretty responsive - but if the website takes 3 seconds to serve the page up that’s obviously no good.

Re:js;dr = JavaScript required; Didn’t Read. by hmottestad on Sunday January 17, 2021 @04:48PM (#25815342)
Did I forget to mention that they store the application state on the server end so the back button in your browsers doesn’t work?
Re:js;dr = JavaScript required; Didn’t Read. by ljp_206 on Sunday January 17, 2021 @04:12PM (#25815006)
> I’m very much hoping for more JS usage in the banking world to make the experience a bit smoother!

As a React developer this makes me anxious, lol.

Re:js;dr = JavaScript required; Didn’t Read. by antjanus on Sunday January 17, 2021 @04:27PM (#25815136)
Totally agree. One of the banks I bank with has a fully interactive JS application with no reloads. It's super smooth to interact with and makes the experience amazing.

I also bank with another bank that does full-page reloads and it's a huge pain. And it's frustrating when I have to do something because of how slow it is comparatively.

Re:js;dr = JavaScript required; Didn’t Read. by ehutch79 on Sunday January 17, 2021 @03:59PM (#25814895)
This is pretty spot on. The problem isn't JS, it's people turning small blogs, brochure sites, static pages, etc into SPAs
Re:js;dr = JavaScript required; Didn’t Read. by throwawayboise on Sunday January 17, 2021 @04:24PM (#25815107)
Amusingly, my local newspaper's paywall only works with JS enabled. Disable it, and you can read everything unencumbered.
Re:js;dr = JavaScript required; Didn’t Read. by pkage on Sunday January 17, 2021 @03:13PM (#25814473)
HN gets frothing mad about javascript, and to some extent I agree: sites that are fundamentally about content (news websites, blogs, etc.) should not be locked behind JS gates. The amount of code bloat on those pages tends to be related to tracking and advertising, so not running JS on those pages makes sense.

On the other hand, web applications that provide full-featured experiences are only possible because of the full spectrum of web technologies. Choosing not to run JS and claiming that Google Docs should work without JS is ridiculous.

Re:js;dr = JavaScript required; Didn’t Read. by mixmastamyk on Sunday January 17, 2021 @03:20PM (#25814537)
It’s almost as if you should pick the right tool for the job. ;-)
Re:js;dr = JavaScript required; Didn’t Read. by nicbou on Sunday January 17, 2021 @03:27PM (#25814604)
We all agree on that. I just suspect that Hacker News only knows about two jobs: massively distributed applications and their static blog.

In the middle, you have countless SPAs, but also slightly interactive websites that are 90% content, and 10% calculators/maps/widgets.

Re:js;dr = JavaScript required; Didn’t Read. by ehutch79 on Sunday January 17, 2021 @04:01PM (#25814916)
It's not like those widgets need a full routing system with ssr, etc. Even with vue, you can just drop that component on the page.
Re:js;dr = JavaScript required; Didn’t Read. by RussianCow on Sunday January 17, 2021 @04:13PM (#25815014)
But add enough of those widgets to a page, and now you need to coordinate local state, sync it with the URL, etc, which is way easier to do when the whole page is a SPA.
Re:js;dr = JavaScript required; Didn’t Read. by ehutch79 on Sunday January 17, 2021 @04:24PM (#25815104)
But at that point your site is more an application than content
Re:js;dr = JavaScript required; Didn’t Read. by RussianCow on Tuesday January 19, 2021 @12:28PM (#25835948)
It's not always so cut and dry; some content websites are very interactive.
Re:js;dr = JavaScript required; Didn’t Read. by kyawzazaw on Sunday January 17, 2021 @03:37PM (#25814689)
feel so true
Re:js;dr = JavaScript required; Didn’t Read. by resynth1943 on Sunday January 17, 2021 @03:15PM (#25814489)
Aside: outline.com is useful for news websites which require JavaScript.
Re:js;dr = JavaScript required; Didn’t Read. by dredmorbius on Monday January 18, 2021 @01:05PM (#25824605)
Many but by no means all.

I increasingly rely on either Internet Archive's Wayback Machine (which also fails remarcably often to fully, or even partially, present SPAs), or Archive.today (archive.is, archive.fo, and friends), which is painfully slow to acquire content but does manage to render most it attempts.

Re:js;dr = JavaScript required; Didn’t Read. by 4bpp on Sunday January 17, 2021 @03:34PM (#25814665)
> There's certainly some companies that are caught in the hype and build a SPA app when they would probably be better served with a simple PHP site

Yeah, like your example, Facebook. Ever since their redesign, I've switched to only using the mobile+noscript site (on desktop), because the SPA version is resource-hungry to the point that it regularly DoSes whatever browser thread it gets assigned to and has UX that, ironically, seems to be terrible as anything other than a mobile app (they've replaced text with abstract square "touchable" buttons and introduced airy spacing everywhere that allows you to see maybe about half a post per screen).

It's as if its designers have been trying to ram their mobile app down my throat for years (by nagging screens at first, and then by outright removing the ability to view private messages from the mobile page - except sometimes by refreshing sufficiently many times you could trigger a bug and still drop through to the old messenger view, adding insult to injury), and when I still didn't bite, they decided to replace the whole service (which up until then had been one of the last remaining decent mainstream websites) with a facsimile of one.

Re:js;dr = JavaScript required; Didn’t Read. by kyawzazaw on Sunday January 17, 2021 @03:40PM (#25814715)
> Yeah, like your example, Facebook. Ever since their redesign, I've switched to only using the mobile+noscript site (on desktop), because the SPA version is resource-hungry to the point that it regularly DoSes whatever browser thread it gets assigned to and has UX that, ironically, seems to be terrible as anything other than a mobile app (they've replaced text with abstract square "touchable" buttons and introduced airy spacing everywhere that allows you to see maybe about half a post per screen).

I have literally not heard of anyone complaining about this (not that your argument is invalid). A whole lot of people are just not gonna bother or check how resource intensive it is.

Re:js;dr = JavaScript required; Didn’t Read. by pmlnr on Sunday January 17, 2021 @03:43PM (#25814756)
> I have literally not heard of anyone complaining about this

EVERYONE complains about the speed of "new" (2020?) Facebook.

Re:js;dr = JavaScript required; Didn’t Read. by garmaine on Sunday January 17, 2021 @04:00PM (#25814908)
I will add my voice to the list of complainers. I stopped using Facebook after they forced me to upgrade to the new site.
Re:js;dr = JavaScript required; Didn’t Read. by HeadsUpHigh on Monday January 18, 2021 @04:26PM (#25826833)
Well you can count a second complaint here. Of course it's much smoother on Chrome.
Re:js;dr = JavaScript required; Didn’t Read. by ttt0 on Sunday January 17, 2021 @04:25PM (#25815116)
I rarely use Facebook, but can confirm too. The older version wasn't great either.
Re:js;dr = JavaScript required; Didn’t Read. by aboringusername on Sunday January 17, 2021 @03:19PM (#25814527)
> It's about making desktop-class applications more accessible via the web.

I am not sure what "web" you're using, but as someone who uses noscript and has been enabling scripts for over a year now, I can firmly say JS is NOT used for making "desktop-class applications more accessible".

It's used for ads. And spying. Lots and lots of spying.

Seriously.

Googletagmanager/analytics is everywhere, it doesn't deserve to be, it doesn't need to be. That domain needs to die a painful, horrible death.

facebook, twitter, sessioncam, and many others are used to bloat pages, increase my energy usage, decrease my battery quicker and contribute to the wastage of energy on an unprecedented scale.

Just ask yourself, how much money, battery life, bandwidth is spent every year on downloading useless scripts that as far as I can see offer no value whatsoever. By selectively deciding what scripts to enable I get the folliowing result:

1: pages are lighter, less bloated, and STILL WORK

2: I download less scripts, use less battery and save bandwidth and energy for myself and all humanity.

3: There is less spying as fetch() requests are blocked and there can be hundreds of them across a single web-page session (you can watch really bloated pages for 10 minutes, there can be 100's of requests easily).

Test: load the following two pages, study their usage, test each with JS enabled/disabled:

1: https://old.reddit.com (with JS:2.69, without: 2.34mb)

2: https://reddit.com (with JS: 8.58mb, without: 8.10kb, but the page is broken...)

Baring in mind old.reddit works fine with JS disabled, showing JS is not needed for a site like reddit to work at all.

Yet, "web developers" use them as if it's nothing. Pages that execute over seconds, possibly MB's of data, all the additional requests that are made to enrich the likes of FB/Google et al.

So no, SPA are a scam and the web is worse today than I remember back in the 2000's, at least we didn't have cookie pop up boxes because people can't help but abuse JS.

Most of the GDPR violations I've found thus far are from scripts that have no place or purpose, that slurp up user data without remorse, that, if disabled, doesn't impact the functionality of the page, and that enables the great surveillance capitalism and data-raping we are seeing today.

Re:js;dr = JavaScript required; Didn’t Read. by betenoire on Sunday January 17, 2021 @03:35PM (#25814670)
> I can firmly say JS is NOT used for making "desktop-class applications more accessible"

yes it is. It is used for ads and spying too, but to say it is "NOT" used for desktop-class apps is wrong

Re:js;dr = JavaScript required; Didn’t Read. by pmlnr on Sunday January 17, 2021 @03:36PM (#25814678)
I agree with all except for one thing:

> at least we didn't have cookie pop up boxes because people can't help but abuse JS

pop-up and pop-under banners with IE6 were BAD.

Re:js;dr = JavaScript required; Didn’t Read. by cellar_door on Sunday January 17, 2021 @03:34PM (#25814666)
Ok, so you want to disable tracking and ads.

Why does that necessitate disabling all JS? You can enjoy the performance of an SPA while selectively disabling tracking.

Re:js;dr = JavaScript required; Didn’t Read. by aboringusername on Sunday January 17, 2021 @03:43PM (#25814745)
Sadly, it's not often that simple. Giving amazon.com permissions to JS should be enough, but it requires media. or ssl-images to get basic functions to work.

Then there's the issue of [randomstring].clouldfront.com - what does this script do? Do I need it?

Often finding the right combination of scripts to enable to get one piece of functionality to work makes the whole experience painful and frustrating, often I just forget what I was trying to do and go elsewhere.

Re:js;dr = JavaScript required; Didn’t Read. by sofixa on Sunday January 17, 2021 @04:44PM (#25815295)
> Googletagmanager/analytics is everywhere, it doesn't deserve to be, it doesn't need to be

You might not care, but probably most people publishing any sort of content online want to know who visits it ( from where, mobile or web, what numbers, when, etc.). The easiest way to achieve that ( considering there's shared hosting and that most people who care about those numbers aren't the people who installed whatever software runs the site, or developed it. The average website runs wordpress ) is via Google Analytics.

Re:js;dr = JavaScript required; Didn’t Read. by threatofrain on Sunday January 17, 2021 @03:43PM (#25814742)
Web apps are more accessible because more people can build web apps and thus there are more web apps for people to access. There are still many web apps that aren't accessible because they're too hard, like for example I might say that modern frameworks don't make games easy enough and that's why we've seen far less flash-style games. You don't get to access the games that don't get created.
Re:js;dr = JavaScript required; Didn’t Read. by ori_b on Sunday January 17, 2021 @03:44PM (#25814763)
> It's not popular because it's a fad, it's not about replacing good old static websites with fancy over-engineered JS code.

Yet, in practice, this is what happens.

When turning JS off is an option, that's usually one of the biggest improvements I can make to my page surfing experience. Things load faster, ads don't expand over content, the page reflows less often as things are injected, shit doesn't autoplay, and spinners and animations don't distract. I can just read the content.

It's possible to use JS well, but I don't see it happen very often. And the unpleasantness from of abuse usually outweighs the benefits from good use.

Re:js;dr = JavaScript required; Didn’t Read. by h_anna_h on Sunday January 17, 2021 @03:19PM (#25814531)
> its servers would need to do more work

So far I have seen no evidence that this would be the case (rather, I have reasons to believe the contrary).

> and its users would have to wait longer for content.

They would actually have to wait less. Recently two of the sites that I used to use switched to react. I was able to have open literally 100s of tabs with them, each of them loading almost instantly (excluding media). Now I can barely hold 2 open and they load slowly (even if we ignore the time that it takes to load the media).

Re:js;dr = JavaScript required; Didn’t Read. by pmlnr on Sunday January 17, 2021 @03:34PM (#25814661)
> It's about making desktop-class applications more accessible via the web.

...

Go and take a look at a "desktop class application" from 10 years ago - say Photoshop 6. Compare the speed, the UI, the native look & feel.

Go to a SPA today.

Cry.

Re:js;dr = JavaScript required; Didn’t Read. by TeMPOraL on Sunday January 17, 2021 @04:59PM (#25815503)
Yup. And if you are to compare desktop-class applications from the time where desktop apps weren't just embedded webviews with what typical web SPA does (how complex is it, how much actual content), then the first thing to remember is that this scale of desktop software had its executable size measured in dozens to hundreds of kilobytes.
Re:js;dr = JavaScript required; Didn’t Read. by ehutch79 on Sunday January 17, 2021 @04:06PM (#25814958)
I think a better comparison would be a networked 'enterprise' app. Think SAP or Sage or something.
Re:js;dr = JavaScript required; Didn’t Read. by austincheney on Sunday January 17, 2021 @03:40PM (#25814716)
No, it’s a fad. Most corporate JavaScript developers cannot actually write JavaScript of their own. They need giant frameworks to do the heavy lifting and the output of such is a SPA. If you really wanted accessibility you wouldn’t complicate your life with screen reader compliance via a SPA.

To be clear a SPA is generally a front end for user input, such as a form (or series of forms) clobbered together so that a page is loaded fewer times. This a traditional web path that exchanges page traversal for interaction, often to maintain state locally. Conversely, a browser application is an application that executes in the browser without regard for data and state, such as photoshop or a spreadsheet in the browser, which aren’t concerned with any server application.

Re:js;dr = JavaScript required; Didn’t Read. by klyrs on Sunday January 17, 2021 @04:04PM (#25814945)
> It's about making desktop-class applications more accessible via the web.

The problem I see is folks unnecessarily turning their websites into desktop-class applications. It's especially popular on ecommerce sites -- today I tried to look at some lumber prices and the website had input latency measured in seconds before my phone's browser just crashed.

Re:js;dr = JavaScript required; Didn’t Read. by mlang23 on Sunday January 17, 2021 @03:51PM (#25814828)
> It's about making desktop-class applications more accessible via the web.

If we, for a second, stick to the meaning accessibility used to have, namely, usability by people with disabilities, quite the contrary is the reality. The SPA trend, "lets just move every app into the web" fuels the digital divide like nothing else. It has become harder and harder to actually use the modern web, and a lot of why that is comes down to SPA and JS.

Re:js;dr = JavaScript required; Didn’t Read. by dsego on Sunday January 17, 2021 @04:09PM (#25814984)
The current fb/messenger interface is a disaster. Transitions are slow and they still didn't get the local state right and coordinated different parts of the UI. I've stopped using messenger because of this, managed to send messages to the wrong recipient more than once because of latency in the UI.
Re:js;dr = JavaScript required; Didn’t Read. by kilburn on Monday January 18, 2021 @01:47AM (#25818949)
> Some people don't seem to understand what the whole JS SPA thing is about, and it's quite strange to me.

Most people understand the promises of SPAs, but there are several forces that play against everything you said:

- Some websites don't need a desktop experience yet they go the SPA route.

- SPAs are -in my experience- significantly harder to get right than server-rendered apps. For sites that are a good fit for "the regular old web" we are speaking about at least an order of magnitude here.

- Oftentimes it is companies/products with significant resources that embark on the SPA ordeal. This usually means that they also have several teams demanding product analytics, A/B testing and what not, and hence their sites end up loaded with random shit (gtm, analytics, optimizely, facebook pixel and the kitchen-sink).

For all these reasons, it takes an extraordinary (i.e: significantly better than average) team, from the developers all the way to management, to deliver on the SPA promise.

As a result, most SPAs suck, and hence a lot of people cultivated an aversion to them. It really is that simple.

Re:js;dr = JavaScript required; Didn’t Read. by mattl on Sunday January 17, 2021 @03:32PM (#25814640)
I don’t want to run your proprietary JavaScript on my computer.
Re:js;dr = JavaScript required; Didn’t Read. by cosmotic on Sunday January 17, 2021 @05:17PM (#25815699)
All the popular SPAs I use have awful latency. It may have been a design goal, but huge failures all around.
Re:js;dr = JavaScript required; Didn’t Read. by drinchev on Sunday January 17, 2021 @03:25PM (#25814590)
> You could certainly build Facebook as a fully server-rendered PHP app, but that would hurt Facebook's business because its servers would need to do more work and its users would have to wait longer for content.

I think they do that mostly because for the users who’ll have to download the header 100 times for each action they’ll do. Not really sure that all benefits from SPA are hidden in company costs. Mostly they are in modern tech approach.

Writing this I still agree with the article. SPA is needed when you are under authentication but publicly you can live with progressive web.

Re:js;dr = JavaScript required; Didn’t Read. by TeMPOraL on Sunday January 17, 2021 @05:02PM (#25815543)
> I think they do that mostly because for the users who’ll have to download the header 100 times for each action they’ll do.

If only they weren't deploying some changes every other day, pretty much eliminating any benefit from caching...

Re:js;dr = JavaScript required; Didn’t Read. by cellar_door on Sunday January 17, 2021 @03:26PM (#25814596)
Also, SPA and server side rendering are not mutually exclusive. Both make sense as performance optimizations depending on the context.
Re:js;dr = JavaScript required; Didn’t Read. by asddubs on Monday January 18, 2021 @03:00AM (#25819356)
IMO you can have your cake and eat it too - just offer a fallback of some sort, it's good SEO anyway. I haven't done anything in react but it's my understanding that this is actually possible to do, have react deliver an initial pre-rendered page and then still have your fancy SPA on top of it
Re:js;dr = JavaScript required; Didn’t Read. by shadowgovt on Sunday January 17, 2021 @03:22PM (#25814559)
To a first approximation, you can do all your heavy-cpu computation on the server and have the client be a close-to-dumb terminal or you can have the server do some preprocessing and the client do some postprocessing.

One spreads the load over CPUs better.

Re:js;dr = JavaScript required; Didn’t Read. by TeMPOraL on Sunday January 17, 2021 @05:35PM (#25815921)
> One spreads the load over CPUs better.

Better for companies running high-powered servers with economic benefits of scale, or for users running low-end devices? This is just dumping an externality.

Also, arguably, most performance issues of SPAs don't come from business-relevant calculations being slow. It comes from scaffolding, gratuitous, and bunch of other overhead that would not happen at all, server-side.

Re:js;dr = JavaScript required; Didn’t Read. by shadowgovt on Sunday January 17, 2021 @06:32PM (#25816389)
The end user is also often paying for bandwidth, and doing local computation locally saves that cost.
Re:js;dr = JavaScript required; Didn’t Read. by TeMPOraL on Sunday January 17, 2021 @06:40PM (#25816448)
Yet somehow all these locally-computed sites end up being much more bandwidth-demanding than old-school sites. Shouldn't be like this, but that's how it ended up working in practice.
Re:js;dr = JavaScript required; Didn’t Read. by wyager on Sunday January 17, 2021 @03:20PM (#25814538)
> Fully server-rendered frameworks are not capable of delivering low-latency desktop-class applications

Evidently, neither is JavaScript.