JavaScript files depend on each other, and, in large code bases, tracking their dependencies to decide which files to add to each HTML page, and in which order, is not a trivial task. Moreover, the maintenance of large sets of JavaScript files whose dependencies are not explicitly represented in the code itself is a nightmare that considerably limits the possibility to re-engineer the code as an application evolves.
The situation worsens if one tries to optimize the downloading time of JavaScript files. In fact, the only ways to optimize this time, other than the obvious minimization of JavaScript files, are the following:
- To bundle together several files in a way to reduce the number of download operations.
- To try downloading some files in parallel, while respecting all precedence constraints coming from the dependencies graph. In fact...