From 9af485a584e47fd503ed5c62b9f6482574715f1e Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 10 Oct 2016 03:50:11 +0200 Subject: Squashed 'thirdparty/systemjs/' content from commit 5ed69b6 git-subtree-dir: thirdparty/systemjs git-subtree-split: 5ed69b6344e8fc1cd43bf758350b2236f57e1499 --- docs/es6-modules-overview.md | 108 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 docs/es6-modules-overview.md (limited to 'docs/es6-modules-overview.md') diff --git a/docs/es6-modules-overview.md b/docs/es6-modules-overview.md new file mode 100644 index 000000000..82f127548 --- /dev/null +++ b/docs/es6-modules-overview.md @@ -0,0 +1,108 @@ +## Background + +### Modules and Module Loaders + +A module is simply a JavaScript file written with module syntax. Modules _export_ values, which can then be _imported_ by other modules. + +[CommonJS](http://wiki.commonjs.org/wiki/CommonJS) and [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) JavaScript files are modules. + +A module loader provides the ability to dynamically load modules, and also keeps track of all loaded modules in a module registry. + +Typically, in production, the module registry would be populated by an initial compiled bundle of modules. Later in the page state, it may become necessary to dynamically +load a new module. This module can then share dependencies with the initial page bundle without having to reload any dependencies. + +Module code is treated differently to scripts due to the nature of exports and imports. +This is why the `