Live data from Hacker News

React is winning by default and slowing innovation

lorenstew.art

381–390 of 866 posts

Re: React is winning by default and slowing innovation

#381
I love this article and the pluralist worldview harking back to 2015/16. I'd love to tell my team "Hey we're going to build this small separate use case in Svelte". But the evaluation checklist, which is pretty accurate, is in direct opposition to the point being made.

Assess Performance Needs: 99% of apps are not going to notice the difference, so you choose React

Team Skills and Learning Curve: Everyone knows React, nobody knows Qwik, you choose React

Scaling and Cost of Ownership: Immaterial

Ecosystem Fit: React has the more full and stable ecosystem, you choose React

On top of all this, all the AI tools have good capability with React - defaulting to it themselves - and engineers are increasingly expected to make significant use of AI tooling.

Re: React is winning by default and slowing innovation

#382

Earlier quoted context omitted.

Agreed, Web Components don't require any framework and you can achieve everything you can achieve with React (including reactivity via attributeChangedCallback), the learning curve for Web Components is actually much less steep than React when you consider from the perspective of someone starting from scratch. Furthermore, Web Components enforce good patterns; like the fact that you can only pass strings as attribute…

> the fact that you can only pass strings as attributes This isn't true at all though. It's a lie started in the early days by React engineers that just won't die, unfortunately. Web components are objects and they can have properties and accessors like any object. The vast majority of declarative template systems like React, Lit, Vue, Angular, Svelte, Solid, etc., will declaratively set properties - which can carry…

It is true that web components can have properties and accessors like any object. But what you cant do is pass anything other than a string to a web component's attributes in the markup. I wrote a short article about this when I was investigating web components with JsPlumb a while ago:

https://jsplumbtoolkit.com/blog/2024/07/18/wrapping-data-in-...

TL;DR I ended up creating a context object and a BaseComponent that can access the context. Subclasses of the base component prefix their attributes with a colon to instruct the code to look in the context:

Re: React is winning by default and slowing innovation

#383
post #116
post #90

Earlier quoted context omitted.

React is great at solving complex problems. Not all problems are complex to begin with, and having a complex tool as default otherwise adds complexity to the project and also inflexibility to iterate quickly. This is in addition to having to maintain a relatively brittle ecosystem from past feature as well as future features but that can be true for more than one area of JavaScript or other technologies. Looking for…

I think (at least part of) the reason why React has been so successful is that is scales so well: it's actually a relatively simple tool that works well for small problems. Pair it with a Vite template or something and you can be up-and-running in minutes. But it continues working pretty well as your app gets bigger, too. But where React fails is actually in more complex scenarios. Prop drilling becomes tedious or in…

I think React can be approached a little like JavaScript at this point: just use the good parts!

In my case that means using it as a rendering library and component composer, but not for managing state or side-effects.

Re: React is winning by default and slowing innovation

#384

Web components are the way out of this trap. Every single framework that isn't React should be wholeheartedly supporting web components to make sure that they have access to a viable ecosystem of components and utilities without having to bootstrap an entire competitor to React and it's ecosystem. While a lot of people view web components as competitors to frameworks, they don't really have to be. The just define an…

> Web components are the way out of this trap. Every single framework that isn't React should be wholeheartedly supporting web components to make sure that they have access to a viable ecosystem of components and utilities without having to bootstrap an entire competitor to React and it's ecosystem.

I've been using web components using a wrapper to avoid all boilerplate. It gets me 80% of web component functionality with very little effort: https://github.com/lelanthran/ZjsComponent

Discussed on HN previously: https://news.ycombinator.com/item?id=44290315

Now this is not perfect, but there is, for me, no easier way to create and use new html components.

Re: React is winning by default and slowing innovation

#385
post #116
post #90

Earlier quoted context omitted.

React is great at solving complex problems. Not all problems are complex to begin with, and having a complex tool as default otherwise adds complexity to the project and also inflexibility to iterate quickly. This is in addition to having to maintain a relatively brittle ecosystem from past feature as well as future features but that can be true for more than one area of JavaScript or other technologies. Looking for…

