Live data from Hacker News

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

gwendall.github.io

31–40 of 62 posts

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

#31

I applied to the example here the first test I always make of any things like this: HTML injection. Result: failure. ☹

yup, my go to test name:

\_(ʘ_ʘ)_/ "'caused it to show

{ "formData": { "name": "\\_(ʘ_ʘ)_/ \"'

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

#32
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?

The HTML5 formData looks exactly like this example.

https://developer.mozilla.org/en-US/docs/Web/API/FormData

Weir thing is, the formData doesn't specify a working .toString(), so if you log it, it looks empty, and you can't see any of the values until you POST. Standards committees are wonderful.

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

#33
post #24

Might be worth benchmarking against the others: http://jsperf.com/angular-vs-knockout-vs-ember/351 For me personally I am loving VueJS right now.

I'm entirely in love with VueJS. It's just amazing. I only wish I could use it with IE8 so I could replace our old version of Angular that we're stuck with at work, but hey, somethings got to give to get that nice an API.

Vue / Ractive / React. I'm not a reactive programming nerd, I just want something simple, and all three of these are implemented so well.

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

#38
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…

Im sceptical. You know why? You wrote all this text instead of giving me a real world example and said "look, this would be shitty without a 2-way-data-binding-library".

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

#39
post #25
post #16

Earlier quoted context omitted.

That depends. How many forms and how many fields do you need to validate? jQuery is pretty much standard on most websites, so I don't count that against the author. The total minified dependency file is 123 kb. I will agree that is pretty large if all you are using it for is a single field, but again, a large portion of that is jquery. Also compared to just core angular, which is 104 kb, I would say this is a viable…

Well, you can argue if 5 dependencies and 123 kilobytes of code is much or not. But what does it bring to the table? Your "sub-total" example would just need a normal javascript event handler. Lets say we are uber lazy and use jquery. Then it looks like this: http://jsfiddle.net/La93vk4q/ How does the way.js version look like? Im sceptical it makes it more elegant.

I'm with you itry. Thanks for bringing this up here. These folks all want to avoid writing event handlers but these alternatives just make there be many levels of function calls between that actual user event and the developer's code to handle it. In addition to it being much slower, it's a lot harder to figure out what's happening when something goes wrong.

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

#40
post #31

I applied to the example here the first test I always make of any things like this: HTML injection. Result: failure. ☹

yup, my go to test name: \_(ʘ_ʘ)_/ "' caused it to show { "formData": { "name": "\\_(ʘ_ʘ)_/ \"'

just this will do:

will show:

{ "formData": { "name": "

Post reply on HN