Hey,

the feature already exists like I mentioned on github. I'm just not sure about 
its state since it is "marked" experimental [1]. I'm not sure how it came into 
existence or what the backstory was but if I understand the code correctly you 
are supposed to include a deps.cljs in your .jar which contains something like

{:externs ["my/externs.js"]} where my/externs.js is also included in your .jar 
so everything is available via the classpath.

Not sure how well this solution works since you might run into conflicts if 2 
libraries provide similar externs. Not sure how Closure handles this sort of 
conflict.

The feature was introduce in February 2012, maybe the original authors can 
chime in here.

Cheers,
/thomas

[1] 
https://github.com/clojure/clojurescript/blob/9fd6bf5bd55421c3d5becacc5230ed661d6fb3c3/src/clj/cljs/closure.clj#L838

PS: the feature probably won't work with shadow-build currently, need to look 
into that.

On Monday, November 10, 2014 12:37:26 PM UTC+1, Nikita Prokopov wrote:
> Hi!
> 
> Right now lein-cljsbuild allows for externs to be specified on user side. 
> E.g. I’m building app with react-cljs, I add dependency, but there’s also a 
> second step: I need to put :externs ["react/externs/react.js"] into _my_ 
> project.clj.
> 
> This is tedious and easy to forget, leading to a lot of confusion (I 
> developed for 2 month and everything was fine, then I turn on advanced build 
> and nothing works).
> 
> On the other hand, conceptually, externs are part of a library, not my user 
> code. So, if library author thinks his library needs externs, he specifies it 
> and packs externs along with library code, and they’re automatically used 
> when I add dependency. So as a user I don’t manage external deps’ externs at 
> all. As Thomas Heller puts it, it might be [a quality of life 
> change](https://github.com/tonsky/datascript/issues/30#issuecomment-62253696).
> 
> Any thought on it? Maybe there’s already a way to do that?
> 
> Nikita.

-- 
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 clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to