News for hackers. Stuff that matters.
Re:AI Is Stifling Tech Adoption by CharlieDigital on Friday February 14, 2025 @08:41AM (#43048140)
As the saying goes:

    while (React.isPopular) {
      React.isPopular = true
    }
It's actually quite sad because there are objectively better models both for performance and memory including Preact, Svelte, Vue, and of course vanilla.
Re:AI Is Stifling Tech Adoption by 9rx on Friday February 14, 2025 @09:22AM (#43048554)
But equally impressive that the Javascript community has actually managed to continue to use a single framework for more than five minutes without jumping to the next.
Re:AI Is Stifling Tech Adoption by trgn on Friday February 14, 2025 @09:39AM (#43048781)
had to have hooks though. And vanilla-OO had to go in favor of trapping state in closures, which is cooler because it has functions and not methods.
Re:AI Is Stifling Tech Adoption by Hasu on Friday February 14, 2025 @09:58AM (#43048962)
You can still use vanilla-OO React.

Do you complain when other frameworks add new features without breaking backwards compatibility?

Re:AI Is Stifling Tech Adoption by CharlieDigital on Friday February 14, 2025 @12:15PM (#43050576)

    > You can still use vanilla-OO React
What we want is signals-based React because it would singularly fix the issue that the compiler is solving for and remove the need to even have `useMemo` and `useCallback`, improve performance, and remove a huge footgun.

Because it has such a huge marketshare, a fix like this would have tremendous positive effects in web dev.

Re:AI Is Stifling Tech Adoption by trgn on Friday February 14, 2025 @11:55AM (#43050383)
I certainly did complain! And I'm sure I'll do it again if the new features aimed to supplant the old ones are worse.

If you search anything about React now, 90% of the docs are hook-based. Beginners of React in 2025 will be guided to use a default pattern which has worse runtime footprint and adds a whole suite of new tool-specific coding guidelines ("rules of hook"). After years with it, I struggle to see what it has added in terms of building front-end SPas, yet the pattern is now the default for all using React.

Re:AI Is Stifling Tech Adoption by Hasu on Friday February 14, 2025 @09:56AM (#43048937)
React is almost 12 years old and has dominated frontend development for almost a decade. I'd bet most JS backend projects still use Express as the webserver, and it's even older than React.

Can we please retire this meme? It's stale and adds nothing to the conversation.

Re:AI Is Stifling Tech Adoption by tcoff91 on Friday February 14, 2025 @10:09AM (#43049091)
Yes thanks to React we can finally retire this meme. It was very true before react became dominant though.
Re:AI Is Stifling Tech Adoption by chipgap98 on Friday February 14, 2025 @08:45AM (#43048169)
Does that really matter to most companies/developers? I’d much rather have a good enough solution with a large ecosystem built around it. It also takes a lot of investment for companies to change their tech stack
Re:AI Is Stifling Tech Adoption by CharlieDigital on Friday February 14, 2025 @08:48AM (#43048199)

    > Does that really matter to most companies/developers?
If you're asking about performance and memory, then yes, it does.

This is especially true in e-commerce where many studies have shown that overall page performance has a correlation to conversion. Add to that the fact that a lot of e-commerce has moved to mobile web, there's a strong case for picking the best performing technologies versus developer preference -- especially if AI is generating it.

But even outside of e-comm, consider government websites where you may have low income users that are using cheaper, older, lower capability devices to access information and services using lower speed networks to boot.

I do my day-to-day work on an M3 Max with 64GB RAM and fiber to the home; it's easy for developers to forget that many times, their end users can be on older devices, on low performing networks, and other factors that affect performance and usability of web applications.

    > ...with a large ecosystem built around it
When you can generate whatever you want nearly instantly, what does "ecosystem" mean? Your possibilities are endless and infinite. Your mindset is in a world where it's necessary to depend on the work of others because it's too expensive for you to write your own component library. Yes, that was true 1 year ago; why would you waste time and energy to create your own calendar component? But if an LLM can generate any bespoke component that you need in < 3 seconds, do you still need a third party component library?

In fact, you may be better off for not creating the added external dependency.

Re:AI Is Stifling Tech Adoption by nottorp on Friday February 14, 2025 @09:03AM (#43048367)
> I do my day-to-day work on an M3 Max with 64GB RAM and fiber to the home

And you still pay a few cents extra in power used because of all those inefficient and memory hungry "applications". You just don't notice.

Re:AI Is Stifling Tech Adoption by tcoff91 on Friday February 14, 2025 @10:14AM (#43049147)
If you use next.js with react server components you can get enough performance out of react for e commerce.

Also the react compiler is improving client side performance as well by automatically memo-izing everything to reduce rerenders

Re:AI Is Stifling Tech Adoption by CharlieDigital on Friday February 14, 2025 @10:16AM (#43049167)
The auto-memoization is:

1) Trading memory pressure for performance

2) An admission of a broken model because it's taken them 2+ (almost 3?) years to build as a recognition that developers can't get it right

The reason other frameworks don't need this is because they use signals connected to callbacks instead of the reactive callback pointing to the component (as React does). Thus Preact, Solid, Svelte, Vue, etc. do not have this issue and you rarely (if ever?) have to manually memoize.

The React team foot-gunned themselves and every React dev out there.

I have some examples that walk through this concept using JSFiddle so you can understand exactly why this design choice from React created this problem in the first place: https://chrlschn.dev/blog/2025/01/the-inverted-reactivity-mo...

Re:AI Is Stifling Tech Adoption by madeofpalk on Friday February 14, 2025 @09:04AM (#43048376)
So, if you're a large e-commerce company that's trying to juice out last percentage points of conversion, and are researching alternate javascript libraries, is it plausable that the only research a development team would be to ask ChatGPT?
Re:AI Is Stifling Tech Adoption by CharlieDigital on Friday February 14, 2025 @10:04AM (#43049041)
Unfortunately not the case because of GPT's bias towards React (the point of the article).
Re:AI Is Stifling Tech Adoption by SiliconSplash on Friday February 14, 2025 @09:38AM (#43048768)
> If you're asking about performance and memory, then yes, it does.

Most places just don't care. I've worked 15 years as a contractor and only in once place have the business cared about optimisation. As long as it wasn't unbearable than it was "good enough".

> This is especially true in e-commerce where many studies have shown that overall page performance has a correlation to conversion. Add to that the fact that a lot of e-commerce has moved to mobile web, there's a strong case for picking the best performing technologies versus developer preference -- especially if AI is generating it.

This may have been true back in 2014. 5G networks are pretty fast and the the mobile web is pretty bloated. Performance is way down the list of concerns typically even by places that should care. I can write blazingly fast custom JS frameworks, the number of times anyone cares is exactly one time.

> I do my day-to-day work on an M3 Max with 64GB RAM and fiber to the home; it's easy for developers to forget that many times, their end users can be on older devices, on low performing networks, and other factors that affect performance and usability of web applications.

I have a 2010 Dell E6410 with 8GB of ram and an i7 640M (Dual Core, 4 thread). Almost every modern phone is faster now.

I am not arguing we should make things bloated. I am just saying there isn't an incentive to optimise for low end devices because low end is better than a reasonably power Business Laptop of 10-15 years ago.

> why would you waste time and energy to create your own calendar component? But if an LLM can generate any bespoke component that you need in < 3 seconds, do you still need a third party component library?

The code from the LLM probably hasn't been battle tested. The open source react component library with 1000s of stars on github definitely has been. If you run into a problem with the LLM code you are probably going to be by yourself fixing it. I will take the component library over the LLM code everyday of the week.

Re:AI Is Stifling Tech Adoption by breckenedge on Friday February 14, 2025 @01:25PM (#43051419)
Have you ever worked for a place that cared about meeting CWV? Poor JS performance will definitely hurt rankings.
Re:AI Is Stifling Tech Adoption by SiliconSplash on Monday February 17, 2025 @03:44AM (#43076675)
Yes. It was one contract only and I was the lead frontend dev.

I wrote a very lightweight JS framework (it was just a few classes really) so we could have plugins. A plugin implemented was just an object that implemented an interface, I also wrote a poor man's React for two or three pages that needed to build a lot of DOM Dynamically.

At launch the site was getting basically 100 on the lighthouse tests with the gzipped CSS and JS coming it at ~80KB. Of course that lasted for a week because people will put up a huge image that hasn't been optimised for the web.

The site was fast because I wrote it like a website from mid-2000s. Everything was basic OOP and almost all the code was procedural.

Re:AI Is Stifling Tech Adoption by wrsh07 on Friday February 14, 2025 @09:30AM (#43048673)
Fwiw, I work at a saas company and we do have some performance issues. It's about 50/50 split between not using react optimally and slow backend.

If we were using svelte we would still have performance issues, but they would probably be centered more on "is the data in a sane shape such that this page can query it?"

Re:AI Is Stifling Tech Adoption by spacephysics on Friday February 14, 2025 @08:51AM (#43048236)
React has become the Java of late 90’s to mid 2000’s.

Loads of libraries, documentation, and developers which creates a flywheel that will grow those aspects over the next X years.

Until something comes up that is magnitude better in performance/maintainability, and even then it’ll take years to dethrone the status quo.

Good questions in these comments essentially asking, does the level of training data on these models now contribute to the inertia we see from libraries, documentation, developer support?

I believe so, but then again I think we’ll soon have more niche models for specific areas of development (like openart has with a variety of image gen models)

Re:AI Is Stifling Tech Adoption by marcosdumay on Friday February 14, 2025 @09:10AM (#43048437)
Most of the alternatives on the GP's comment have more than one order of magnitude better performance.

Maintainability doesn't even enter the question. React's way is to rewrite. All of the alternatives on the GP's comment are possible to maintain.

Re:AI Is Stifling Tech Adoption by tobyhinloopen on Friday February 14, 2025 @11:46AM (#43050275)
At least Java is good. React is absolutely terrible.
Re:AI Is Stifling Tech Adoption by re-thc on Friday February 14, 2025 @09:57AM (#43048948)
> React has become the Java of late 90’s to mid 2000’s.

Not comparable.

Java may not have had big releases during this time but there were patches and support. Java 8 had numerous versions (>400). You can get paid support from Sun/Oracle. In terms of frameworks Spring was constantly upgraded and supported.

React has none of these. Older React versions rarely get upgraded and just look at the amount of minor/patch releases React gets these days. It's almost as though Meta no longer cares. Earlier (<16) React was constantly updated. Nowadays it's just to peddle Vercel.

Re:AI Is Stifling Tech Adoption by ge96 on Friday February 14, 2025 @11:49AM (#43050312)
it's my goto along with NodeJS on the backend and Electron as a wrapper or React Native

NGINX for my server though recently I ran into an out of connections problem that was new on an Azure VM

Re:AI Is Stifling Tech Adoption by klysm on Friday February 14, 2025 @09:57AM (#43048954)
I think react hits a really good sweet spot in the trade off space. Sure it’s not the best thing that can exist, but it really does solve a lot of problems in a way that isn’t overly restrictive.

My personal opinion is that a lot of the hate directed at react is due to experiences with code bases that aren’t good react code.

Re:AI Is Stifling Tech Adoption by tcoff91 on Friday February 14, 2025 @10:06AM (#43049061)
React is better than all of those because of the existence of React Native, React Three Fiber, Remotion, etc…

It has the best ecosystem of libraries and it’s not even close.

If you write your web app in Vue and decide you want mobile apps later you won’t be able to share much code there.

Re:AI Is Stifling Tech Adoption by sesm on Friday February 14, 2025 @09:39AM (#43048778)
Doesn't Preact use the same model but prioritise bundle size over performance?
Re:AI Is Stifling Tech Adoption by CharlieDigital on Friday February 14, 2025 @10:13AM (#43049140)
It's not the same model.

Many, many (if not most) devs probably do not realize that React has an "inverted" model of reactivity and is in fact the root cause of it's performance woes.

To the extent that the React team spent 2+ (almost 3?) years working on a compiler to address the issue by adding in the correct memoization primitives in a compile phase (trading increased memory consumption for more runtime performance...).

I wrote about it here with code examples that work in JSFiddle: https://chrlschn.dev/blog/2025/01/the-inverted-reactivity-mo...

The short of it is that by pointing the reactive callback to the component function, it means that state within the component function has to be managed carefully. This doesn't happen in Vanilla, Preact, Solid, Svelte, and Vue because they point the reactive callback (via "signals") to a handler function that captures the component state in a closure. This is also why they are all faster and consume less memory than React.

Because React points the reactive callback to the component function, it effectively starts from a clean slate each re-render so the purpose of React Hooks is to move state out and inject them back (thus they are called "hooks") when it re-renders. In Preact, this is not the case since it uses signals: https://preactjs.com/guide/v10/signals/

A short video of the same examples if you prefer: https://youtu.be/7OhyP8H7KW0

Re:AI Is Stifling Tech Adoption by sesm on Friday February 14, 2025 @11:38AM (#43050186)
The blogpost in the first link doesn't mention Preact at all.

Preact is mostly API-compatible with React, and it having a different underlying model is an extraordinary claim that requires extraordinary evidence.

I've read the docs on Preact signals, and they look like React refs, but put outside of components.

edit: the last paragraph about refs

Re:AI Is Stifling Tech Adoption by CharlieDigital on Friday February 14, 2025 @11:54AM (#43050365)

    > ...a different underlying model is an extraordinary claim that requires extraordinary evidence
You are looking at the syntax and not the reactivity model (how it determines what functions to call when a change happens).

The post doesn't need to mention Preact because every other framework is signals-based except for React. Vue is simply the stand-in for "signals-based reactivity". Vue has different syntax from Preact (though it, too, can also use JSX), but it has the same reactivity principle.

https://preactjs.com/guide/v10/signals/

    > What makes Signals unique is that state changes automatically update components and UI in the most efficient way possible. Automatic state binding and dependency tracking allows Signals to provide excellent ergonomics and productivity while eliminating the most common state management footguns.
It uses the same underlying reactivity model as Vue, Svelte, Solid, and Qwik.

Vue docs: https://vuejs.org/guide/extras/reactivity-in-depth.html#conn...

Solid docs: https://www.solidjs.com/docs/latest/api#createsignal

Svelte: https://svelte.dev/blog/runes#Signal-boost

Qwik docs: https://qwik.dev/docs/components/state/#usesignal

In the blog post, Vue is the stand-in for signals-based reactivity. All signals-based reactivity models work the same way at a high level (their difference being primarily in their low-level DOM diff and update).

My prediction is that even React will eventually end up signals based because of TC39 Signals: https://github.com/tc39/proposal-signals

Re:AI Is Stifling Tech Adoption by sesm on Friday February 14, 2025 @12:17PM (#43050586)
Preact is not signals-based, it uses the React model with state and props as the basic model, but also provides Signals as a parallel model.
Re:AI Is Stifling Tech Adoption by CharlieDigital on Friday February 14, 2025 @12:26PM (#43050680)
I guess that's like arguing a Prius Prime isn't electric because even though it has a battery and can drive all electric, it also has a gas engine. :shrug:

But very clearly, Preact has the option of the exact same reactivity primitive and design as Vue, Solid, Qwik, and Svelte

https://preactjs.com/guide/v10/signals/

    > In Preact, when a signal is passed down through a tree as props or context, we're only passing around references to the signal. The signal can be updated without re-rendering any components, since components see the signal and not its value. This lets us skip all of the expensive rendering work and jump immediately to any components in the tree that actually access the signal's .value property.
Re:AI Is Stifling Tech Adoption by sesm on Friday February 14, 2025 @01:03PM (#43051150)
I'll accept an analogy with a hybrid car. In this analogy, Preact would be a gas car with an additional electric engine bolted on as an afterthought.
Re:AI Is Stifling Tech Adoption by CharlieDigital on Friday February 14, 2025 @01:40PM (#43051578)
But you know, the Prius Prime is a PHEV as in "plug in hybrid electric vehicle"
Re:AI Is Stifling Tech Adoption by sesm on Friday February 14, 2025 @02:09PM (#43051888)
Oh, I see what you mean now! This sounds like a very good analogy.
Re:AI Is Stifling Tech Adoption by onion2k on Friday February 14, 2025 @09:26AM (#43048615)
and of course vanilla

That depends on who is writing it and what the app is. Most frontend code is written by people who don't have as much time to focus on performance and optimization as core framework developers, so their once their apps reach a critical mass of 'actually big enough to benefit from a framework' the app is worse than it would have been if it was written with a framework in the first place.

The problem for all of us, and where frameworks often make the web suck, is that very few apps are actually that big. Frontend developers love to put React in a page that has one form input a button, which is dumb.

Re:AI Is Stifling Tech Adoption by CharlieDigital on Friday February 14, 2025 @12:33PM (#43050754)
Ostensibly, an unbiased, well-trained model would solve this because it would/could write fast, performant vanilla. As a product owner, you probably care more about the performance of the product over the specific technical implementation details.

I take that to be the point of the article: the bias towards React and of course the training data being stale means that generated code will always have a bit of staleness and as we provide less context for the AI (e.g. StackOverflow), the bias towards staleness will amplify given the large body of stale information it has ingested and amalgamated.