Hello,
The problem is this, I include a script, it uses another one, but what if that dependency also needs another script to be ready ? Which means loading it is not enough, but I also need to be sure its callback for initialization has been called before executing. The order of script tags in DOM can not be correct if the dependencies are allowed to require more dependencies and manifest them when them after being loaded.
The problems gets more complex when scripts and dependencies require more than one dependency, or a file satisfies more than one component.
Using.js seems to have a good approach for this, but first, the dependency relations should be known before they are being loaded, second the author states that some tests are not working anymore on Firefox. I suspect it is the blocking the execution thing, which seems a bit magical.
I have written a loader to handle this, completely asynchronous, which actually seems to be work. But I can not shake the gut feeling of doing something has been solved before, or can not be that complex.