I was told something about js module
framework two years ago. But without a deep dive into it, so that I have to ride
out large bundles of js files in a mess on our projects for a long time. After kejun’s
YUI presentation on D2 2009, I thought that it’s time to change.
Why use js module?
1, better js organization, readable + flexible
+ dependencies ordering
2, better performance, asynchronize loading
JIT
How we did it before?
1, inline script in jsp : hard to unittest,
make the file looks tedious and ugly
2, separated js script file: bad
organization, too many ugly import tag <script>
What is the existed solution?
1, YUI module: http://developer.yahoo.com/yui/yuiloader/
2, Jawr: a tunable packaging solution for
Javascript and CSS written in java
3, jQuery getSscript: http://ejohn.org/blog/degrading-script-tags/
4, jspkg: http://jspkg.sourceforge.net/docs/index.html
5, module.js http://ajaxian.com/archives/modulesjs-a-new-stand-alone-javascript-module-loader
to do ...