Home

Awesome

This repository hosts the JavaScript Loader Standard.

Code of conduct

We are committed to providing a friendly, safe and welcoming environment for all. Please read and respect the WHATWG Code of Conduct.

Status

A good chunk of this spec is out of date and is undergoing revision to realign it with Service Worker, the JS Realms API, and the dynamic import() feature.

Loader

Section 15.2 of the ES2015 specification describes the syntax for the new import and export declarations, but does not specify how modules are to be loaded. This repository consolidates work on the ECMAScript module loading semantics with the integration points of Web browsers, as well as Node.js.

The main spec is available at https://whatwg.github.io/loader, generated from the index.bs file.

Building the spec

Building the spec is a two-step process. First, the majority of the conversion work is done via Bikeshed. Second, we run a custom portion of the Ecmarkup pipeline to convert the algorithms from Ecmarkdown syntax into HTML, and to automatically add cross-references. This second step requires io.js to be installed.

Bikeshed

To run Bikeshed locally, install Bikeshed and then run bikeshed spec in the working directory.

Alternately, you can use the command

curl https://api.csswg.org/bikeshed/ -F file=@index.bs > index.tmp.html

to use Bikeshed's web interface without installing anything.

Ecmarkup

To run the Ecmarkup step, be sure you've done npm install in the root directory, then run

npm run ecmarkupify index.tmp.html index.html

Local Watch

If you have Bikeshed installed locally, and have run npm install, you can try running

npm run local-watch

to start a watcher on index.bs that will update index.html as you edit.

Implementation status

This spec is currently undergoing potentially-large redesigns (see #147 and #149) and is not ready for implementations. You can see one possible way to break down the work in our old roadmap document, but that does not reflect the latest changes.

Various browsers are implementing module syntax parsing and <script type="module"> loading (Firefox, Chrome, WebKit, Edge). However, none of them have begun work on the ideas prototyped here, since they are not ready for implementations yet.

Feedback

Please feel free to open a new issue, or send a pull request!