facebook/react — pull request #1809 by chenglou (2014-07-11 03:02:45+00:00)
Title: [RFC] Refactor DOM properties diffing logic

Better version of 1543.

This generalizes the diffing into a `diffProperties` method that we can use recursively, both for updating all the DOM props and for the style object. The method calls the delete/update callback for each appropriate object key. This saves a potential allocation that we used to have due to generating a diff for `style` and passing it onto `setValueForStyles`. This'll be an even bigger win for future props (dataSet, ariaSet), since none of those would allocate.

Another upside is that the code's more readable (I feel?).

The downside is it's slightly slower, because it's calling a callback for each prop rather than passing a diff onto `setValueForStyles`, which iterates over it.