News for hackers. Stuff that matters.
Re:Reactive MVC and the Virtual DOM by thedz on Sunday June 07, 2015 @10:22PM (#9677097)
The browser that is rendering the DOM also, ultimately, works that way, with various portions of the browser screen redrawing while others remain static.

So it's kinda funny that the modern state of web dev is adding another layer of that same approach on top of layers of that approach.

Re:Reactive MVC and the Virtual DOM by malkia on Monday June 08, 2015 @02:42AM (#9677533)
The missing part in the DOM is:

  freeze()

  doLotsOfUpdates()

  thaw()

So one would have to reinvent this. Kind of reminds of propeties in some languages, runtimes and their UI's:

  someForm.setWidth(500); // And it's updated right away on the screen, instead of being deferred, or put in some freeze()/thaw() mode. (disableUpdates() / enabledUpdates()).
Re:Reactive MVC and the Virtual DOM by avodonosov on Monday June 08, 2015 @10:58AM (#9679478)
Our scripts are executed in a freeze mode.

When we modify DOM it becomes "dirty", and after our script finishes, reflow/re-render happens. But also, if our script queries DOM properties, like elem.clientHeight, DOM may need to perform the calculations in order to return us correct values, reflecting all the recent property changes. For example, if we access element.clientHeight browser may need to calculate re-flow (I recently encountered very slow clientHeight calculation by FireFox).

So, if we only modify DOM properties, all the re-rendering is deferred till the end of script.

Google about "DOM reflow"

Re:Reactive MVC and the Virtual DOM by WalterGR on Monday June 08, 2015 @04:23AM (#9677834)
Is there any ongoing effort to add 'freeze' and 'thaw' to the standard? Or any browsers that have added them?
Re:Reactive MVC and the Virtual DOM by Yaggo on Monday June 08, 2015 @05:59AM (#9678083)
Isn't requestAnimationFrame basically that?
Re:Reactive MVC and the Virtual DOM by baddox on Monday June 08, 2015 @01:39AM (#9677383)
React's virtual DOM (and other virtual DOM implementations) aren't just "adding another layer of that same approach," because the browser's DOM doesn't give you any way of diffing against a previous DOM state then performing the minimal operations needed to realize the new state.
Re:Reactive MVC and the Virtual DOM by akvadrako on Monday June 08, 2015 @02:29AM (#9677500)
The point is that the browser internally maintains an analogue of the virtual DOM in React, and compares the diffs so only some parts of the screen must be updated.
Re:Reactive MVC and the Virtual DOM by avodonosov on Sunday June 07, 2015 @10:23PM (#9677100)
Yes, yes! I also think about this.