Skip to content

Instantly share code, notes, and snippets.

@dangoor
Created May 7, 2011
Embed
What would you like to do?
JS.next modules - no loader required
// LABjs style
<script src="js/LAB.min.js"></script>
<script>
$LAB
.script("underscore.js")
.script("jquery.js")
.script("mycode.js")
.wait(function() {
//do something
});
</script>
// vs.
// JS.next proposed style
// http://wiki.ecmascript.org/doku.php?id=harmony:modules
<script type="text/es6">
module _ = require("underscore.js");
module $ = require("jquery.js");
module mycode = require("mycode.js");
// do something
</script>
// Note that by simply listing all of the scripts we need
// right here in the HTML file as we would for LABjs, they can be
// loaded in parallel by the browser.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment