Way.js – Simple two-way databinding(github.com) |
Way.js – Simple two-way databinding(github.com) |
I'd love to see the Todo MVC app done in Mithril.js.
Also, I looked at your mithril link and even though it's a smaller file size, the framework does way more than just databinding, which seems to be the only thing way.js does.
For environments where you don't have dedicated frontend people, I think Knockout is more approachable. I very much like the flow based programming ideas behind React, but in the end I think the need to either learn/implement the Flux architecture or having to follow chains of Javascript callbacks really dissuaded my coworkers from supporting it.
KO has a more familiar template-like approach. And now that the latest version also offers components, I like that I can use templates where they work and switch to components when necessary, which should eliminate some of the boilerplate I faced in React. I'm very excited to try out the new KO features, and I'm always surprised to not see much mention of KO in front end discussions at HN.
That being said, while working with KO there were times where I created bugs that would have been impossible or difficult to create with React. But I think for a team of backend developers that don't do much frontend work and who aren't that familiar with functional programming, React (whether callback property style or using Flux) is too much of a jump. For personal projects I'm interested in trying out React+Flux, though.
It is actually possible to just use the databinding features of AngularJS without all the framework stuff. Just need a few lines of Javascript to get yourself a scope.
Or just use my code: https://github.com/julius/AngularLite
Mithril doesn't have any dependencies. It takes 13KB minified, down to 5KB when gzipped.
Source: https://github.com/lhorie/todomvc-perf-comparison/tree/gh-pa...
Live: http://lhorie.github.io/todomvc-perf-comparison/todomvc-benc...
The implementation was written by JP Monette, but it has been refactored several times by Leo Horie (the author of Mithril). Looking at the revision history should give you an idea of the various ways to use the framework.
The current version relies heavily on viewmodels, to the point of making the controller virtual.
Edit: you may also want to have a look at the comparative benchmark: http://lhorie.github.io/todomvc-perf-comparison/todomvc-benc...
Note that the benchmark sometimes returns NANs. It is happens when the todo count doesn't match the expected amount (it's hard to correctly benchmark async code). At the moment, Quiescent consistently NANs out in Chrome, and so do Mithril and Mercury in Safari, but only occasionally.
It is due to the test harness, not to the frameworks or the TodoMVC implementation. ==> Uncheck Quiescent when testing with Chrome, and re-run the benchmark if you get NANs in Safari.