Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Commit 0267ef1

Browse files
committed
Merge branch '0.11'
2 parents 062485b + fc4a49f commit 0267ef1

10 files changed

+27
-26
lines changed

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# ES6 Module Loader Polyfill [![Build Status][travis-image]][travis-url]
22

3-
Dynamically loads ES6 modules in NodeJS and current browsers.
3+
Dynamically loads ES6 modules in browsers and [NodeJS](#nodejs-usage) supporting custom module resolution and the loading of existing module formats from ES6 modules via a hookable pipeline.
44

5-
* Implemented exactly to the July 18 2014 ES6 specification draft.
65
* Provides an asynchronous loader (`System.import`) to [dynamically load ES6 modules](#basic-use).
76
* Uses [Traceur](https://github.com/google/traceur-compiler) for compiling ES6 modules and syntax into ES5 in the browser with source map support.
87
* Fully supports [ES6 circular references and bindings](#circular-references--bindings).
98
* Polyfills ES6 Promises in the browser with an optionally bundled ES6 promise implementation.
10-
* [Compatible with NodeJS](#nodejs-usage) allowing for server-side module loading and tracing extensions.
119
* Supports ES6 module loading in IE8+. Other ES6 features only supported by Traceur in IE9+.
1210
* The complete combined polyfill, including ES6 promises, comes to 9KB minified and gzipped, making it suitable for production use, provided that modules are [built into ES5 making them independent of Traceur](#moving-to-production).
1311

@@ -17,15 +15,21 @@ See the [demo folder](https://github.com/ModuleLoader/es6-module-loader/blob/mas
1715

1816
For an example of a universal module loader based on this polyfill for loading AMD, CommonJS and globals, see [SystemJS](https://github.com/systemjs/systemjs).
1917

20-
_The current version is tested against **[Traceur 0.0.72](https://github.com/google/traceur-compiler/tree/0.0.72)**._
18+
_The current version is tested against **[Traceur 0.0.79](https://github.com/google/traceur-compiler/tree/0.0.79)**._
2119

22-
_Note the ES6 module specification is still in draft, and subject to change._
20+
### Background
21+
22+
The ES6 specification defines a module system in JavaScript using `import` and `export` syntax. This syntax will be supported within the `<script type="module">` tag in the browser. For dynamically loading modules, a dynamic browser module loader was initially proposed for the ES6 module specification, and is now being developed as a browser specification.
23+
24+
The proposed dynamic loader API uses a global loader at `window.System` for importing modules dynamically and allows customisation of the ES6 lookup process including loading from other module formats.
25+
26+
This project implements the dynamic module loading through `System` exactly to the previous ES6-specified API at [2014-08-24 ES6 Specification Draft Rev 27](http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#august_24_2014_draft_rev_27), Section 15, and will continue to track changes as it is re-drafted as a browser specification (currently most likely to be at https://github.com/whatwg/loader).
2327

2428
### Basic Use
2529

26-
Download both [es6-module-loader.js](https://github.com/ModuleLoader/es6-module-loader/v0.9.4/dist/es6-module-loader.js) and traceur.js into the same folder.
30+
Download both [es6-module-loader.js](https://github.com/ModuleLoader/es6-module-loader/v0.11.0/dist/es6-module-loader.js) and traceur.js into the same folder.
2731

28-
If using ES6 syntax (optional), include [`traceur.js`](https://github.com/jmcriffey/bower-traceur/0.0.72/traceur.js) in the page first then include `es6-module-loader.js`:
32+
If using ES6 syntax (optional), include [`traceur.js`](https://github.com/jmcriffey/bower-traceur/0.0.79/traceur.js) in the page first then include `es6-module-loader.js`:
2933

3034
```html
3135
<script src="traceur.js"></script>
@@ -187,7 +191,7 @@ A basic example of using this extension with a build would be the following:
187191
traceur --out app-build.js app/app.js --modules=instantiate
188192
```
189193

190-
2. If using additional ES6 features apart from modules syntax, load [`traceur-runtime.js`](https://github.com/jmcriffey/bower-traceur/0.0.72/traceur-runtime.js) (also included in the `bin` folder when installing Traceur through Bower or npm). Then include `es6-module-loader.js` and then apply the register extension before doing the import or loading the bundle as a script:
194+
2. If using additional ES6 features apart from modules syntax, load [`traceur-runtime.js`](https://github.com/jmcriffey/bower-traceur/0.0.79/traceur-runtime.js) (also included in the `bin` folder when installing Traceur through Bower or npm). Then include `es6-module-loader.js` and then apply the register extension before doing the import or loading the bundle as a script:
191195

192196
```html
193197
<script src="traceur-runtime.js"></script>

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "es6-module-loader",
3-
"version": "0.10.0",
3+
"version": "0.11.0",
44
"description": "An ES6 Module Loader polyfill based on the latest spec.",
55
"homepage": "https://github.com/ModuleLoader/es6-module-loader",
66
"main": "dist/es6-module-loader-sans-promises.js",

dist/es6-module-loader-sans-promises.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es6-module-loader-sans-promises.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es6-module-loader-sans-promises.src.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ $__Object$create = Object.create || function(o, props) {
3737
/*
3838
*********************************************************************************************
3939
40-
Loader Polyfill
40+
Dynamic Module Loader Polyfill
4141
42-
- Implemented exactly to the 2014-07-18 Specification Draft.
42+
- Implemented exactly to the former 2014-08-24 ES6 Specification Draft Rev 27, Section 15
43+
http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#august_24_2014_draft_rev_27
4344
4445
- Functions are commented with their spec numbers, with spec differences commented.
4546
@@ -50,8 +51,6 @@ $__Object$create = Object.create || function(o, props) {
5051
5152
- Realm implementation is entirely omitted.
5253
53-
- Loader module table iteration currently not yet implemented.
54-
5554
*********************************************************************************************
5655
*/
5756

dist/es6-module-loader.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es6-module-loader.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es6-module-loader.src.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,9 +1262,10 @@ $__Object$create = Object.create || function(o, props) {
12621262
/*
12631263
*********************************************************************************************
12641264
1265-
Loader Polyfill
1265+
Dynamic Module Loader Polyfill
12661266
1267-
- Implemented exactly to the 2014-07-18 Specification Draft.
1267+
- Implemented exactly to the former 2014-08-24 ES6 Specification Draft Rev 27, Section 15
1268+
http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#august_24_2014_draft_rev_27
12681269
12691270
- Functions are commented with their spec numbers, with spec differences commented.
12701271
@@ -1275,8 +1276,6 @@ $__Object$create = Object.create || function(o, props) {
12751276
12761277
- Realm implementation is entirely omitted.
12771278
1278-
- Loader module table iteration currently not yet implemented.
1279-
12801279
*********************************************************************************************
12811280
*/
12821281

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "es6-module-loader",
33
"description": "An ES6 Module Loader shim",
4-
"version": "0.10.0",
4+
"version": "0.11.0",
55
"homepage": "https://github.com/ModuleLoader/es6-module-loader",
66
"author": {
77
"name": "Guy Bedford, Luke Hoban, Addy Osmani",

src/loader.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/*
22
*********************************************************************************************
33
4-
Loader Polyfill
4+
Dynamic Module Loader Polyfill
55
6-
- Implemented exactly to the 2014-07-18 Specification Draft.
6+
- Implemented exactly to the former 2014-08-24 ES6 Specification Draft Rev 27, Section 15
7+
http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#august_24_2014_draft_rev_27
78
89
- Functions are commented with their spec numbers, with spec differences commented.
910
@@ -14,8 +15,6 @@
1415
1516
- Realm implementation is entirely omitted.
1617
17-
- Loader module table iteration currently not yet implemented.
18-
1918
*********************************************************************************************
2019
*/
2120

0 commit comments

Comments
 (0)