News for hackers. Stuff that matters.
Re:React 19 by rdsubhas on Thursday December 05, 2024 @05:46PM (#42333707)
In my experience, React was an interesting take, but it had certain flawed red-flags that were ignored from the start. I wrote posts about it, but was doomed as a skeptic. The original fundamental premise: let's do one-way binding with virtual DOM, re-render, diff – did not make fundamental sense. Double the memory in browser, complete re-render & diff for every interaction? The answer was: Make it reliable, then make it fast. Now, it's full of hacked-up constructs attempting to make it fast – but it's neither fast nor reliable. At least with honest two-way binding frameworks, fast is guaranteed, and reliability comes from my experience. With React it's just a mess. I pity all the frontend engineers who's first intro has been with React, because unlearning is much more difficult than learning.

Being mindful of the never-ending-nirvana frontend spirit of churn, and after doing web development in VBScript, JS, JQuery, Mootools, Applets, Actionscript, YUI/Ext/Sencha, Backbone, Knockout, Angular1, Angular2, React, Vue1 – I'd say try Flutter. It's genuinely a breath of fresh air.

Except... Dart. If only Flutter was in Typescript it might have been a bit closer to nirvana. The Dart part is still keeping the frontend spirit of churn alive.

Re:React 19 by homebrewer on Thursday December 05, 2024 @05:58PM (#42333815)
What are y'all doing with it that apparently makes it slow? I've been developing a massive react application for the past two years, and it's plenty fast and very responsive even on my mid-2019 middle of the range Android phone. And I'm saying that as someone who refuses to use Electron and trims down Linux desktops to bare essentials to save as much memory and CPU cycles as possible.

It's an interactive business analytics, one of those use cases where an SPA makes sense — 15 years ago it would have been a native desktop application.

We just follow the usual guidelines, no extraordinary optimization techniques or anything like that.

Re:React 19 by subarctic on Friday December 06, 2024 @01:02AM (#42336847)
Have you don't nothing to optimize it? One pattern we've had to adopt is wrapping every component in react.memo
Re:React 19 by kesslern on Thursday December 05, 2024 @08:15PM (#42334925)
Why is fast guaranteed with two way binding frameworks?
Re:React 19 by simplify on Thursday December 05, 2024 @05:51PM (#42333748)
Virtual DOM is not inherently an issue. Many libraries use it and are much faster than React.

The main issue is React forces you to tell it which components to re-render. This causes a bloat of ceremony that makes it endlessly annoying (in comparison to global redraws) to write in.

Re:React 19 by lyu07282 on Thursday December 05, 2024 @07:01PM (#42334318)
> React forces you to tell it which components to re-render

That's a really weird statement, do you keep your application state in a mutable data structure instead of immutable? Do you know what a pure component is?

Re:React 19 by the_gipsy on Thursday December 05, 2024 @07:20PM (#42334456)
So you don't use hooks at all? The one great unification of state management that comes included?