Live data from Hacker News

Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding

gwendall.github.io

51–60 of 62 posts

Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding

#52
post #12
post #11

That's the only javascript framework one needs. 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...

Does anybody have real world examples of websites that use this kind of thing? Im always under the assumption that the old "post data to server, save it there" model still works best. Am I missing something?

Reading all your responses in this thread, it's clear that you want URLs to sites you can go look at rather than descriptions of times when this has been useful to individuals. You can find lots of examples of things built using data binding at the angularjs[0] and ember[1] showcase sites. A particularly well-known example of a nice application that relies heavily on data binding is discourse[2].

[0]: https://builtwith.angularjs.org/ [1]: http://emberjs.com/ember-users/ [2]: http://www.discourse.org/

Some people prefer to do things your way, but lots of us really do like this sort of data binding and find it to be very useful.

Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding

#54
post #29

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. 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]…

Oh man, I've had to work on projects with serverside form generation (python people are really into this stuff for some reason), and it's a huge pain. Backend engineer thinks it's going to be way easier or something not having to write templates, however on the frontend, the code generated by these tools is always weird and different from the rest of the markup. No thanks.

Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding

#55
post #54
post #29

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. 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]…

Oh man, I've had to work on projects with serverside form generation (python people are really into this stuff for some reason), and it's a huge pain. Backend engineer thinks it's going to be way easier or something not having to write templates, however on the frontend, the code generated by these tools is always weird and different from the rest of the markup. No thanks.

Same. Not sure why this is such a popular thing to do. Makes error handling almost impossible to reason about.

Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding

#57
post #54
post #29

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. 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]…

Oh man, I've had to work on projects with serverside form generation (python people are really into this stuff for some reason), and it's a huge pain. Backend engineer thinks it's going to be way easier or something not having to write templates, however on the frontend, the code generated by these tools is always weird and different from the rest of the markup. No thanks.

FWIW, with neurons, there's always the option to override markup generation on a field-by-field basis, so if you don't like the generated code for a certain part of the document, you can change it to your heart's content.

You'll even be able to pass templates down a certain object hierarchy, but that's further down the pipeline.

Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding

#58
post #14

Earlier quoted context omitted.

How about: Enter an amount in an input box and see a sub-total in real-time, or alert when constraints are violated? Possibilities are endless and you're more likely to implement them when it is so painless.

Is it really more painless to add way.js and its dependencies (jquery.js, underscore.js, underscore.json.js, form2js.js and js2form.js) to your page then to simply add a plain javascript eventhandler to the field you want to validate?

I guess it depends :)

I'm using Angular's databinding and recently it felt as if it was just convenient enough to implement a nice-to-have feature that I might have postponed otherwise.

I'm also careful with adding too many dependencies for simple things. But since I've committed to learning and using Angular anyways, I don't mind the weight and like using what it has to offer.

Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding

#59
post #23
post #20

Earlier quoted context omitted.

One possible use case is "live editing" of an object. Imagine a form that lets you build an HTML button from various properties: text, color, font, background, border-radius etc. Using way.js the button can be updated immediately whenever you change one of its properties, without waiting for a server response. And saving the data to localstorage is very useful when the user is spending a long time filling the form an…

> One possible use case Sure, one can think up use cases. But I never had one. Thats why I asked for real world examples where 2-way-binding libraries are used.

> Sure, one can think up use cases. But I never had one.

Welcome to your very own filter bubble.

Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding

#60
post #30
post #12

Earlier quoted context omitted.

Does anybody have real world examples of websites that use this kind of thing? Im always under the assumption that the old "post data to server, save it there" model still works best. Am I missing something?

If what you're doing is simple enough that "serialise the form, send to server, wait for response, do a full page reload" works for you, then no, you don't need two-way data binding, and in fact wouldn't have any use for it. You only need two-way data binding if you need your client-side code to respond to user input, which a truly basic form doesn't need to do. Of course, for a good user experience, you probably wan…

" I've written a big CRM webapp that uses two-way data binding extensively; the old "every click is a full HTTP round trip" model would deliver a shockingly bad user experience."

Worth noting that, from what I can see, Salesforce largely uses the "every click is a full HTTP round trip" approach and it seems to be quite popular. NB I'm not saying that Salesforce has the best interface ever, just that old-fashioned web applications can still be pretty successful.

Post reply on HN