Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How is loadScripts supposed to work with loadOrder and files #2

Open
no1melman opened this issue Sep 11, 2017 · 0 comments
Open

How is loadScripts supposed to work with loadOrder and files #2

no1melman opened this issue Sep 11, 2017 · 0 comments

Comments

@no1melman
Copy link

The below snippet outlines the loadScripts function.

loadScript: function () {
var metadata = this.metadata,
files = metadata && metadata.files,
manifest = Ext.manifest,
loadOrder = manifest && manifest.loadOrder,
paths = [],
i;
// TODO: Deal with entries in the js array on package.json
if (files && loadOrder) {
for (i = 0; i < files.length; i++) {
paths.push(loadOrder[files[i]].path);
}
this.load(paths);
}
else if (metadata && !metadata.included) {
this.load(this.jsUrl);
}
},

When it runs through the files, it will look them up in the loadOrder and then append them to a paths array:

for (i = 0; i < files.length; i++) {
paths.push(loadOrder[files[i]].path);
}
this.load(paths);

However, it appears that the load function doesn't handle urls being an array, yet clearly the loadScripts is expecting at some point to pass it one.

load: function (url) {
var me = this;
me.block();
Ext.Boot.load({
url: url,
success: function () {
me.unblock();
},
failure: function () {
// css files are optional
if (url.endsWith('.css')) {
me.unblock();
} else if (!me.error) {
// Keep the first failure only
me.error = new Error('Failed to load "' + url + '"');
me.error.url = url;
me.unblock();
}
}
});
},

So, I've manipulated this so that I have extended the manifest loadOrder with my own, and I have files on the metadata. But obviously when it goes to load the urls, it fails....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant