AngularJS was pretty popular at the time, Angular 2 migration was looming, backbone still existed, jQuery (standalone or paired with both) was going strong, Polymer hit 1.0 and it looked like Web Components might actually be something and useful, React was gaining a lot of popularity, Vue was gaining a small amount of popularity, svelte an even smaller amount, Meteor was somewhat popular and had its own front end library.
Of course in addition to all that, traditional server rendered sites were more popular then than now and there were even more options there.
However, React quickly became pretty much the default. Not that there's 0 churn there. The "right way" to do React has changed quite a bit in the last decade. And early on before all the libs people liked to glue together somewhat matured/settled it was common to have to replace stuff that just got abandoned.
More than once I had to pick up someone's old unmaintained project to do a bug fix only to find I couldn't even get the project to install/run because it was in the pre auto lock file era and nobody ever ran `npm shrinkwrap`
It is absolutely true that companies were rushing to rewrite their code every few years when the new shiny JS library or framework came out. I was there for it. There was a quick transition from [nothing / mootools?] to jQuery to Backbone to React, with a short Angular detour about 13 years ago. If you had experience with the "new" framework you could pretty much get a front-end gig anywhere with little friction. I rewrote many codebases across multiple companies to Backbone during that time per the request of engineering management.
Now, is React underappreciated? In the past 10 years or so I've started to see a pattern of lack of appreciation for what it brings to the table and the problems it solved. It is used near universally because it was such a drastic improvement over previous options that it was instantly adopted. But as we know, adoption does not mean appreciation.
> React is used near universally, despite there being alternatives that are better in almost every way.
Good example of under-appreciation.
However 0 of the typescript projects (front and back end) I've worked one (unless I was there when they started) used strict mode so the Typescript support was effectively wasted.
I agree that there was a period where many organizations did rewrite their apps from scratch, many of them switching to React, but I think very few did it ”every couple of years”, and I think very few are doing it at all today (at least not because of hype - of course there might always be other reasons you do a big rewrite). We should not confuse excitement about new technologies for widespread adoption, especially not in replacing existing code in working codebases.
> despite there being alternatives that are better in almost every way.
This right here is the under appreciation. The new way to signal to others on forums that you are a really really great dev seems to be to bring up how much better some bizarro templating engine that abuses a niche JS language feature is.
- horrible performance characteristics
- needless complexity
These are not tradeoffs, these are bugs. We don't gain anything from them.
That's why React introduced a compiler. Because problem 1 is a big deal. But it's not a code problem, it's a React problem. Other tools simply do not have that bug. Which is why the exact same react code can be compiled and run much faster.
More importantly, I don't have a React performance problem. I don't really need "much faster".
Sure, but ultimately you're using a library with performance bugs that lead to orders of magnitude more rendering than necessary.
If you don't mind the buggy software, that's fine. It's still buggy.
If I learn Vue's templating language, then I'm spending my time learning a system with no wider applicability, a much narrower tooling space, that doesn't utilise my previous or future experience from JS. That's not a good calculus for me.
Vanilla
<script>
const form = document.getElementById("form");
form.addEventListener("submit", event => event.preventDefault())
</script>
<form id="form">...</form>
React <form onSubmit={event => event.preventDefault()}>...</form>
Vue <form @submit.prevent="onSubmit">...</form>
React's API has guided the developer to learn about events. If they move outside the React ecosystem they have transferable knowledge. As someone unfamiliar with React, but used to the DOM you're surely comfortable here. Yes, the syntax isn't identical to how you might use this in vanilla JS, but it's clearly the same concept. It's just been made a little nicer to use - the sugar.Vue's API has reinvented the wheel. There's one place this syntax is useful and one place alone - Vue itself. It hasn't used my existing knowledge, or pushed me to become more familiar with the platform upon which I'm building. That's not sugar, that's a new language.
I've probably got the vanilla example wrong - when you don't do it frequently it's not the most ergonomic thing in the world. React takes that API, doesn't deviate far from it, and makes it easier to use. Sugar.
The .prevent modifier in Vue is completely optional, you can call .preventDefault() yourself. Note that React also uses a kind of modifier but only for capturing events (onClickCapture etc). It does not have any way that I know to add a passive event, for some reason.
Vue is the one that actually offers syntax sugar, and does so much more consistently, with the semantics identical to the browser. React changes the semantics for unclear, historical reasons, and then adds half-baked syntax sugar on top.
Have you tried building anything with Vue or Svelte recently?
Can you provide some concrete issues you ran into beyond them being “bizarro”?
<script>
let numbers = $state([1, 2, 3, 4]);
function addNumber() {
numbers.push(numbers.length + 1);
}
const sum = numbers.reduce((x, y) => x + y, 0);
</script>
<p>{numbers.join(' + ')} = {sum}</p>
<button onclick={addNumber}>
Add a number
</button>