Disclaimer: This text is exclusively focused on the existing capabilities of the language, and does not weight into additional capabilities like wasm, or virtual modules, or compartments. Those can be discussed later on.
The bare minimum mechanism to create a module graph that matches ESM requires few main pieces:
- A portable (serializable) structure that represents the source text of the module.
ModuleSource
must be portable across processes and across realms. - A realm based
Module
that closes over aModuleSource
.