Ah yes. What you want is something like "extern-lib" (not saying it will be
called that) - some way for you to include JS that won't get submitted to
advanced compilation yet which has externs to define.

Please open a ticket in JIRA for this.

David

On Thu, Feb 9, 2012 at 6:24 PM, Dave Sann <daves...@gmail.com> wrote:

> 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
>
>    1. Uncaught ReferenceError: jQuery is not defined
>       1. (anonymous function)
>
>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to