A polyfill providing low-level hooks for creating ES module loaders, supporting System.register and System.registerDynamic formats.
ES Module Loader Polyfill is a low-level polyfill that implements hooks for creating custom ES module loaders, based on the WhatWG loader specification with adjustments for HTML modules and NodeJS ES module adoption. It enables exact ES module loading semantics in current environments and supports linking ES and CommonJS modules while retaining their respective semantics.
JavaScript developers and tooling authors who need to build custom module loaders for environments lacking native ES module support, such as those creating build systems, development servers, or runtime loaders for browsers and Node.js.
Developers choose this project because it provides a fast, minimal, and unopinionated API for implementing custom loaders, with performance optimizations and support for System.register and System.registerDynamic formats to handle ES and CommonJS modules seamlessly.
Polyfill for the ES Module Loader
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks in the README show operations per second ranging from 654 to 16,536 for various loading scenarios, indicating optimized speed for module trees.
Provides a low-level loader API in core/loader-polyfill.js, allowing developers to build custom loaders without imposed constraints, as stated in the project philosophy.
Supports System.register for ES modules and System.registerDynamic for CommonJS, enabling exact linking semantics across different module types as detailed in the README.
Includes a simple tracing API when loader.trace is enabled, populating loader.loads with dependency maps and metadata useful for debugging and analysis.
Users must extend base classes and implement hooks like resolve and instantiate, demanding a deep understanding of module loading semantics and custom build steps.
The README admits differences from the WhatWG loader spec, such as using ModuleNamespace over Module.Status, which may lead to compatibility issues as specifications evolve.
Example loaders like browser-es-module-loader are demonstration-only, so production use requires significant custom development and integration effort.