Fork me on GitHub
#shadow-cljs
<
2021-01-06
>
thheller00:01:43

@lilactown shadow-cljs should be fine with goog.module

lilactown00:01:00

I think it was the "vanilla" CLJS compiler that I ran into issues

lilactown00:01:23

and I didn't want my lib to be shadow-cljs only 😄

lilactown00:01:17

which, I never finished it anyway. If I pick it back up I'll probably rewrite the TS code in CLJS. I thought it was a neat experiment to see if I could get easy interop between TS and CLJS

steveb8n03:01:07

this is interesting. I wonder if it has any good use-cases in the shadow world? https://evanw.github.io/source-map-visualization/

steveb8n03:01:19

I struggle a bit with source maps when using closure and ncc together. probably unrelated to the value of this tool but mentioning it in case others have similar challenges

thheller09:01:02

would be useful but I still get "invalid source map" for some maps although they work fine in the browser

thheller09:01:59

same issue and had issues with bigger source maps

steveb8n09:01:10

shame but good to know 🙂

Pavel KlavĂ­k16:01:36

Hi, what is the easiest way to look for all occurances of all keywords with certain ns in my CLJS code, and to use this list for constructing CSS using Garden? I would like to get hot code reloading for it, so when I modify CLJS code, Garden should recompile as well.

isak17:01:24

I would try using this tool to search your clojure code with spec: https://github.com/borkdude/grasp

isak17:01:54

Oh, and for the file-watching part, you'd just create a script using a file-watching library (like juxt/dirwatch), and then set up your file watching, then call shadow.cljs.devtools.api/watch programatically. Then, instead of running the watch task:

yarn shadow-cljs run dev/watch
Where src/dev.clj has a watch function that does this

isak17:01:30

Oh and your watch function needs this metadata:

(defn watch
  {:shadow/requires-server true}
  ...

Pavel KlavĂ­k20:01:00

Thanks for the link to grasp, haven't seen this before.

Pavel KlavĂ­k20:01:21

This sounds like a possible solution to set everything up on my own, but I am not convinced it is the easiest one. I could imagine using Shadow-cljs hooks which would call this code search on all modified files and dump stuff somewhere where it can be picked by Garden file watcher.

Pavel KlavĂ­k22:01:08

thanks for sharing this, it gives quite a lot of insight

3