I think my answer should answer your second question: This kind of complexity is actually needed on some apps but these apps are a minority.
Programmers love shiny new things and most managers aren't technically competent enough to lease them...
I think my answer should answer your second question: This kind of complexity is actually needed on some apps but these apps are a minority.
Programmers love shiny new things and most managers aren't technically competent enough to lease them...
I disagree with this. Almost all front-end projects I've worked on in the last 10 years or so have had some requirement that made pulling in react a better choice than trying to push back on business and/or get buy in to do everything server side. Providing users the kind of tighter feedback loops for their workflows is only possible with JavaScript.
But that's not the same as taking on a trendy library (e.g., React) and associated tooling...unnecessarily.
Like 30% of pages just give me something along the lines of "enable js to make this site work"
This is not why half the internet is borderline unusable. React will happily do a full page render in under a second (including network load time). The primary reasons for that are:
1. People writing code that does many network requests in series. 5-10 seems to be not uncommon for many apps.
2. Adverts and as SDKs.
The app I inherited at my last job was a huge 2MB bundle (due to including both the firebase SDK and a large charting library), which I assumed was the cause of the slowness (it was taking ~3-4 seconds to load). But it turned out that was serial network requests that were slowing it down. The app is still 2MB (we made good progress on removing firebase, but hadn't quite gotten there when I left) but it now loads in around a second.
React is a small library that loads quickly for most people.
It does make some sense. People used to use jquery exactly that way, and react provides an even better interface for ajax. I wouldn't be surprised if most of the usage of react is there just because people don't want to query their servers by hand.
how does react provide an interface for ajax? react does literally no calls at all...
I feel like 50% of the people complaining in this thread have never touched react or their last interaction with frontend code was jquery 15 years ago and they're still carrying those learned paradigms around and applying them to every new framework/ frontend lib they come across
> react is the only way this new crop of devs knows how to do DOM stuff with server side effects
DOM stuff with server side effects, they think they need react to do dynamic DOM stuff, especially if that dynamic DOM stuff affects server side state. So this isn't just about AJAX
I'd argue "Wiring it up well" is a task better suited for these vetted and highly used libraries than rolling your own code in vanilla JS.
Vanilla JS being viable on the frontend without jQuery or some wrapper probably didn't happen until HTML 5 so around 2014 by my reckoning.