Skip to content

Instantly share code, notes, and snippets.

@dangoor
Created May 7, 2011 03:24
Show Gist options
  • Save dangoor/960170 to your computer and use it in GitHub Desktop.
Save dangoor/960170 to your computer and use it in GitHub Desktop.
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