Remix.run Logo
carshodev 6 hours ago

This title is very misleading, it should be "Why React is not compatible with long-term performance goals"

And I do agree generally. React uses an outdated rendering method that has now been surpassed by many better frameworks. Svelte/Sveltekit, Vue, and Qwik are the best examples.

People relying on bloated React packages is obviously not great but that is nothing to do with javascript itself.

The JS engines are all relatively fast now. And the document model of the current web provides major accessibility to both humans and search tools like SEO and GEO. JS is not my favorite language. I would rather the web was based on a statically typed language that had better error handling practices like Go. But this will most likely not happen any time soon as it would require every level of the ecosystem to adapt. Browsers, Frameworks, Developers etc.

Google would have to take the lead and implement this in chrome then enough developers would have to build sites using it and force safari and firefox to comply. It just isn't feasible.

If you want faster webapps just switch to sveltekit or vue or qwik. But often the ones choosing the framework for the project have not written much code in years, they know react is as safe option and used by everyone else so they follow along, if it gets slow its a "bug" causing it as they built apps that were "good enough" before using it.

socalgal2 5 hours ago | parent | next [-]

> Google would have to take the lead and implement this in chrome then enough developers would have to build sites using it and force safari and firefox to comply. It just isn't feasible.

They already tried. It was called Dart and for a while there was an experimental flag to enable it directly in Chrome. It was cancelled and Dart was relegated to transpiling to JS/WASM.

pjmlp 2 hours ago | parent [-]

There was a complete fork to support it, Dartium.

https://chromium.googlesource.com/dart/dartium/src/

Dart is only around because it was rescued by AdWords team, which had just migrated from GWT into AngularDart, and wasn't happy to do yet another transition.

Most of the key names from Smalltalk/Self background that were part of Dart 1.0 left the team at this point.

It managed to stay around long enough to get the attention of the Flutter team, originally their prototype was done in JavaScript, which is also the reason why Dart 2.0 was a complete reboot of its type system, from dynamically typed with optional typing, to strongly typed language with type inference.

And it isn't as if Flutter is a great success, Fuchsia never made it big, the Android team counter attacked with Kotlin's adoption, JetPack Compose, and Kotlin Multiplatform.

wiseowise 6 minutes ago | parent [-]

> JetPack Compose, and Kotlin Multiplatform

More like JetBrains dragged Google kicking and screaming into multiplatform, given how piece of a shit setup is.

hinkley 6 hours ago | parent | prev | next [-]

The reason I'm a backend dev at the moment is that I looked at the React model and decided I didn't want anything to do with this insanity.

I've been appalled by how long and how broadly the mass hysteria lasted.

carshodev 6 hours ago | parent | next [-]

And what's crazy is with ai the percentage of apps developed using react in comparison to all other frameworks has INCREASED over the last 3 years.

It is truly mass hysteria, I would say that 95% of developers, project managers, and CTOs do not truly understand how these systems work under the hood, or at the very least are too scared and comfortable to try other systems. They just repeat the same things they hear and tell each other "react has a big ecosystem" "react is industry standard" "everyone uses react" "react was developed by facebook" "we will use react" "Developers only know react, how could we hire for a different framework?"

In my mind its clear that the alternatives are massively better. When i visit certain websites I often get a random tingle that it uses svelte because its way faster and has better loading and navigation than other sites and when i check the devtools I'm almost always correct.

I also get the same feeling sometimes when I hit a laggy slow webapp and I open the devtools and clearly see its a nextjs app.

A dev team could be trained on svelte or vue in literally 3 days, and so long as they actually understand how HTML, JS, and css work under the hood they would increase their speed massively. People just don't want to take the risk.

pjmlp 2 hours ago | parent | next [-]

It is very hard to avoid when you have Vercel doing partnerships with SaaS cloud providers that end up supporting only React and Next.js on their SDKs.

Even if other programming stacks are supported, they tend to be 2nd or 3rd class versus anything React.

Look into the ecosystem of headless products that have jumped into the whole MACH architecture hype cycle.

Then you have to justify to upper management, and partner support when problems arise why you are not using their SDK.

likium an hour ago | parent | prev | next [-]

There's 3x more React libraries and code out there to reference. AI agents do _a lot_ better with React than, say, SolidJS. So productivity > performance is a tradeoff that many companies seem to happily take.

Cthulhu_ 2 hours ago | parent | prev | next [-]

