PhoneGap Day! James Burke on RequireJS and Phonegap
James Burke - works at Mozilla @jrburke
Why webapps? They deploy everywhere!
Require.js, AMD modules
The Great Sadness
(you are the linker, browser only, disparate automation)
indirect dependencies, wordier, async APIs
direct references to dependencies, simpler APIs for your modules
Special text plugin to load template resources.
With a template loader plugin, it does the compile for you.
Makes it easy to switch out jquery for zepto.
Creates cleaner html.
"The fastest code is the code you don't have to load."
CommonJS AMD loaders, standard format leads to choices.
requireJS, curl, Dojo, inject, Isjs
AMD - Build
AMD with phonegap
loader plugin for env
Reusable components, one www codebase
almond, or other dynamic load