background preloader

Backbone

Facebook Twitter

From jQuery to Backbone. Backbone UI. Backbone.js. How to start with Backbone.js: A simple skeleton app. Prerequisites You need a solid knowledge of JavaScript, familiarity with Backbone, Ruby, HAML, SASS and CoffeeScript to find this writeup useful. Also, I’m developing on a Mac and have not tested this on other platforms. Although, I do not see any reason why it shouldn’t work. 1. Philosophy Part of the success of Rails was the conventions and its predefined directory tree. Backbone, being the nimble, does not prescribe any particular code or directory structure. This skeleton app was extracted from a production app and then extensively annotated, to explain certain decisions and choices. 2.

When I first started to play with Backbone I was already heavily entrenched in the Ruby and Rails world. Disclaimer: I rarely developed pure client-side software, though I was using JavaScript extensively to make things faster and more responsive. Thing is that MVC on the server-side is quite a bit different from MVC on the client. Using backbone.js as a library was “easy”. 3. CoffeeScript, HAML and SASS.

Backbone patterns. Building apps with Backbone.js Here, I try to document the good practices that our team has learned along the way building Backbone applications. This document assumes that you already have some knowledge of Backbone.js, jQuery, and of course, JavaScript itself. Table of contents Thanks. Backbone.js: Hacker's Guide. There’s no denying the popularity and impact that Backbone.js (License: MIT, GitHub: documentcloud / backbone) by Jeremy Ashkenas and DocumentCloud has made. Although the documentation and examples are excellent, I thought it would be interesting to review the code on a more technical level.

Hopefully this will give readers a deeper understanding of Backbone, and as the MVC series progresses these code reviews should prove useful in accurately comparing the many competing frameworks. Follow me on a guided tour through Backbone’s source to really learn how it works and what it provides. Namespace and Conflict Management Like most client-side projects, Backbone.js wraps everything in an immediately-invoked function expression: (function(){ // Backbone.js}).call(this); Several things happen during this configuration stage.

Var root = this;var previousBackbone = root.Backbone; Backbone.noConflict = function() { root.Backbone = previousBackbone; return this;}; var Backbone;if (typeof exports ! Single Page Web Apps with Backbone.js.