Skip to content

Commit

Permalink
add notes for Building Pageless Apps with Backbone.js and Rails prese…
Browse files Browse the repository at this point in the history
…ntation
  • Loading branch information
tcaddy committed May 19, 2011
1 parent 00ab15e commit cab7b33
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions building_pageless_apps_with_js_and_rails.txt
Original file line number Diff line number Diff line change
@@ -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{}


0 comments on commit cab7b33

Please sign in to comment.