-
Notifications
You must be signed in to change notification settings - Fork 16
Description
The below snippet outlines the loadScripts function.
package-loader/packages/package-loader/src/package/Entry.js
Lines 60 to 78 in 49c0699
| 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:
package-loader/packages/package-loader/src/package/Entry.js
Lines 70 to 73 in 49c0699
| 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.
package-loader/packages/package-loader/src/package/Entry.js
Lines 80 to 102 in 49c0699
| 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....