Live data from Hacker News

React is holding me hostage

emnudge.dev

211–220 of 553 posts

Re: React is holding me hostage

#211

Earlier quoted context omitted.

How is performance not important in this context? React is very sluggish when updating many elements at once, for not very large values of "many". With some regularity, I've debugged React+MobX jank issues where a bigger update, such as switching from one panel to another, takes upwards of 200ms on a mid- or low-range machine. None of this is perceptible on our beefy dev boxes, which is why I think people disregard i…

Performance of frameworks is often irrelevant for products/applications. 1. Performance is very very rarely a contributor to a product success. Users prefer more features over more performant app all the time (both directly when asked and indirectly by what products they choose). 2. Rendering/client computation speed is rarely a contributor to real and perceived performance. It's almost always the async calls - how m…

1. The obsession with measurable "product success" is part of the problem. Nobody will tell you they prefer your app because of performance, because it's not a perceptible thing your average user will notice. Features are much more important, true. You shouldn't care about performance at all for a prototype, true. But when you have an established product, not caring about the speed at all is a mistake IMO. This also has second-order effects for battery life, for example.

2. True, it depends on the type of app. For anything that is a type of "editor" - website builder, word processor-like thing, kanban board - you operate on a data model that you save in the background. Async calls are fairly unimportant for the overall feel there.

3. To me it's hard to untangle. The reigning paradigm is declarative UI, for great reason. It's so much saner than any manual updates. But this encourages a design where you don't think about what DOM updates will really happen after an action, and this is where the problem lies. A big part of it is also the DOM model and layout. In the extreme, you have a declarative UI library like ImGui which doesn't have any VDOM, it just rerenders every frame, and it's insane how quick it does it. I haven't been able to bring it to its knees, it just maintains 60FPS constantly, with a lot of frame time to spare.

4. It's not hard for me to believe this. I didn't say other frameworks are better. Could be that the whole DOM diff approach is the culprit, or the slowness of DOM updates and relayouts.

Re: React is holding me hostage

#212

Earlier quoted context omitted.

How is performance not important in this context? React is very sluggish when updating many elements at once, for not very large values of "many". With some regularity, I've debugged React+MobX jank issues where a bigger update, such as switching from one panel to another, takes upwards of 200ms on a mid- or low-range machine. None of this is perceptible on our beefy dev boxes, which is why I think people disregard i…

> the modern webapp experience is so miserable for the average person. I see this claim a lot and I'm curious what this is based on, can somebody drop some links to further reading?

Try selling React shit to corporates who have corporate malware infested Edge running on overloaded Citrix nodes or the average corporate android that was made about 3 years ago.

We still get And we actually can debug our product!

Re: React is holding me hostage

#213

Earlier quoted context omitted.

> All blow up events come from a loud and extremely small minority. But whether they are making noise or signal, does not depend on number of people! Fair, this instance is 100% noise imo. We're engineers - we should be able to judge when something is silly. > React continues to dominate others because it has corporate backing while Vue doesn't. And angular was popular for the same reason before angular 2. I have nev…

"Doesn't reinvent the wheel" they literally created a whole new language called JSX, I have 13 years writing JS and I dislike React and JSX is one of the reasons. As far I can tell reason it's picked a lot of times now it's market share, people see that is more popular than the competition so they try to learn it, creating a feedback loop that just makes it more popular.

JSX isn't a new language, it's syntactic sugar for React.createElement() or whatever other pragma you prefer (like the Preact or Vue equivalents).

Re: React is holding me hostage

#214

I'm still a React guy. I've also worked with Angular and Vue and toyed with Svelte. People tend to compare these frameworks on things that don't matter - often it's performance. We used to compare React performance to AngularJs performance too, which was meaningless. VDom is nice. Reactivity in signals is nice. Limiting rerenders is nice. But I choose frameworks because of developer ergonomics. The killer feature for…

