mirror of
https://github.com/nasa/openmct.git
synced 2025-06-14 05:08:15 +00:00
[Framework] Add bundle resolver; normalize initialization
Simplify the extension initializer by putting each phase's responsibilities into a specific class. WTD-518.
This commit is contained in:
@ -12,7 +12,7 @@ define(
|
||||
*
|
||||
* @constructor
|
||||
* @param {BundleLoader} loader
|
||||
* @param {ExtensionResolver} resolver
|
||||
* @param {BundleResolver} resolver
|
||||
* @param {ExtensionRegistrar} registrar
|
||||
* @param {ApplicationBootstrapper} bootstrapper
|
||||
*/
|
||||
@ -29,20 +29,11 @@ define(
|
||||
|
||||
/**
|
||||
*
|
||||
* @param bundles
|
||||
* @param {Bundle[]} bundles
|
||||
* @returns {Object.<string, object[]>} an object mapping
|
||||
*/
|
||||
function resolveExtensions(bundles) {
|
||||
var resolvedExtensions = {};
|
||||
|
||||
|
||||
function resolveExtensionsForBundle(bundle) {
|
||||
|
||||
}
|
||||
|
||||
return Promises.all(bundles.map(resolveExtensionsForBundle)).then(function () {
|
||||
return resolvedExtensions;
|
||||
});
|
||||
return resolver.resolveBundles(bundles);
|
||||
}
|
||||
|
||||
function loadBundles(bundleList) {
|
||||
@ -51,10 +42,11 @@ define(
|
||||
|
||||
return {
|
||||
runApplication: function (bundleList) {
|
||||
return loadBundles()
|
||||
.then(resolveExtensions)
|
||||
.then(registerExtensions)
|
||||
.then(bootstrapApplication);
|
||||
return loader.loadBundles(bundleList)
|
||||
.then(resolver.resolveBundles)
|
||||
.then(registrar.registerExtensions)
|
||||
.then(bootstrapper.bootstrapApplication);
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user