Module boa_engine::module
source · Expand description
Boa’s implementation of the ECMAScript’s module system.
This module contains the Module
type, which represents an Abstract Module Record,
a ModuleLoader
trait for custom module loader implementations, and SimpleModuleLoader
,
the default ModuleLoader
for Context
which can be used for most simple usecases.
Every module roughly follows the same lifecycle:
- Parse using
Module::parse
. - Load all its dependencies using
Module::load
. - Link its dependencies together using
Module::link
. - Evaluate the module and its dependencies using
Module::evaluate
.
The ModuleLoader
trait allows customizing the “load” step on the lifecycle
of a module, which allows doing things like fetching modules from urls, having multiple
“modpaths” from where to import modules, or using Rust futures to avoid blocking the main thread
on loads.
More information:
Structs§
- A module loader that throws when trying to load any modules.
- ECMAScript’s Abstract module record.
- Module namespace exotic object.
- A simple module loader that loads modules relative to a root path.
- ECMAScript’s Synthetic Module Records.
- The initializing steps of a
SyntheticModule
.
Enums§
- The referrer from which a load request of a module originates.
Traits§
- Module loading related host hooks.