This repository has been archived by the owner on Feb 21, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now using RequireJS to manage module dependencies
All modules in source and unit tests have been converted to use the CommonJS Asynchronous Module Definition format expected by RequireJS. Tests page for each module have been modified to use RequireJS to load modules dynamically, based on dependencies declared in each module. The "all tests" page for the combined/minified script uses an alternate implementation of CommonJS AMD, located in src/amd/define.js. We developed this null implementation does not load modules; it only runs the factory functions registered in define() calls with expected arguments. We modified the build process to use the RequireJS optimization tool, which looks up dependencies in each module by parsing the script files. RequireJS itself is not included in the combined script; it is replaced with our lighter alternative "amd/define". Both the combined (lb-full.js) and the minified (lb-min.js) scripts maintain the backward compatibility with existing projects: each module still registers itself in a namespace hierarchy in the global variable window.lb. In addition, modules can now be loaded dynamically; lb modules must be prefixed by "lb/", e.g. "lb/lb.core.application" in define() and require() calls.
- Loading branch information