Fork me on GitHub
#cljs-dev
<
2020-05-12
>
lilactown20:05:52

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

dnolen20:05:40

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

dnolen20:05:22

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

dnolen20:05:57

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

dnolen20:05:11

these are the key places where it happens

dnolen20:05:11

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

dnolen20:05:30

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

dnolen20:05:11

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

dnolen20:05:26

classpath stuff less relevant

lilactown20:05:55

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

lilactown20:05:18

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

lilactown20:05:43

thanks for taking a look

dnolen20:05:31

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

dnolen20:05:23

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

dnolen20:05:27

but we haven't generalized it beyond GCL

dnolen20:05:31

i.e. we should support indexing multiple GCL libs

dnolen20:05:57

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

dnolen20:05:08

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

dnolen20:05:18

like which version of JS etc.

dnolen20:05:22

deps.js tells you all that stuff

lilactown20:05:27

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

lilactown20:05:59

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

lilactown20:05:08

is that the idea?

lilactown20:05:21

(I'm trying to write up the ticket)

dnolen20:05:58

I think you can skip the details

dnolen20:05:06

it's feature request

dnolen20:05:23

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

dnolen20:05:49

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

dnolen21:05:25

implementation ideas etc. can go in comments