News for hackers. Stuff that matters.
Re:React Color – Color Pickers from Sketch, Photoshop, Chrom... by jarek-foksa on Monday August 17, 2015 @11:06AM (#10073476)
One of the primary selling points of React is better performance of the virtual DOM, which apparently has no prove in benchmarks [1].

[1] https://aerotwist.com/blog/react-plus-performance-equals-wha...

Re:React Color – Color Pickers from Sketch, Photoshop, Chrom... by clessg on Monday August 17, 2015 @11:14AM (#10073532)
That article has been discredited pretty thoroughly.

Anyway, it's not a panacea. It can't do much if you're forcing a reflow every few milliseconds.

Re:React Color – Color Pickers from Sketch, Photoshop, Chrom... by xorcist on Monday August 17, 2015 @01:39PM (#10074727)
As a complete outsider, do you have a link or two to support that so I could learn more?

It would seem to me, again completely without knowledge, that a virtual DOM seems suboptimal. Web browsers should be able to optimize for that use case a lot better.

Re:React Color – Color Pickers from Sketch, Photoshop, Chrom... by clessg on Monday August 17, 2015 @01:53PM (#10074830)
Pete Hunt's talk is good. https://youtu.be/x7cQ3mrcKaY?t=1112 I'd recommend watching the entire video if you have time, but that's the gist of it. More detail:

http://stackoverflow.com/questions/21109361/why-is-reacts-co...

It is challenging to make a large app with lots of state be performant when you manually mutate the DOM, and there's no way for the browser to fix that because of the way things work.

For example, if you move an element, and then request the position of another element immediately after, the browser will be forced to recalculate layout before giving you an answer. With lots of state and lots of updates, it's very challenging to keep this in the right order.

As virtual DOM is an abstraction over the DOM, you can make a vanilla app that is much faster, but as your app grows, that quickly reverses.

Re:React Color – Color Pickers from Sketch, Photoshop, Chrom... by jarek-foksa on Monday August 17, 2015 @04:13PM (#10075798)
Shadow DOM will allow browsers to optimise their rendering code to re-render encapsulated DOM subtrees independently of each other.

Virtual DOM makes sense when (A) you have a huge tree and (B) you show only a small portion of that tree to the user at any given time.

For example a long scrollable list or a multi-line text editor would be better implemented with virtual DOM, but using it everywhere is an overkill.

Re:React Color – Color Pickers from Sketch, Photoshop, Chrom... by JDDunn9 on Monday August 17, 2015 @01:13PM (#10074512)
If by discredited you mean lots of React fanboys whined about it then yes. If you mean anyone showed actual evidence to the contrary, then no.
Re:React Color – Color Pickers from Sketch, Photoshop, Chrom... by clessg on Monday August 17, 2015 @01:35PM (#10074704)
Call people fanboys all you want, but after the code was released, numerous glaring issues were found, and still haven't been addressed.
Re:React Color – Color Pickers from Sketch, Photoshop, Chrom... by baddox on Monday August 17, 2015 @02:28PM (#10075085)
The more correct selling point is that you should be able to get "good enough" performance (usually meaning consistent 60fps) with properly optimized React code.