Haven't tried yet the new modules compilation strategy, but I know a very good strategy available in the JS world with Browserify and its plugin factor-bundle. Basically, factor-bundle analyses all the emitted code and put in a single file every single module (written like node modules) that appears twice or more in the various emitted files into a single file. So there's never duplication of code.
Example: module A requires module B. module C requires modules B & D. You compile A & C. Browserify would output 3 files : A.js, C.js and another (custom name) common.js that would include modules B and D. It handles automatically the exposition of B and D so that anyone can "require" them. Result and benefits: A.html contain script tags for A.js and common.js. C.html contain script tags for B.js and the same common.js. So common.js is cacheable by browsers out the box, reducing the payload. The other benefit is that each page requires only 2 script tag. We're currently using this process in production, it's one of the best in the JS world. I think the idea is awesome, especially since it requires almost no configuration. Factor-bundle manages to find all common code by analysing the dependency graph. Since Google Closure Modules / CLJS namespace also create a dependency graph I'm pretty sure it's somehow possible. No ? -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
