4 ms·
So how does this compare to actually using React/Flux? It looks like all the virtual DOM stuff no longer exists, which seems to me like you would lose a lot of
by daveidol 12y ago
So how does this compare to actually using React/Flux? It looks like all the virtual DOM stuff no longer exists, which seems to me like you would lose a lot of the niceties of React. Why not just use the actual Flux architecture with Backbone as stores and React as the view?
- akrymski 12y agoFew benefits: - no need to diff the whole DOM tree - no need to write JSX, you can simply use DOM nodes the render() method still gives you most of the niceties of React, ie a declarative view of your DOM, without the nasty inclusion of HTML inside your JS controllers. PS ToDoMVC performance benchmark shows the to-do app to be about 3-4x faster than React.
- paultannenbaum 12y agoMy guess is the performance benchmarks would be much different if you are dealing with an app with a high number of nodes where the diff/repainting benefits of React really kick in.
- akrymski 12y agoEspresso.js diffs as well, except it doesn't have to diff the entire DOM but only the attributes that you'll actually be changing in effect. Moreover it gives you the option between declaratively specifying the DOM to imperatively manipulating it when you need to for performance reasons. It's a tiny library and the approach is much more efficient than diffing the virtual DOM for the entire page, so I'm pretty confident that results would actually be even better in larger apps.
- jacobr 12y agoReact works fine without JSX. var DOM = React.DOM; DOM.div() etc.
- akrymski 12y agoSure - but that's quite horrible to write. And moreover it requires a sophisticated virtual DOM diffing algo, hence the size of React's library. I prefer to do this: render: function() { return { view: { classList: { editing: this.model.editing, completed: this.model.done } } } } Compared to outputting the entire HTML for the component in render().