> People tend to compare these frameworks on things that don't matter - often it's performance. Performance people get offended when they hear things like that. I imagine what they will tell a person who says something like this is to: - Look at the traces. Real metrics, on real devices that users have, not the one that developer has. - Consider either large contentful paint (will likely be subpar with client-side re…

Performance mostly matters depends on the target audience.

For example, if you have a React-based wrapper around some SAP Gateway calls to replace the standard SAP UI then the user doesn't have much say. Because of the perceived better UX. The users of the solution inside companies (think multinationals, larger government etc) your call agent that use the React-based SAP portal can't really say I am not going to use it. Hands are tight.

The only time performance really matters when you have paying customers

Re: React is holding me hostage

#215

Earlier quoted context omitted.

"Doesn't reinvent the wheel" they literally created a whole new language called JSX, I have 13 years writing JS and I dislike React and JSX is one of the reasons. As far I can tell reason it's picked a lot of times now it's market share, people see that is more popular than the competition so they try to learn it, creating a feedback loop that just makes it more popular.

I actually like JSX a lot, but I'm baffled when people act like the very thin DSL used by svelte is any more unapproachable than JSX, or like JSX is somehow more javascript when it's a mish-mash of extended HTML (don't forget to use key as needed, and className), React components, and JS (expressions only, not statements... and weird-looking ones at that)

> don't forget to use key as needed, and className

Those are part of React, not JSX itself. Compare Vue's use of JSX, for example, which just uses `class` and `for` instead of `className` and `htmlFor`.

Re: React is holding me hostage

#216

Earlier quoted context omitted.

How is performance not important in this context? React is very sluggish when updating many elements at once, for not very large values of "many". With some regularity, I've debugged React+MobX jank issues where a bigger update, such as switching from one panel to another, takes upwards of 200ms on a mid- or low-range machine. None of this is perceptible on our beefy dev boxes, which is why I think people disregard i…

> the modern webapp experience is so miserable for the average person. I see this claim a lot and I'm curious what this is based on, can somebody drop some links to further reading?

I have a beefy machine and fast internet. Yet, JIRA is annoyingly slow. Half the time, pages on my bank’s website take forever to load, or don’t load at all.

I don’t have any numbers, just some anecdotal experience like the above.

It is not just speed. The UI of many sites suck too. Amazon, GoDaddy, for example.

Then there are ads. We don’t see ads in between content anymore. It is content within ads these days.

I am thankful that we can do so much online these days. But the experience could be better

Re: React is holding me hostage

#217

I'm still a React guy. I've also worked with Angular and Vue and toyed with Svelte. People tend to compare these frameworks on things that don't matter - often it's performance. We used to compare React performance to AngularJs performance too, which was meaningless. VDom is nice. Reactivity in signals is nice. Limiting rerenders is nice. But I choose frameworks because of developer ergonomics. The killer feature for…

I don't see a problem with useEffect. It releses you from thinking about component lifecycle.

Conceptually the body of your component runs on every render. If you want to have some effect on your component not running in sync with that then you have useEffect to set it up and clean it up not when the component is mounted, unmoutend, rerendered ... just when the stuff you are interested in changes.

Re: React is holding me hostage

#218
Don't fetch data from your views!

React enables v=f(s) by making DOM updates faster. v=f(s) was always a good idea, but before vDOM, replacing the HTML of the page on every little state change was too much for the browser.

- Now you describe your views as pure functions of their inputs and stop caring about them, React cares about them. You know that with the right s, the right v will follow.

- You need to care and manage your app's state carefully, yes, and everything goes in there. Fortunately, patterns and frameworks like Redux make it releatively straightforward to do this.

You can still make a mess, sure, and make mistakes, etc, of course. No silver bullet. But you can now deal with those two separately. If you start fetching data from your components directly you're back in jQuery hell with extra steps.

Re: React is holding me hostage

#219

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…

React definitely continues to innovate. Functional components and hooks were a huge innovation to class components and significantly improved the ergonomics of the library. That was only a few years ago. The team is actively working on RSC (react server components) which will have a similarly large impact on react's capabilities. Frameworks like remix and next will be able to leverage and build on this to create even…

>Functional components and hooks were a huge innovation to class components and significantly improved the ergonomics of the library.

I see this said a lot with particular regard to hooks, and to this day I just can't buy in.

For whatever problems class components have, they enforce a general layout of the component in a way that hooks don't. Reading some codebases that are all in on hooks feels like the wild west and is frankly nightmare-ish to untangle.

Re: React is holding me hostage

#220
post #216

Earlier quoted context omitted.

> the modern webapp experience is so miserable for the average person. I see this claim a lot and I'm curious what this is based on, can somebody drop some links to further reading?

I have a beefy machine and fast internet. Yet, JIRA is annoyingly slow. Half the time, pages on my bank’s website take forever to load, or don’t load at all. I don’t have any numbers, just some anecdotal experience like the above. It is not just speed. The UI of many sites suck too. Amazon, GoDaddy, for example. Then there are ads. We don’t see ads in between content anymore. It is content within ads these days. I am…

Isn't Jira server-side rendered?
Post reply on HN