Live data from Hacker News

Sprint – A high-performance, DOM library for modern browsers

github.com

71–72 of 72 posts

Re: Sprint – A high-performance, DOM library for modern browsers

#71
virtual-dom is all you need: https://github.com/Matt-Esch/virtual-dom

There is a reason why both elm and mercury uses virtual-dom under the hood to generate and manipulate the DOM.

Plus you can render server-side: https://github.com/nthtran/vdom-to-html

If you still want to work with existing html like templates, there is this project: https://github.com/TimBeyer/html-to-vdom

Re: Sprint – A high-performance, DOM library for modern browsers

#72

Or, you know, use the Javascript DOM APIs? They're really not at all that bad. var d = document.createElement("div"); d.className = "new"; d.innerHTML = " Hi Sprint "; Skimming through the code I'm not sure the authors really grok Javascript anyway, which might explain why they need a (pretty thin) custom API for the standard APIs. toArray should be simply this: function toArray(o) { return Array.prototype.slice.call…

I find it interesting that, because some design decisions seem odd to you at first sight, you immediately conclude that the reason is a poor understanding of JavaScript. The `toArray` function, for example, is just performance optimization: http://jsperf.com/toarray-slice-call-vs-loop
Post reply on HN