[Framework] Add comments, logging

Add additional comments and logging to components
of the framework layer. WTD-518.
This commit is contained in:
Victor Woeltjen
2014-11-04 17:17:35 -08:00
parent 3ed3ee19d7
commit dbd5b148e2
10 changed files with 136 additions and 34 deletions

View File

@ -9,6 +9,13 @@ define(
"use strict";
/**
* Responsible for managing the four stages of framework
* initialization:
*
* * Loading bundle metadata (JSON files)
* * Resolving extension implementations with Require
* * Registering extensions with Angular
* * Bootstrapping the Angular application.
*
* @constructor
* @param {BundleLoader} loader
@ -18,35 +25,12 @@ define(
*/
function FrameworkInitializer(loader, resolver, registrar, bootstrapper) {
function registerExtensions(resolvedExtensions) {
Object.keys(resolvedExtensions).forEach(function (category) {
registrar.registerExtensions(
category,
resolvedExtensions[category]
);
});
}
/**
*
* @param {Bundle[]} bundles
* @returns {Object.<string, object[]>} an object mapping
*/
function resolveExtensions(bundles) {
return resolver.resolveBundles(bundles);
}
function loadBundles(bundleList) {
return loader.loadBundles(bundleList);
}
return {
runApplication: function (bundleList) {
return loader.loadBundles(bundleList)
.then(resolver.resolveBundles)
.then(registrar.registerExtensions)
.then(bootstrapper.bootstrap);
}
};