News for hackers. Stuff that matters.
Re:Show HN: Espresso.js – React Meets Backbone for a Minimal... by akrymski on Tuesday November 11, 2014 @01:57PM (#8591503)
Few 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.

Re:Show HN: Espresso.js – React Meets Backbone for a Minimal... by paultannenbaum on Tuesday November 11, 2014 @03:17PM (#8591899)
My 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.
Re:Show HN: Espresso.js – React Meets Backbone for a Minimal... by akrymski on Tuesday November 11, 2014 @04:43PM (#8592404)
Espresso.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.

Re:Show HN: Espresso.js – React Meets Backbone for a Minimal... by jacobr on Tuesday November 11, 2014 @03:44PM (#8592044)
React works fine without JSX. var DOM = React.DOM; DOM.div() etc.
Re:Show HN: Espresso.js – React Meets Backbone for a Minimal... by akrymski on Tuesday November 11, 2014 @04:40PM (#8592371)
Sure - 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().