2. RequireJS is...
✤ An asynchronous script loader
✤ A tool to support organization of code cleanly into
modules in separate files
✤ A tool to “build” and optimize multiple javascript
modules into a single file
3. Why use a loader?
✤ Overcome script tag “blocking” behavior
✤ Parallel script downloads
✤ On-demand or “lazy” loading
7. Javascript Modules
✤ Namespacing (actually, scope closure)
✤ One module per file
✤ Dependency management
✤ Load in parallel in any order, but execute in
correct order
8. AMD (Asynchronous Module Definition)
The Asynchronous Module Definition (AMD) API specifies a
mechanism for defining modules such that the module and its
dependencies can be asynchronously loaded. This is particularly well
suited for the browser environment where synchronous loading of
modules incurs performance, usability, debugging, and cross-domain
access problems.
https://github.com/amdjs/amdjs-api/wiki/AMD
http://addyosmani.com/writing-modular-js/
http://requirejs.org/docs/whyamd.html