News for hackers. Stuff that matters.
Re:Removing User Interface Complexity, or Why React is Awesome by zawaideh on Tuesday May 13, 2014 @10:56AM (#7738423)
Instead of having React altogether, wouldn't it make sense to have the browser keep track of a virtual DOM, and only repaint whatever changes on its own, while managing its own requestAnimationFrame and paint cycles?

P.S. I haven't looked into this in depth, just throwing an idea out there.

Re:Removing User Interface Complexity, or Why React is Awesome by rjknight on Tuesday May 13, 2014 @11:30AM (#7738607)
I may be mistaken here, but I think that the main advantage of the virtual DOM is to avoid calling across the JavaScript-native boundary. Since calling browser APIs is inherently expensive, the virtual DOM improves performance by reducing the number of calls to these APIs and/or batching them together.

Similar techniques have been used in other types of programs where performance is critical - for instance, user mode networking and user-mode thread scheduling can be quicker than the kernel-mode equivalent because it reduces or eliminates expensive system calls.

Re:Removing User Interface Complexity, or Why React is Awesome by rdtsc on Tuesday May 13, 2014 @11:04AM (#7738473)
Yeah if the technology was in the browser that would possible.

From what I understand, the core idea is that changes are applied to the virtual DOM in a very simple way (from the application point of view). Then there is another piece of code that knows how to efficiently find the diff between the vDOM and DOM and apply the changes. It seems that last part could be done by the browser.

Re:Removing User Interface Complexity, or Why React is Awesome by stuki on Tuesday May 13, 2014 @11:28AM (#7738597)
The additional layer of redirection, at least conceptually enables the use of application specific, or pluggable, vDOMs and/or diffing strategies.