by jwr · 1y ago · 0 comments
I have a Clojure/ClojureScript app using React that I've been maintaining for the last 10 years. I don't use all the features of React, in fact I could probably use a much smaller library — the biggest advantage is that it provides a "re-render the UI based on app state change" model that fits Clojure very well. But I'm very happy that React is there and that it's been maintained with relatively little code rewriting necessary over the years.
Has this ever really been the case in the past 10 years?
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.
Have you tried building anything with Vue or Svelte recently?
Can you provide some concrete issues you ran into beyond them being “bizarro”?
Its gotten so bad that when I read FE dev I interpret it as "React Dev".
Its very hard to keep up with the frequent changes to programming models, new frameworks, CSS libraries (why the heck are they soo many?!) when you also have to design O(Log n) backends, IaC, Observability, LLMOps, etc.
I have come to a compromise and have started advocating for React/Redux/TS/NextJS as the default CRUD application stack so that I can focus on solving real CS problems in the backend that I’m passionate about.
Why? How?
>> but I'm sure people thought similar thoughts when jquery or angular were popular
I loved jQuery back in the day, and it helped bringing some native APIs to life thanks to its popularity.
Says who? There are plenty of choices: vanilla, Lit, Vue, Svelte, Angular, Riot, etc. Some of the alternatives are very good.
backwards compatibility is underrated
IMO a better description than “one of the frameworks requiring regular updates” would be “an old, stable framework that adds new features every 5 years or so without breaking changes.”
As it turns out you shouldn't use them because they were essentially deprecated a long time ago. But in terms of comparing the merits in a more theoretical sense, there are simply tradeoffs between the two.
You don't need React for this. Vanilla JS is all you need, along with JSX and Web Components. If you are wondering how maintainable that would be see this example: https://github.com/wisercoder/eureka/tree/master/webapp/Clie...