@lilactown shadow-cljs should be fine with goog.module
I think it was the "vanilla" CLJS compiler that I ran into issues
and I didn't want my lib to be shadow-cljs only 😄
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
this is interesting. I wonder if it has any good use-cases in the shadow world? https://evanw.github.io/source-map-visualization/
would be useful but I still get "invalid source map" for some maps although they work fine in the browser
previously used https://sokra.github.io/source-map-visualization/
same issue and had issues with bigger source maps
shame but good to know 🙂
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
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.
I would try using this tool to search your clojure code with spec: https://github.com/borkdude/grasp
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 thisOh and your watch function needs this metadata:
(defn watch
{:shadow/requires-server true}
...
Thanks for the link to grasp, haven't seen this before.
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.
This is why I don't do it that way: https://clojurians-log.clojureverse.org/shadow-cljs/2019-10-08/1570556850.403100
thanks for sharing this, it gives quite a lot of insight