Fork me on GitHub
#clojurescript
<
2021-06-02
>
thheller06:06:58

@haywood as Alex said. check the tools.reader version, not the cljs version

haywood15:06:29

Not sure what :use-top means, but I assume it should all delegate to the 1.3.4 version below. How else can I debug? You wrote in a previous chat to start a clj repl and run “check `( "clojure/tools/reader__init.class")` to figure out the path of what is being used, but that doesn’t work for me, you did say “require it first” but I think that expression is missing a function in the archive?

clj -A:dev:test -Stree | grep tools.reader
    X org.clojure/tools.reader 1.0.0-beta1 :use-top
    X org.clojure/tools.reader 1.0.0-beta3 :use-top
    X org.clojure/tools.reader 1.3.2 :use-top
  X org.clojure/tools.reader 1.3.3 :use-top
      X org.clojure/tools.reader 1.3.2 :use-top
    X org.clojure/tools.reader 1.3.2 :use-top
        X org.clojure/tools.reader 0.7.2 :use-top
    X org.clojure/tools.reader 1.1.1 :excluded
      X org.clojure/tools.reader 1.1.1 :excluded
    X org.clojure/tools.reader 1.3.2 :excluded
    X org.clojure/tools.reader 1.3.2 :excluded
org.clojure/tools.reader 1.3.4
    X org.clojure/tools.reader 1.0.5 :use-top

thheller15:06:09

yes, run shadow-cljs clj-repl then ( "clojure/tools/reader__init.class")

thheller15:06:26

sometimes there are some bad AOT compiled versions on the classpath

haywood15:06:38

I think that helped me solve the problem, yea it was using a version from a nested dependency that I was able to exclude from the package I depend on

haywood15:06:00

that’s a great trick to figure it out 🙏:skin-tone-2: teach a man to fish etc etc. thank you

Pepijn de Vos09:06:08

I forget, does clojurescript have an "explode" operator? Like I can use & to collect arguments but how do I uncollect them?

thheller09:06:08

apply?

🎯 3
Pepijn de Vos09:06:40

This is in the context of reagent in this particular case, it's warning me I should add keys to a list that is very much static, just because I passed children with & to a component.

thheller09:06:24

(into [:div] children) or (into [:<>] children) if you don't want the extra div

Pepijn de Vos09:06:29

Hmmmm alllmost what I want. Basically I want

(defn foo [& args]
  (into [:div [:p "hi"]] args [:p "footer"]))

Pepijn de Vos09:06:07

Gets a bit ugly if you first conj footer into args but I guess it'd work..

thheller09:06:41

(defn foo [& args]
  (-> [:div [:p "hi"]]
      (into args)
      (conj [:p "footer"])))

👍 3
thheller09:06:24

(defn foo [& args]
  [:div
   [:p "hi"]
   (into [:<>] args)
   [:p "footer"]]))

thheller09:06:46

plenty of ways to do this 😛