To add, the other dominant force is Angular, very popular in enterprise settings. I don't understand why per se, it's very... verbose, every component needing a number of files. It (and also React) gets worse if you add a state system like RxJS.

My theory is that it's popular with back-end / OOP / Java / C# developers, because they're used to that kind of boilerplate and the boilerplate / number of files / separation of concerns gives them comfort and makes it "feel" good.

But also, like React, it's easier to find developers for it, and on a higher level this is more important than runtime performance etc. And continuity beats performance.

(I can't speak of its runtime performance or bundle size though)

koakuma-chan 3 hours ago | parent | prev [-]

People have no idea who they are hiring, so they hire people who have no idea what they are doing.

mentalgear 2 hours ago | parent [-]

> they actually understand how HTML, JS, and css work under the hood they would increase their speed massively.

Indeed, Svelte is built directly on web standards so knowing it strengthens your command of core JS and the web-platform itself - not just a silo-specific layer like React.

Also Svelte acts as a compiler: it outputs just clean, highly optimized JavaScript with no virtual DOM, that uses native web-APIs and results in minimal runtime overhead, smaller bundle sizes and overall excellent performance and DX.

DanHulton 6 hours ago | parent | prev | next [-]

I managed to avoid learning React long enough to become a manager.

I'm not saying I won't ever end up in engineering and won't ever have to learn it, but at least right now, it feels kinda like I got away with something.

pjmlp 2 hours ago | parent | prev [-]

Unfortunely it is hard to avoid when doing backed development with SaaS, iPaaS products, where JavaScript is in many cases the only extension language for backend widgets.

I am kind of alright with Next.js, as it is quite similar to using SSR with more tradicionla backend stacks.

Also at least node's C++ AddOns give me an excuse to occasionally throw C++ into the mix.

kumarvvr 6 hours ago | parent | prev | next [-]

Do you consider Angular to have a better rendering system? Or is it similar to React?

Asking because I use Angular and want to learn other frameworks in case Angular is just as bad for long term.

carshodev 6 hours ago | parent | next [-]

I analyzed all the major frameworks years ago and went with Svelte when svelte 5 came out. It is all I use now, the development team is highly responsive and cooperative with the community, the founder Rich Harris has a pragmatic approach and tries to keep it as compatible with html/js while still providing great DX and massive efficiency. It natively supports serverside rendering that turns into a SPA once it hits the browser.

Angular is probably more efficient than react but The DX is going to be worse than svelte or vue.

If you want the fastest apps in environments with low ping then use Qwik.

If you want the best overall experience, great customizability, compatability with any js package, great efficiency in most situations, and a great developer experience just go with Svelte (or vue maybe).

Angular might be fine, I don't know. I never used it extensively. But I do know that svelte is the only framework that I like using now.

epolanski 29 minutes ago | parent | prev | next [-]

Angular uses directives for rendering, that allows compilers to optimize rendering.

React model uses plain JavaScript expressions which are harder to optimize.

NamlchakKhandro 4 hours ago | parent | prev [-]

Do some research, experiment. Make up your own mind.

Cthulhu_ 2 hours ago | parent [-]

Asking people / reading opinions on the internet is part of research though.

cyberax an hour ago | parent | prev | next [-]

> React uses an outdated rendering method that has now been surpassed by many better frameworks. Svelte/Sveltekit, Vue, and Qwik are the best examples.

I strongly disagree with this. Svelte/Solid/Vue all become a twisted mess eventually. And by "eventually" I mean "very very soon".

The idea to use proxies and automatic dependency discovery looks good from the outside, but it easily leads to models that have random hidden interdependencies.

React's rendering model is simplistic ("just render everything and then diff the nodes"), but it's comprehensible and magic-less. Everything is explicit, with only contexts/providers providing any "spooky action at a distance".

And the recent React versions with Suspense neatly add the missing parts for async query/effects integration.

> If you want faster webapps just switch to sveltekit or vue or qwik.

If you want even worse webapps then switch to Vue and forgo being able to ever maintain them.

pjmlp 2 hours ago | parent | prev | next [-]

I keep enjoying SSR with Java and .NET frameworks as much as possible since the 2000's, no need for Go alone.

React is alright, when packaged as part of Next.js, which basically looks like React, while in practice it is SSR with JavaScript.

slopinthebag 17 minutes ago | parent | prev [-]

React's model is fine, it's just the wrong language. React implemented in Rust for example can be much faster, although you pay the cost differently for wasm <-> js communication.