3 ms·
You annotate methods in Google-JS-Closure with @public, @protected, and @private in comments. Public methods get unmangled symbols. Everything else gets rename
by cbhl 11y ago
You annotate methods in Google-JS-Closure with @public, @protected, and @private in comments.
Public methods get unmangled symbols. Everything else gets renamed to a short name to save bandwidth.
Dependencies are specified with goog.require.
Anything that doesn't get required with goog.require or isn't called by a public function gets culled.
- nostrademons 11y agoYou can also define a separate externs file with a list of symbols that shouldn't get mangled; this is useful if eg. you're using a third-party library that you don't want to modify.
- euroclydon 11y agoWhile your integrating Closure Compiler's Advanced Mode, you might as well re-write your entire client side code... Because you'll likely have to.
- jwr 11y agoWell, it's something we should look at, especially the library makers. People who write ClojureScript regularly encounter this: we get this optimized and trimmed down app, and then something needs jQuery, so we have to pull all of it in. After you've used advanced compilation for a while, it feels downright dirty and wasteful to pull in entire blobs of code, not just the function trees you actually need.