From cab7b33247487e33ae2f138bdcf7635c7e2cd70b Mon Sep 17 00:00:00 2001 From: Teddy Caddy Date: Thu, 19 May 2011 14:31:07 -0400 Subject: [PATCH] add notes for Building Pageless Apps with Backbone.js and Rails presentation --- building_pageless_apps_with_js_and_rails.txt | 55 ++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 building_pageless_apps_with_js_and_rails.txt diff --git a/building_pageless_apps_with_js_and_rails.txt b/building_pageless_apps_with_js_and_rails.txt new file mode 100644 index 0000000..369a0f7 --- /dev/null +++ b/building_pageless_apps_with_js_and_rails.txt @@ -0,0 +1,55 @@ +BUILDING PAGELESS APPS WITH RAILS AND BACKBONE.JS + +benefits of pageless: + * speed + * no flash of white during a page reload + +Pageless apps: + * GMail + +Users start to drop off when it takes more than 1 second for response time. After 10 second wait, user is basically gone, + +Do no harm to users: + * don't take away forward and back buttons + * allow bookmarking + +Use hash in URL to do no harm. + +backbone.js: + * less than 4kb + * readable source + * 1000 lines of annotated source + +sample app: + * expand on pastie.org with more features + +jammit: + * a gem to manage js when you have too much js library files + * auto minifies js during deploy + * .jst extensions are compiled into a js function + +javascript templates are your friend. Use one that you like. + +backbone.js + * hints: + * 'this' is for objects + * use event.currentTarget + * controllers: + * watch the page fragment and do something when it changes + Backbone.history.start(); + * routes page fragments to functions + * views: + * presentation and behavior + * template, initialize, and render functions + * a view can inherit another view + * models: + * js class + * if it has an id attribute, it is saved. No id means unsaved or new + * collections: + * uses underscore.js enumerable functions + * + +Interlude: + * function(){} === lambda{} + +