Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Blaze doesn't diff the resulting DOM structure. Instead, Blaze diffs the data the components depend on. […] Therefore when data changes, Blaze can directly update the relevant elements.

FWIW this is available to React as an optimisation if desired/necessary: by default React just renders the whole component tree on data changes[0] and diffs the result tree before updating the DOM — which is simple and usually performs well — but components can implement shouldComponentUpdate[1] to skip re-rendering if unnecessary[2].

[0] a React component could depend on non-react data, React is conservative and does not assume components depend only on data it can track

[1] http://facebook.github.io/react/docs/component-specs.html#up...

[2] and React provides ReactComponentWithPureRenderMixin[3] which can be mixed into any "pure" component whose output depends solely on application and component state, to get a free shouldComponentUpdate

[3] well "provides" may be excessive, it's in the repository but seems to be neither in the react distribution nor in the react-with-addons distribution. YMMV.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: