Background explanatory material for this specification can be found in the tc39/proposal-dynamic-import repository. See also the issues and the HTML integration spec that builds on top of the below JavaScript specification.
HostResolveImportedModule is an implementation defined abstract operation that provides the concrete referencingModulereferencingScriptOrModule. referencingScriptOrModule may also be import()
expression, and there is no active script or module at that time.
An example of when referencingScriptOrModule can be
<button onclick="import('./foo.mjs')">Click me</button>
there will be no active script or module at the time the import()
expression runs. More generally, this can happen in any situation where the host pushes execution contexts with
The implementation of HostResolveImportedModule must conform to the following requirements:
Multiple different referencingModulereferencingScriptOrModule, specifier pairs may map to the same
HostImportModuleDynamically is an implementation defined abstract operation that performs any necessary setup work in order to make available the module corresponding to the import()
expression occurs.) It then performs
The implementation of HostImportModuleDynamically must conform to the following requirements:
The intent of this specification is to not violate run to completion semantics. The spec-level formalization of this is a work-in-progress.
The actual process performed is implementation defined, but typically consists of performing whatever I/O operations are necessary to allow
FinishDynamicImport completes the process of a dynamic import originally started by an import()
call, resolving or rejecting the promise returned by that call as appropriate according to completion. It is performed by host environments as part of
An implementation must not extend this specification in the following ways: