cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
lilactown 2020-05-12T20:17:52.352600Z

is there a relevant part of the clojurescript codebase that I could start spelunking in?

dnolen 2020-05-12T20:19:40.353100Z

so the way it works for Google Closure Library (GCL)

dnolen 2020-05-12T20:20:22.354Z

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

dnolen 2020-05-12T20:20:57.354600Z

in the case of a user lib that information might be missing but it could of course be trivially inferred

dnolen 2020-05-12T20:24:11.356100Z

these are the key places where it happens

dnolen 2020-05-12T20:25:11.356500Z

@lilactown in your case you're producing a bunch of output from TS

dnolen 2020-05-12T20:25:30.357Z

Closure has a feature to produce a deps.js for sources though the details have changed over time

dnolen 2020-05-12T20:27:11.358100Z

@lilactown I think really in your case all we need is to support multiple GCL-like "roots" so to speak

dnolen 2020-05-12T20:27:26.358300Z

classpath stuff less relevant

lilactown 2020-05-12T20:30:55.359400Z

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

lilactown 2020-05-12T20:31:18.359800Z

I’m on-call this week so probably won’t get to it, but maybe over the weekend I can take a look

lilactown 2020-05-12T20:31:43.360Z

thanks for taking a look

dnolen 2020-05-12T20:33:31.360300Z

yeah it's actually not that complicated but probably a lot of unfamiliar things

lilactown 2020-05-12T20:39:57.360500Z

is this issue relevant? https://clojure.atlassian.net/browse/CLJS-1543

dnolen 2020-05-12T20:43:23.360800Z

right that's the old one, like I said most of the changes are already in place

dnolen 2020-05-12T20:43:27.361Z

but we haven't generalized it beyond GCL

dnolen 2020-05-12T20:44:31.361600Z

i.e. we should support indexing multiple GCL libs

dnolen 2020-05-12T20:44:57.362100Z

instead of be classpath based, we could depend on the presence of deps.js

dnolen 2020-05-12T20:45:08.362400Z

there's a lot of stuff we'd rather not care about

dnolen 2020-05-12T20:45:18.362700Z

like which version of JS etc.

dnolen 2020-05-12T20:45:22.363Z

deps.js tells you all that stuff

lilactown 2020-05-12T20:50:27.363700Z

so for instance, if I'm developing a library that ships some Closure JS with goog.module

lilactown 2020-05-12T20:50:59.364400Z

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

lilactown 2020-05-12T20:51:08.364700Z

is that the idea?

lilactown 2020-05-12T20:51:21.364900Z

(I'm trying to write up the ticket)

dnolen 2020-05-12T20:58:58.365500Z

I think you can skip the details

dnolen 2020-05-12T20:59:06.365800Z

it's feature request

dnolen 2020-05-12T20:59:23.366300Z

you'd like to be able to use generated tsickle output which outputs goog.module

dnolen 2020-05-12T20:59:49.367100Z

ClojureScript has the ability to handle it, but currently it's hardcoded to GCL

dnolen 2020-05-12T21:00:25.367700Z

implementation ideas etc. can go in comments

lilactown 2020-05-12T21:01:48.367900Z

cool

lilactown 2020-05-12T21:02:19.368100Z

https://clojure.atlassian.net/browse/CLJS-3250

dnolen 2020-05-12T21:05:32.368300Z

thanks!!