Live data from Hacker News

React is winning by default and slowing innovation

lorenstew.art

321–330 of 866 posts

Re: React is winning by default and slowing innovation

#321
post #304

I've used React, Vue, Svelte and Solid. React is my far my least favourite of the four. Both before and after they added hooks, all the major API calls seem to have been designed for least intuitiveness. I really wish something else had won.

Which is your favorite, and why? :-)

No OP, but I've also used Angular, React, Vue, Solid and Svelte in real world projects and my default choice is Vue, because it's on par with Solid and Svelte (and with Vue Vapor those three are basically the same) but with the larger ecosystem (vuerouter, vueuse, nuxt, nuxt-ui, primevue, nuxt-content, ...). I must also say that React was by far the most unpleasant and unproductive to use.

Re: React is winning by default and slowing innovation

#322
post #314

Earlier quoted context omitted.

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.

Im not sure how this is a negative merit for React. Besides if you are a small company, or a start up, your job is to get things done. Not to embark on a global technology crusade to push your favourite tech. By and large the best thing about react is the overall ecosystem, libraries, talent and ubiquitousness. And thats a good thing.

It isn't necessarily a bad thing, but it doesn't align with the idea of how good react is or the technical merits of it.

I also am not saying teams I have been on that picked react made the wrong choice. That's all in context and as you said startups are often in the "get things done" mentality where tech debt won't matter if you can't survive long enough for it to matter.

Re: React is winning by default and slowing innovation

#323

Earlier quoted context omitted.

React DX is hot garbage. Words cannot express how much I LOATHE hook rules. Coming from a Solid JS background, where reactive primitives are just Javascript functions... I groan every single time I run into (yet another) hook rule. I have to conditionally render empty fragments because React can't handle conditional hooks. It's the stupidest thing ever. "Oh hey let me allocate memory for this hook that will almost ce…

> I groan every single time I run into (yet another) hook rule. There are only two rules: 1. Only call Hooks at the top level 2. Only call Hooks from React functions Per https://react.dev/reference/rules/rules-of-hooks Not sure I understand the conditional beef, perhaps you can give example? I would assume if you want `if condition, useEffect(...)` you could simply replace with `useEffect(() => if condition...)`, no?

Fair. My bitching would've been better expressed as "I groan every single time I attempt to violate a hook rule." Which is a lot, because I'm new to React. It's almost certainly a "skill issue", but hooks are NOT just "JavaScript functions", contrary to React marketing PR.

My conditional beef: in my app, users can choose between using the built-in mic for speech recognition or a 3rd party service (LiveKit). If the user chooses the built-in mic, I still must allocate memory for LiveKit's services because it's exposed as a hook, even if the user will never use it. This problem compounds - every option that I expose that uses a hook requires that I allocate memory for an option that may never be used. Also TTS - users can choose to use the phone's TTS, or a remote service, etc. Every option I offer, if the library exposes it as a hook (and they virtually always do), if I naively implement the feature, allocates memory for a hook that might never be used.

Fuck. React. Hooks.

My workaround is to conditionally render empty fragments. These fragments wrap hooks, which I then inject into the context. This makes it so I can conditionally run hooks. This is why I complained that React can handle conditional components, but not hooks. Concretely: https://pastebin.com/sjc3vXTd I'm using Zustand because god I need a lifecycle outside of React.

Y'know how people complain about how Async "colors" functions? Hooks are also a type of function coloring. And they don't compose with Async.

Re: React is winning by default and slowing innovation

#324

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…

Strong disagree. Web Components are react in different clothing. You don’t need this component-based framework style architecture to write applications for the browser. I promise writing applications for the browsers is not challenging. You don’t need big frameworks or component madness that’s more of the same.

HARD AGREE!

It just takes the minimal amount of discipline, and some conventions. I know it can be done because I did it, lots of people did it just a few years ago (some of those apps are STILL running today.)

Re: React is winning by default and slowing innovation

#325

Earlier quoted context omitted.

Strong disagree. Web Components are react in different clothing. You don’t need this component-based framework style architecture to write applications for the browser. I promise writing applications for the browsers is not challenging. You don’t need big frameworks or component madness that’s more of the same.

Sure you can make a blog without a framework. But for complex applications it’s far better/easier than raw DOM manipulation or rolling your own thing.

I disagree. It’s actually the same effort either way, but one of those costs substantially more to maintain and performs far slower.

Re: React is winning by default and slowing innovation

#326

What about Vue? How popular/good is it, in comparison to React?

It's quite an oversight of the author did not to include Vue. Vue has it all and is as of now in terms of DX, features, ecosystem and performance (with upcoming Vue Vapor mode basically the same as Solid and Vue) the best choice.

Re: React is winning by default and slowing innovation

#327
There are no alternatives that are 3x better than react. That’s the minimum it will take to change the ecosystem default. React is good enough for most applications.

Is that slowing innovation? Vercel’s rsc push is definitely headwinds. But IDK, I see lots of interesting libraries around state mgmt & local-first primitive. I’d like to see more focus on SSG and islands architecture. I think bun 1.3 (bake) will be a healthy alternative to next. Ultimately the basic work of building frontends will become more componentized, so it’d be cool to see more interoperability with web component standards.

Re: React is winning by default and slowing innovation

#329
post #152

Earlier quoted context omitted.

Honestly I think React DX kinda sucks, at least in some areas. Performance is one of the worst (`useMemo` and `componentShouldUpdate` are way to easy to ignore, constant re-renders are the norm and writing performant React code requires conscious effort to avoid footguns) but it's also just less self-explanatory than the alternatives I've tried. I started doing web dev before reactivity frameworks were a thing, and I…

I think you've nailed it. It does come down to user preference. React _is_ a whole new way of thinking. Back in the days of jQuery it was very painful to stitch together web experience across HTML+CSS+JS. jquery provided much needed DX around utilities to navigate across these pieces. But it was still way too easy to treat HTML like your database and model user-state across a Frankenstein of server, json, html, and j…

You are correct. JSX is not “just HTML”. It’s “just interleaved HTML and JavaScript”.

`v-bind:id` and `@click.prevent` are something else. There is nothing like this in JSX. It’s not HTML. It’s not JavaScript. It’s some other language.

Re: React is winning by default and slowing innovation

#330

Earlier quoted context omitted.

Webapps were a mistake :(

Almost all phone apps could be a web app

A great native app on an iPhone feels far superior to a mobile website. The gestures, the stack navigator, haptics, scrolling, native ui primitives, etc…

Also iOS accessibility screen reader APIs are way better than the web. Accessibility actions for instance are great.

Post reply on HN