Live data from Hacker News

React is winning by default and slowing innovation

lorenstew.art

661–670 of 866 posts

Re: React is winning by default and slowing innovation

#661
post #558

Earlier quoted context omitted.

What code are you using to reactively render state? Or do you write all DOM manipulations manually and just accept the problem of state explosion ?

Here is an example: /lib/dashboard/dashboard_script.ts https://github.com/prettydiff/webserver When you aren’t using framework like components state restoration is a single function that runs only on page load. There is no state explosion and on localhost the SPA fully renders and finishes state restoration in about 105ms from http request.

Thanks, but this is a server-side thing and has nothing to do with client-side DOM manipulation?! Sure, you can put stuff on the server and do HTTP over the wire. It's oftentimes the better solution. But there are apps/tools that are rightfully an SPA (like tldraw or excalidraw for example) and can run local-first and offline in a browser. You build the entire app in JS and you'd need a bit more than vanilla Web components for that if you want to avoid client-side state explosion.

Re: React is winning by default and slowing innovation

#662
I am fan of experimenting with different front end tooling, but when I was looking for a job a few years ago, I was explicitly told by one employer that I would have gotten the job if I had a couple of more years experience with react. And the interview wasn't even focused on react, it was mostly js and front end fundamentals.

Re: React is winning by default and slowing innovation

#663

Earlier quoted context omitted.

If React implodes because of bad architectural decisions, Vite should fork it. It's crazy that the best React DX is provided through Vue's community projects.

Why don’t we just switch over to Vue? If DX is such a driver for deciding to use a web framework, Vue kicks React’s ass, and that’s just objectively speaking.

One of the greatest things of the Vue community is that they are not dogmatic about a technology choice. They welcome everyone, and proof of that is that they are building tooling that benefit everyone not only their community. So, we can switch over to Vue whenever we want. I personally prefer React and I'm super grateful of Vite and their ecosystem.

Re: React is winning by default and slowing innovation

#664
post #540

Earlier quoted context omitted.

> 5 straightforward hooks `useEffect` is straightforward? Cloudflare recently (like, literally 4 days ago)[1] had a pretty big outage because of the improper use of `useEffect` (surprise, surprise, it was the dependency array), a hook so infamous if you search "When should I use `useEffect`" you'll get approximately 9 trillion hits, with nearly all of them telling you something different, including Dan Abramov himsel…

Well, that is really embarrassing for Cloudflare... A recursion in a side-effect via dependencies is a rookie mistake, it's hard to imagine it could slip into production with a proper due process. Maybe they should stop vibe-coding and deploying things to production without any tests or review?

As a rookie with gray hair I completely agree :)

Re: React is winning by default and slowing innovation

#665

Earlier quoted context omitted.

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.

I keep reading unpleasant without any arguments. React is simple by nature, what made it unpleasant and unproductive? Granted I mostly do work on Shopify apps, so most of the heavy work has been done for me, I just put components together. This works fine, and I'd rather do this in React than e.g. Angular due to the small scale of the apps. Then again web components would've also been fine.

Not ultra experienced with react, but I have shot myself in the foot just because the way react is made compared to other frameworks:

- infinite loop due to re-rendering on the render function (it happens every single time i come back to react) - using useEffect when not required - nested object updates (dunno if this is still an issue) - class vs whatever the name is (className?)

Overall as another comment said I feel more fighting against react pitfalls than focusing on my application's logic. That really takes a toll in productivity as part of your brain loses a small portion of 'RAM'/cognitive load as you need to make an active effort to not shoot yourself in the foot. I guess most people get used to it, but for me it just never clicks knowing there are similarly performant frameworks with way more friendly APIs.

Re: React is winning by default and slowing innovation

#666
post #86

I feel this with every fiber of my being. I used to do a TON of front-end work, some of it quite cutting edge, delivering highly performant user experiences in the browser that had previously been only thought possible in a native app. Back in like 2009-2015. I was deeply connected with the web standards fundamentals and how to leverage them mostly directly. I detoured into heavier focus on backend work for quite a w…

> Yet I still have to begrudgingly use React in several contexts because of the industry-wide inertia, and I really wish I didn't have to. I think you'll find a lot of people begrudgingly have to work and really wish they didn't have to. That means using what they know, which means React. Which I totally get. People want to spend time with their kids, hobbies etc. Worst case, they might be caring for others, like the…

I feel like you derailed the point made. It was not about having to work at all, but about what tools to work with.

Re: React is winning by default and slowing innovation

#668
post #37
post #6

> React didn’t win purely on technical merit A sentence written by someone who clearly hasn't worked on a large Angular 1.x project.

Yes, this is probably the wrongest statement. When React was launched, it was one in a pool of thousands of web frameworks. For any axis you want to claim that React won by "default", there was another framework that dominated React in that axis and lost anyways. Some frameworks had more resources and lost (Angular), some of which were more popular and lost (jQuery, Backbone), and some of which were even more hyped t…

> some of which were more popular and lost (jQuery, Backbone)

Don't forget about having a migration path. I don't know how common it was (or how messy it might be, I never did this myself), but before Redux became popular, people were using Backbone models as the datastore for React. So existing Backbone-based apps had a way to piecemeal migrate to React.

Re: React is winning by default and slowing innovation

#669
post #558

Earlier quoted context omitted.

What code are you using to reactively render state? Or do you write all DOM manipulations manually and just accept the problem of state explosion ?

Here is an example: /lib/dashboard/dashboard_script.ts https://github.com/prettydiff/webserver When you aren’t using framework like components state restoration is a single function that runs only on page load. There is no state explosion and on localhost the SPA fully renders and finishes state restoration in about 105ms from http request.

Mate, if you are proud and happy to code this way, congratulations. That code is an absolute nightmare tho. Your eyes are trained on it so you think this is as good as an ergonomic framework.

Re: React is winning by default and slowing innovation

#670

I am fan of experimenting with different front end tooling, but when I was looking for a job a few years ago, I was explicitly told by one employer that I would have gotten the job if I had a couple of more years experience with react. And the interview wasn't even focused on react, it was mostly js and front end fundamentals.

I think I know why. We are using Blazor at my job, and everyone who worked on it before I was on the project was new to it. Recently they had us rework the front-end visually, so one of the senior developers took it upon herself to take full advantage and restructure the logic, it looks more like what I expect a React application to look like, and what I had hoped Blazor applications would look like structure wise. The best analogy I can come up with is think early 2000s PHP vs the most beautifully done OOP project you've ever seen or worked on, where everything is reasonably reusable.

If you can't look at a front-end component and grab the code, and pop it in literally anywhere else on your website, then you are doing React wrong, component driven development is insanely the best part of React that I dont know if people talk more about (I have not done React in a while).

Post reply on HN