Developing Backbone.js Applications
addyosmani.github.com
addyosmani.github.com
http://smagch.github.com/posts/2012-11-20-model-is-stateful....
http://smagch.github.com/posts/2012-12-10-assemble-modules-b...
I love Coffeescript/Underscore/Backbone and have made many applications with them. But for large sites with lots of nested views, I prefer Coffeescript/Less + Emberjs + Handlebars + Bootstrap.
Also, have you published that Backbone tutorial you were working on yet?
- I like how he shows integration with a couple of different backends (Sinatra & Node). Makes it more practical and 'real world' than just 'assume we have this bit of JSON to work with'.
- As other people have mentioned, the build process as a whole is becoming important with frontend MV*
- Check out Marionette to ease the boring bits of Backbone. There's a chapter on it in Osmani's book now; not sure if it was there when you read it.
- The book is still not set to be released for another 6 months; Osmani's JS Design Patterns book was fantastic so I'm sure this will be great too.
However, nodeJS makes it easy to quickly build a thin backend for the purpose of making the frontend work quickly, furthermore , nodeJS is becoming a tool that is really necessary in frontend development , you often need a buildstep before deploying code on the server ( minif , concat , ... ) , so a little chapiter on node makes sense in my opinion ;)
nodeJS is becoming a tool that is really necessary in
frontend development you often need a buildstep before
deploying code on the server ( minif , concat , ... )
Certainly there are minifiers like Uglify that are Node.js packages, but I wouldn't go so far as to claim that Node.js is now "necessary" for frontend development. I'd bet an awful lot that YUI Compressor, Google Closure Compiler, even things like jsmin.c are being used much more than similar Node.js-based tools.It is also, by the way, the same problem native app developers have to solve when they create an app that relies on a web server for its data. They must make sure their models are in sync and that authentication and validation happens on the client or is at least represented consistently.
If it still doesn't feel right to have a thick javascript application on the client, though, you might want to do a little research into how 37 Signals wrote Basecamp two. They did it without relying on a thick javascript client framework and instead pass up all the JS/HTML necessary on each request and use HTML5 pushstates to keep the app dynamic and snappy.
As a related note, I highly, highly recommend Angular.js. Aside from all the awesome two-way bindings stuff (which you get with a lot of other frameworks), the big selling point for me was the fact that dependency injection is baked in at every level and the emphasis on writing testable code that doesn't rely on DOM manipulation.
I've got to admit that I've never worked on a substantial Backbone app, but many of the issues I see people having with Backbone (regarding rendering item and list views, programmatically binding events, etc..) are simply non-existent in Angular.
Chaplin (despite being CoffeeScript) is also a good framework to check out since it demonstrates several good practices for large Backbone.js apps
I will greatly appreciate your feedback.
There are enough places where things can be handled with jQuery, but it's not nearly as elegant. The question wasn't if we were a single page application, but rather that we had enough in-page interaction that using jQuery was unwieldy. I have ideas that are coalescing on how to handle the in-between stage, but I'm not quite there yet.
[1] https://developers.google.com/webmasters/ajax-crawling/docs/...