Maybe - but I don't think so.
I tested with jquery this morning - to try and re-confirm - details appended at the end of this post
I think that this falls into the:
"If the library you want to use simply doesn't work with advanced compilation...." at the bottom of the link you added
My understanding is as follows - please correct me if I have this wrong.
:foreign-libs are included in the build and are optimised with it.
:externs does not apply to any :foreign-libs - only if you include the lib separately (which has no namespace)
so, in advanced mode, var/function names are mangled.
If you just want to include the code - and it runs in its own world - you may see some warnings, but this works fine
but references to vars/functions in the library from clojurescript will not work.
Which, I think means pretty much any non-gclosure library in advanced mode.
Dave
-----
Test with jquery
with and without :externs, in :simple and :advanced.
jquery - intentionally not referenced externally in the page.
using
{
:optimizations :advanced
:externs ["resources/js/jquery-externs.js"]
:foreign-libs [{:file "resources/js/jquery.1.7.1.min.js" :provides ["jquery"]}]
}
the libs in:
resources/js/jquery-externs.js
resources/js/jquery.1.7.1.min.js
main.cljs calls:
(.log js/console (js/JQuery "body"))
respectively.
in simple: Ok
In advanced:
compiles with warnings
in the browser when referencing js/jQuery
- Uncaught ReferenceError: jQuery is not defined
(anonymous function)