Fork me on GitHub
#shadow-cljs
<
2018-12-29
>
heefoo09:12:19

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

thheller09:12:31

@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

thheller09:12:56

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

heefoo09:12:58

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

heefoo09:12:53

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

thheller09:12:22

(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"])

thheller09:12:26

lein deploy clojars

thheller09:12:27

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

thheller09:12:47

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

ahungry17:12:26

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

ahungry17:12:47

That way the lib is usable for Js or clojure easily

hmaurer19:12:17

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)

hmaurer19:12:16

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 🙂

thheller19:12:35

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

hmaurer19:12:44

@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)?

hmaurer19:12:23

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>!