Fork me on GitHub

Is there any examples of libraries made using shadow-cljs ?


@heefoo you cannot currently publish libs with shadow-cljs. need another tool for that, I use lein. no need to compile anything, just need to publish the source files themselves


so basically only need a project.clj with :dependencies and :source-paths. nothing else.


@thheller thanks. Do you have any examples of apps ?


I havent done any lib writitng but if i remember correctly there are other entries in project.clj i should have for a lib project


(defproject my-lib "0.1.0"
  :description "FIXME: write description"
  :url ""
  :license {:name "Eclipse Public License"
            :url ""}
  :dependencies [[some/thing "1.2.3"]]
  :source-paths ["src/main"])


lein deploy clojars


no need to depend on clojurescript or shadow-cljs in the lib itself


just continue using shadow-cljs.edn for everything else and just use project.clj for publishing


I'm working on an npm module written with shadow cljs


That way the lib is usable for Js or clojure easily


Hi! I have a “library” for my Fulcro project in the main directory, i.e. src/main/my_project/core/lib.cljc. I would like to test it using devcards, so I created a file src/cards/my_project/core/lib.cljs (mirroring the main tree). I thought I would be apple to access methods define in my lib.cljc file but it looks like it’s not getting compiled as part of shadow-cljs watch cards. How can I remedy this? (I am posting my question here as well as on #fulcro as I think the answer is shadow-related)


I solved the problem by renaming my cards namespace to lib_cards, after which I could import the core/lib.cljc namespace and take it from there. I would rather have both share the same namespace though, so my question still stands 🙂


@hmaurer 2 files can't share the same namespace. that is only allowed if one is a macro namespace.


@thheller I had two files shared the same namespace, which didn’t work, so I renamed them. But now I’m getting “undefined function” errors everywhere. I assume this is a cache issue? (aka I should clear .shadow-cljs)?


yep it was a cache error; clearing it fixed it

koala punch20:12:49

hi, i’m having some trouble getting dirac to work with shadowcljs

koala punch20:12:51

anyone have any luck with this?

koala punch21:12:23

i think some sort of middleware being loaded by shadow is conflicting with the dirac one

koala punch21:12:28

We detected unexpected middleware setup in your nREPL server at <nrepl://localhost:8230>!