Created
May 7, 2011 03:24
-
-
Save dangoor/960170 to your computer and use it in GitHub Desktop.
JS.next modules - no loader required
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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