AMD-ifying jQuery Source

Timmy Willison / @timmywil

What is AMD?

AMD Superconductor        AMD Graphics

... WHAT IS AMD?

Asynchronous Module Definition

Workable javascript module system

Modules are super-cool

supercool

King of Modules

James Burke

Why AMD?

Why AMD?

  • Browser specialty
  • jQuery mobile (UI coming up)
  • r.js

Changing the World

Steve Jobs changing the world

Old jQuery

Old modules

Bunny-face carrot!

Sane Developers

Problems

  • Not usable individually without building
  • Tracked dependencies manually
  • Limited builds

New jQuery

  • No more interdependency
  • Built file size not affected
  • Main modules still there, with AMD wrappers
  • The core of core is the only core
  • Clears the path for even further fragmentation

Real world modules

Examples time

Build?? I am excite!

Building

AMD + Building

  • Reduce network requests
  • Reduce size
  • Flexible, pliable builds

Future Roadmap

  • jQuery Mobile and UI to list core dependencies
  • Further fragmentation
  • Grunt task for building jQuery

Questions?

@timmywil

timmywillison.com