shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
thheller 2021-01-06T00:42:43.342200Z

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

lilactown 2021-01-06T00:44:00.342500Z

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

lilactown 2021-01-06T00:44:23.342900Z

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

lilactown 2021-01-06T00:45:17.343800Z

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

steveb8n 2021-01-06T03:05:07.347500Z

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

thheller 2021-01-06T09:30:02.347900Z

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

thheller 2021-01-06T09:30:44.348100Z

previously used https://sokra.github.io/source-map-visualization/

thheller 2021-01-06T09:30:59.348300Z

same issue and had issues with bigger source maps

steveb8n 2021-01-06T09:41:10.348500Z

shame but good to know 🙂

steveb8n 2021-01-06T03:06:19.347600Z

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

2021-01-06T16:36:36.350100Z

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.

isak 2021-01-06T17:35:24.350200Z

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

isak 2021-01-06T17:49:54.350500Z

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

isak 2021-01-06T17:51:30.350700Z

Oh and your watch function needs this metadata:

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

2021-01-06T20:51:00.350900Z

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

2021-01-06T20:52:21.351100Z

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.

isak 2021-01-06T22:10:56.351300Z

This is why I don't do it that way: https://clojurians-log.clojureverse.org/shadow-cljs/2019-10-08/1570556850.403100

2021-01-06T22:40:08.351600Z

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

1