is there a relevant part of the clojurescript codebase that I could start spelunking in?
so the way it works for Google Closure Library (GCL)
we look at goog/deps.js
if the entry has module: "goog"
we make sure that info is in the index we create for Closure Library
in the case of a user lib that information might be missing but it could of course be trivially inferred
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/js_deps.cljc#L119
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/js_deps.cljc#L325-L350
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/js_deps.cljc#L347
these are the key places where it happens
@lilactown in your case you're producing a bunch of output from TS
Closure has a feature to produce a deps.js
for sources though the details have changed over time
https://github.com/cognitect/transit-js/blob/master/bin/closure_deps_graph.clj
@lilactown I think really in your case all we need is to support multiple GCL-like "roots" so to speak
classpath stuff less relevant
I’m not sure I completely understand 😛 I haven’t loaded all of the context into my head. It’s my first time looking at the CLJS <-> GCC integration
I’m on-call this week so probably won’t get to it, but maybe over the weekend I can take a look
thanks for taking a look
yeah it's actually not that complicated but probably a lot of unfamiliar things
is this issue relevant? https://clojure.atlassian.net/browse/CLJS-1543
right that's the old one, like I said most of the changes are already in place
but we haven't generalized it beyond GCL
i.e. we should support indexing multiple GCL libs
instead of be classpath based, we could depend on the presence of deps.js
there's a lot of stuff we'd rather not care about
like which version of JS etc.
deps.js
tells you all that stuff
so for instance, if I'm developing a library that ships some Closure JS with goog.module
I would include a deps.js
on the classpath, that would note some metadata that would tell CLJS to process my JS files as modules
is that the idea?
(I'm trying to write up the ticket)
I think you can skip the details
it's feature request
you'd like to be able to use generated tsickle
output which outputs goog.module
ClojureScript has the ability to handle it, but currently it's hardcoded to GCL
implementation ideas etc. can go in comments
cool
thanks!!