Skip to content

Commit

Permalink
components will now resolve with a single object
Browse files Browse the repository at this point in the history
  • Loading branch information
dlueth committed Feb 28, 2020
1 parent 4004c03 commit 855c4d0
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 22 deletions.
2 changes: 1 addition & 1 deletion dist/cache/dispose.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cache/states.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/demand.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/demand.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/handler/css.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/html.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/json.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/legacy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/text.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugin/cookie.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugin/lzstring.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugin/sri.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "qoopido.demand",
"title": "Qoopido.demand",
"description": "Promise like module loader using XHR requests and localStorage caching to dynamically load JavaScript and CSS + dynamic dependency resolution + support for custom handlers",
"version": "5.2.7",
"version": "5.2.8",
"homepage": "https://github.com/dlueth/qoopido.demand",
"author": {
"name": "Dirk Lueth",
Expand Down
28 changes: 20 additions & 8 deletions src/handler/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,33 @@ var handlerComponent = (function() {

ClassPledge.all(pledges).then(
function() {
var i = 0, module, dependency;
var components = [],
i, module, component;

pledges.length = 0;

for(; (module = modules[i]); i++) {
dependency = ClassDependency.get(module.uri) || new ClassDependency(module.uri);
dependency.source = functionResolveSourcemaps(dependency.url, module.source);
dependency.handler = arguments[i];
for(i = 0; (module = modules[i]); i++) {
component = ClassDependency.get(module.uri) || new ClassDependency(module.uri);
component.source = functionResolveSourcemaps(component.url, module.source);
component.handler = arguments[i];

pledges.push(dependency.pledge);
components.push(component);
pledges.push(component.pledge);

queue.enqueue(dependency);
queue.enqueue(component);
}

ClassPledge.all(pledges).then(dfd.resolve, reject);
ClassPledge.all(pledges)
.then(function() {
var offset = dependency.path.length + 1,
component = {};

for(i = 0; (module = arguments[i]); i++) {
component[components[i].path.substr(offset) || 'main'] = module;
}

dfd.resolve(component);
}, reject);
},
reject
);
Expand Down

0 comments on commit 855c4d0

Please sign in to comment.