Live data from Hacker News

Throne of JS: Eight JavaScript MV* Libraries Compared

blog.stevensanderson.com

71–73 of 73 posts

Re: Throne of JS: Eight JavaScript MV* Libraries Compared

#71

Knockout is awsome. Check it out. You can grasp it over the afternoon and examples of advanced ui-s are interesting and concise.

And then you try to use it for more complicated cases, run into limitations and switch to backbone.

I take issue with this kind of generalisation. I don't think these problems are inherent to knockout, but I do think there is a lack of architectural guidance on building large apps with it.

That said, building a maintainable, extensible knockout app is the same as building any other object-oriented system. First, decompose your app into multiple view models (a single view model doesn't have to be bound to the entire page) with clearly defined responsibilities. Combine that with a good Pub/Sub system [1] and you're most of the way there.

That said, it would be nice to see some examples of large-scale knockout apps, as there doesn't seem to be much discussion out in the open in this area. A perfect candidate (in my mind) would be for Steve to release the source code for the knockout tutorial site since that is fairly complex.

[1] https://github.com/rniemeyer/knockout-postbox

Re: Throne of JS: Eight JavaScript MV* Libraries Compared

#72
post #30

Earlier quoted context omitted.

Most frameworks it is not possible to do proper unit test. With Angular, you can actually do it. As the controller is totally separate from the view (html/dom).

OK. I was just taking it for granted that it was easy, because the same is true in Knockout (viewmodels are entirely independent of views, and so are trivial to unit test with QUnit or whatever else).

Pretty much only Angular and KnockOut and maybe 1 other js framework can do real unit test

Re: Throne of JS: Eight JavaScript MV* Libraries Compared

#73
For those that are using AngularJS, the frontend guys over at Duolingo gave a great talk about using browserify to perform dependency injection into angular so it feels like you are using angular as a library instead of a framework. It was some really cool stuff.
Post reply on HN