I think (at least part of) the reason why React has been so successful is that is scales so well: it's actually a relatively simple tool that works well for small problems. Pair it with a Vite template or something and you can be up-and-running in minutes. But it continues working pretty well as your app gets bigger, too. But where React fails is actually in more complex scenarios. Prop drilling becomes tedious or in…

I had problems with prop drilling on early projects but since Context has been around it hasn't been an issue. Never bothered with all these state management libraries, any time someone on my team has tried to sell me on it they've never made a strong case for it over simple proper react state management. useEffect took a little getting used to - it becomes much less problematic when you learn which scenarios to use it in (fewer than you initially think). I've had to use React.memo() at times, but it's usually done in a simple optimization pass not unlike something I'd do in a backend framework.

The only time I am even aware of these problems is when I stick my head into the javascript frontend framework "scene" where everyone acts like each one of these are dealbreakers and they happen constantly all the time.

Life is actually pretty easy as a React dev, it's a well polished and at this point battle tested framework. I wish the other tools in my dev stack were as easy to deal with.

Re: React is winning by default and slowing innovation

#386

Earlier quoted context omitted.

> pedantic docs Are you referring to something in particular here? I've had my issues with the docs in the past, but I don't think I'd describe any of them being related to pedantry.

This is the most pedantic section for me, it’s just a bunch of 5 year old illustrations with 0 explaining on how React actually works behind the scenes: https://react.dev/learn/render-and-commit

Sorry, what’s the pedantic part of this? I don’t think I’m understanding what you mean by that word here.

Do you mean that the information isn’t useful? This page is explaining the process React takes when rendering, the general version of which hasn’t really changed since it was released. There are differences in things like Suspense and SSR, but it’s broadly the same. Knowing the difference between render and commit phases is important for other parts of the docs to make sense.

What sort of behind the scenes workings would you want explained here?

Re: React is winning by default and slowing innovation

#387

Earlier quoted context omitted.

I moved my entire business off React and now I don’t have to worry about tinkerers at Meta deciding to reinvent React every 2 years and tricking everyone by keeping the name again and again. Web components are fantastic. They are the real future.

https://i.imgur.com/7ITZb7d.jpeg Aren't web components a pain in the ass to use?

They could be better, but they're not nearly as difficult as people like to make them out to be.

And they come with extra benefits like no build tool required and native browser support.

Re: React is winning by default and slowing innovation

#388

Web components are the way out of this trap. Every single framework that isn't React should be wholeheartedly supporting web components to make sure that they have access to a viable ecosystem of components and utilities without having to bootstrap an entire competitor to React and it's ecosystem. While a lot of people view web components as competitors to frameworks, they don't really have to be. The just define an…

Not unless you can develop an equivalent to React Native. That's the rub here: browser tech is just way slower than what can be achieved with native code. React's primary value (now) is deduping GUI development across platforms.

Not only that.

My main problem with web components that you end up with a build step anyway.

Not every component is interactive and relies on JS, some are just static elements (say avatar image) that you wanna render right away (but at the same time keep styles and logic scoped). Declarative shadow DOM helps, but you end up with a bunch of duplicate code in your final output, which begs the question - why am I using web components at all.

Re: React is winning by default and slowing innovation

#389
>> virtual DOM was a clever solution for 2013’s problems

I'm not a front end expert but, I'm wondering, did anything really change since 2013 that renders the virtual DOM unnecessary? Or was it always unnecessary and people just eventually figured that out?

Re: React is winning by default and slowing innovation

#390

This is mostly just a complaint about how good React is. It's so good that it's difficult for the technical benefits of alternatives to outweigh the social benefits of choosing React. Note that this is neither a major compliment to React's technical merits nor a criticism of React's competitors. In fact, I don't even disagree with the author on some of his claims, such as: > React is no longer winning by technical me…

I have been a part of quite a few tech stack decisions at various companies and startups. I have literally never heard an argument made for react that included merits of the framework itself. The decision was always based on a combination for familiarity, ability to hire for eng roles, and the ecosystem.

Then why dont you pick jquery?

Its easy and well known, even now.

The answer I see is that react is technically good enough.

Using boring technology doesnt mean using the technically most advanced thing.

It means picking something safe and stable.

Post reply on HN