This is a sketch of how module loading might work in HTML.
-
A "load task" is the end-to-end job of loading a module and all its dependencies, linking everything together, and running the code. It's a high-level concept.
Load tasks come in from
<script type=module>
elements, plus wherever else (maybe a DOM API). The loader can have multiple load tasks in flight at once. -
The loader contains a collection of modules shared by all load tasks. Each module is in one of these states:
- loading - waiting for the network;
- waiting for dependencies - loaded and parsed, not linked;