Maybe I'm just missing something, but is there no way to deal with arrays? You know, like looping through data and displaying things for each of them? (also related: what about looping through Object.keys()?)<p>What about dates? And data parsing/formatting in general?<p>Those are kind of important for a bi-directional bindings library. Remember that the Javascript data is usually the canonical data and the displayed data is derived from it, not the other way around.<p>If you want to compare w/ Knockout/Angular/etc then there's even more stuff that could be considered as "missing" (e.g. condiditionals, partials/components, how-do-i-use-select2-with-it, etc). One could argue those are out of scope for a lightweight library, but then again, I think this library has too many dependencies for something that advertises itself as "lightweight".<p>My own framework Mithril ( <a href="http://lhorie.github.io/mithril" rel="nofollow">http://lhorie.github.io/mithril</a> ) for example is ~5kb gzipped, has no dependencies, and allows you to do quite a bit more in terms of templating and data binding.<p>Incidentally, I wrote a article a while back about how two-way binding isn't even always the best answer to your questions, and that there are often better ways to update javascript data from forms: <a href="http://lhorie.github.io/mithril-blog/asymmetrical-data-bindings.html" rel="nofollow">http://lhorie.github.io/mithril-blog/asymmetrical-data-bindi...</a>
Looks very nice indeed. Especially like the low overhead. I've been using an alternative, Cortex[1], recently. It's similar, but with a pubsub based eventing system so your updates don't need to be broadcast to every component that uses the data model (e.g. you can subscribe callbacks to specific changes in the model). It works nicely with React.js. Worth a look if way.js isn't quite enough.<p>[1] <a href="https://github.com/mquan/cortex" rel="nofollow">https://github.com/mquan/cortex</a>
Might be worth benchmarking against the others:<p><a href="http://jsperf.com/angular-vs-knockout-vs-ember/351" rel="nofollow">http://jsperf.com/angular-vs-knockout-vs-ember/351</a><p>For me personally I am loving VueJS right now.
I've been working on something pretty similar, but on the server side. It's called 'Neurons', and it's a pre-alpha Python library. It's built on Spyne[3], an RPC framework which is another side project of mine that I've been working on for ~4 years now.<p>The aim with neurons initially is to let you generate a html form (e.g. [1]) and related services from just a model definition and an instance of this model (e.g. [2]), making it a breeze to publish CRUD pages. It currently handles complex stuff like dates, times, arrays and nested objects just fine.<p>In Spyne terms, that's "serializing a model instance using the HtmlForm protocol".
The same object definition can be used to for other protocols like json as well as for persisting data to a relational database (via SQLAlchemy). You can play with the code generator at <a href="http://spyne.io" rel="nofollow">http://spyne.io</a> to get a better feel about how it works.<p>One could even write a Spyne protocol that renders a given model instance to way.js code.<p>Help is welcome!<p>[1]: <a href="https://github.com/plq/neurons/blob/test_output/html/test_simple_array.html" rel="nofollow">https://github.com/plq/neurons/blob/test_output/html/test_si...</a><p>[2]: <a href="https://github.com/plq/neurons/blob/fccab8fee4c1795f65ac3f9b20d79cb1e9279a3f/neurons/form/test/test_form.py#L193" rel="nofollow">https://github.com/plq/neurons/blob/fccab8fee4c1795f65ac3f9b...</a><p>[3]: <a href="http://spyne.io" rel="nofollow">http://spyne.io</a>
That's the only javascript framework one needs.<p>Actually I've been wanting to write something like that for a long time but didn't get around to it. Nice to see someone else did exactly what I wanted...
I would also suggest looking at Rivets (<a href="http://rivetsjs.com" rel="nofollow">http://rivetsjs.com</a>) which is my current go-to solution for this sort of thing.
Looks very straight-forward. Good job!<p>OT: After building a couple of large applications in Angular I've come to realize that I seldom need two-way bindings. The school example where you enter something in an input box and it shows up somewhere else in real-time is not really used in the real world. Or is it? Why do we need two-way data binding?
This is cool but in real world scenarios you need more functionality to make it useful. So far I've been using KnockoutJS where I don't need full-blown MVC and can get away with MVVM.
Is it me, or should the description read: "This form is bound to the 'formData' property" instead of "This form is binded to the 'formData' property"