cljs-dev

weavejester 2026-04-19T17:39:12.381239Z

I've been looking at the compiler env structure, and I'm trying to use it to build up a topologically ordered sequence of includes. I can see the :cljs.closure/compiled-cljs key contains the compiled ClojureScript with their :provides and :requires, and likewise the :js-dependency-index contains the JavaScript files needed by the compilation (all the goog.* closure files). However, transit-cljs depends on transit-js, which is a Maven dependency that contains JS files. This seems to be missing from both the compiled-cljs and the js-dependency-index. This is problematic because the ClojureScript library cognitect.transit depends on the JavaScript com/cognitect/transit.js file, but the compiler environment doesn't seem to have information about the latter. Is there something I'm missing?

weavejester 2026-04-20T12:08:29.845669Z

I was wondering if I needed to do a filesystem lookup. Thanks again so much for your help - your insight into the ClojureScript build system is invaluable.

thheller 2026-04-20T06:01:10.299489Z

IIRC the js-dependency-index is populated by "known" previously declared JS files. For closure JS files there is a file that declares all of them. Otherwise the files are looked up by name, just like any other namespace. for cognitect.transit looks for cognitect/transit.(cljs|cljc|js)

thheller 2026-04-20T06:02:02.994089Z

in shadow-cljs I scan the classpath to look for any JS file ahead of time. that turned out to be a mistake and not useful at all. I mean a bit useful but scanning the classpath is not worth that tradeoff