I agree this would be a really great feature. There used to be a similar facility part of lein-cljsbuild allowing to package both the externs and eventual JS dependencies (see [1]) but it does not work anymore.
Maybe something equivalent could be part of the clojurescript compiler? There already are some projects packaging externs and JS files (see [2]) so it would be a matter of defining a convention. It could also be an opportunity to remove the need to rely on :preamble for non closure dependencies. This would allow the creation of self-contained libraries and would greatly lower the barrier of using clojurescript libraries with dependencies. [1] https://github.com/jeluard/cljs-ol3js/tree/master/resources/closure-js [2] https://github.com/swannodette/react-cljs/tree/master/src/react 2014-11-10 8:37 GMT-03:00 Nikita Prokopov <[email protected]>: > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/clojurescript. > -- 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.
