Clojurians
#cljs-dev
<
2015-12-17
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

richiardiandrea19:12:37

@dnolen: with @mfikes we were a bit brainstorming some addition to load-fn protocol if you are interested. Basically Mike observed that the :file key in :meta at the moment contains the namespace and in planck this is a sufficient way to fetch files. But what if load-fn in its map can return a :file-path key which then it will be added to the AST (or as Mike was saying) will set cljs.analyzer/*cljs-file* ? It would immensely simplify parts of replumb and I guess planck. Mike correct me if I said something wrong :smile:

dnolen19:12:31

@richiardiandrea: adding stuff to the AST should be the very last idea

dnolen19:12:50

there should be some way to accomplish what you want without mucking around with the AST

mfikes19:12:01

I suppose in “regular” ClojureScript, you end up with :file in the AST. In bootstrapped ClojureScript the value for this key is nil.

mfikes19:12:25

@dnolen: Perhaps the thought is that nothing new need to be added to the AST

dnolen19:12:29

so then the idea should be how to re-use something that’s already there

mfikes19:12:21

Yeah, the bootstrap API, in abstracting away from I/O, essentially leaves the :file value nil. Perhaps an experiment could be done to see if the API could be extended to allow clients to optionally provide the value to shove in there.

richiardiandrea19:12:52

well sometimes is a symbol isn't it?

richiardiandrea19:12:12

but yeah that would be the best, the environment knows what :file should be

dnolen19:12:19

anyways I’m sure you all can sort it out :simple_smile:

dnolen19:12:24

rule of thumb

dnolen19:12:26

don’t change anything

mfikes19:12:04

Yeah, @richiardiandrea I think perhaps we should try for an experiment, and obtain guidance from @dnolen along the lines of “don’t add to the AST”, etc.

dnolen19:12:10

but I’m fine with the bigger idea of getting the missing information in

richiardiandrea19:12:54

ok I can help on this, slowly, as it is my first peek at the AST :wink:

mfikes19:12:34

@dnolen: The conceptual idea: *load-fn* could call back with an extra key in its map, and cljs.js can take it and put it in the right place in the AST (instead of the nil that evidently makes its way in there).

mfikes19:12:59

@richiardiandrea: We could collaborate on a patch proposal if you’d like. That would ease you into the concept.

richiardiandrea19:12:00

Mike was even suggesting that :file can be extended to http:// etc...which is very intriguing :smile:

richiardiandrea19:12:10

yes Mike, definitely