Live data from Hacker News

React is holding me hostage

emnudge.dev

21–30 of 553 posts

Re: React is holding me hostage

#21
I missed it in the article. How do signals fix react's shortcomings? With signals you still have the same exact state management problem of having these crazy stateful functions. Sure you don't need to deal with the additional complexity brought about by use effect and rerenders but that's only a small part of the problem in my opinion.

I've gotten to the point where I think frontend code should just be modeled as state machines from the start. I like XState but you can use reducers too if you like.

Re: React is holding me hostage

#22
post #8

10 years with an unchanged react state model: https://reagent-project.github.io/

This kind of thing is possible because the React state model ultimately hasn't evolved too much itself; only the easily-accessible user-facing parts of it.

I've been running a mobx-react setup for 7 years. It's been thru a few syntaxes but it behaves identically. Minimal rendering, observability, I find it the most intuitive state management pattern.

Re: React is holding me hostage

#23
post #22
post #8

10 years with an unchanged react state model: https://reagent-project.github.io/

This kind of thing is possible because the React state model ultimately hasn't evolved too much itself; only the easily-accessible user-facing parts of it. I've been running a mobx-react setup for 7 years. It's been thru a few syntaxes but it behaves identically. Minimal rendering, observability, I find it the most intuitive state management pattern.

mobx looks the most reagent like state model in vanilla react.

my forever setup is here:

https://github.com/nathants/aws-gocljs

Re: React is holding me hostage

#24
Lovely read. I’ve been in TS and React land for a year now and it’s been so great but as our codebase grows I do see the walls closing in a bit. Signals are interesting, I wonder what react could look like if they supported them more natively in the library in the future.

Re: React is holding me hostage

#25
I've been feeling the same sentiment as the author.

Having worked on 3 sizable React projects now (all started before I arrived), I can only conclude that beyond a toy phase -- once you have many hands working on React and *particularly* once you start managing sizable state -- there is only pain.

The most recent case resulted in spending quite a bit of time explaining to a peer why we were experiencing an unexpected side effect and redraw and explaining how `useMemo` and `useCallback` actually need to be used [0] and made me think of Stephen King's Langoliers.

It occurred to me that "React is the new IBM" [1] It has become so dominant in the market that no one can get away from it. But that also means that it can no longer innovate. Andrew Clark's twitter post *acknowledging* that signals and fine-grained reactivity would be better for performance but that the React team doesn't care pushed me over the edge of frustration.

I think that React finds itself not too far off from where IBM was at the micro-computing revolution. IBM had become too beholden to its market and too arrogant in their own success to see their own downfall.

The traffic and feedback on the second article is an indication that there are a lot of folks out there who are really, really dissatisfied with the state of React.

[0] https://chrlschn.medium.com/8eb7bb72c87

[1] https://chrlschn.medium.com/react-is-the-new-ibm-6af2f4b04e5...

Re: React is holding me hostage

#27
I've been working on a React side project for a few months now and looking at my company's apps plus posts like this I think people just miss the point. Stuff like this:

>Things get more complicated when you start using React Context and start signalling updates in a parent component. The render cascades. Maybe one component fetches some data, some component remounts, and you run your state update again, delayed by a few seconds.

This is just doing it wrong. State should change in response to user inputs. Ultimately, React is f(newState) => UI. If that function isn't pure you're gonna have a bad time. It's hard to blame anyone though. The docs suck and most of the tutorials you find get it wrong one way or another.

That said, there's kind of a reason why functional programming isn't more popular. It can be hard to grok and there can be a significant performance overhead. There's also a reason why this sort of implicit programming isn't as popular as imperative style. It's hard to predict what the implicit behavior is and footguns abound.

Re: React is holding me hostage

#28
I used Angular pretty heavily before switching to React.

At the end of the day, they approach the problem from two different directions, solve issues in two different ways, and end up with two different sets of challenges in terms of what's easy and what's hard in them.

I've definitely written React UIs that would be easier in Angular. But I've also crashed Angular performance through the floor trying to wire up a table display with Angular update hooks. Angular makes it easier to hide state-update dependencies in a way that causes really bad thrashing to reach steady state, which I've (anecdotally, generally) found harder to do in React because doing it in React involves writing a lot more code and a lot more cross-state dependencies.

Re: React is holding me hostage

#29
post #8

10 years with an unchanged react state model: https://reagent-project.github.io/

Having used reagent, watching the React space evolve is like a bricklayer watching a constant stream of innovations around mud. Sure, you could build foundations with bricks, but why do that when you can use a fancy mold and pour mud into it? Why have clean blocks when you can have sticky, messy, dirty goop? Alas, castles and fortresses have been built with messy goop, and the amount of goop-specific tools and goop s…

Have you seen the debugging tools for goop?

I mean, they're absolutely necessary because the goop is full of insects. But so elegant!

Re: React is holding me hostage

#30
post #9

Earlier quoted context omitted.

same as "backend engineers", "database engineers" or "ai engineers" or "data scientists" we are all just primates staring at blinking lights and poking things

Yep! I’m full stack and have no clue why some people want to say frontend engineering is “less than” backend. It’s all a means to an end. The product requires both sides equally in most cases, and neither side is trivial.

If anything, what I miss from doing "backend" is the ability to just pull in whatever library I want to solve a problem.

I need a web server to work by slapping together fifteen Java libraries from thirteen different code houses and writing an absolute Shoggoth of shim code to convert between their types and classes? Sure, whatever, datacenter storage is damn near free.

I need to put code on a client machine on the internet? You'd best pick one of these date libraries, because there's no way in hell we're justifying shipping moment and Joda down the wire.

Post reply on HN