Loader Size

There your are sitting in front of your brand-new dual processor XEON with a total of eight cores, 24G of RAM and a solid-state disk drive and you say to yourself, "I never have to worry about size and speed again!" Then your best customer wants you to move an application to a mobile device. Back to the real world.

That fact is, size matters! If you developing for mobile then browser caches, memory, CPU and network bandwidth are all signifcantly smaller than even an old PC. The #1 design requirement for bdLoad is to minimize the implementation size while implementing the AMD specification.

bdLoad is the smallest AMD loader available today. The implementation includes several switchable features that can be discarded when building optimized versions of the loader. The repository includes several prebuilt versions with feature sets targeted at specific problems as follows:

Optimization Name Description size[1] optimized code closure-compiled example
mini smallest possible, webkit only, implements full AMD spec 2.95K see code see code try it
webkit for webkit and/or mobile browsers; implements full AMD spec plus catches and reports errors and includes has.js core 3.24K see code see code try it
desktop same as webkit plus IE suport 3.42K see code see code try it
basic equivalent feature set to requirejs 3.62K see code see code try it

1. size is closure-compiled and gzipped.

All of these versions were built with bdBuild.