cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
2020-06-06T06:23:53.232400Z

2020-06-06T06:29:01.234400Z

If I add a npm-deps map to my package, it works as expected. When my package doesn't have npm-deps in its config, but it depends on a package that does I get that error. And as soon as I add some npm-deps in my current package, it all works as expected. And I pulled down ClojureScript at commit for v1.10.773 and if I change this:

(merge
       {:hashbang      false
        :infer-externs true
        :nodejs-rt     false
        :target        :nodejs}
       (when-not (:npm-deps opts)
         {:npm-deps true}))
to this:
(merge
       {:hashbang      false
        :infer-externs true
        :nodejs-rt     false
        :target        :nodejs}
       (when-not (:npm-deps opts)
         {:npm-deps {}}))
It fixes it. If I change it back to true, I get the error again. On a quick glance, this seems like a safe change, everything else in closure.clj seems to assume npm-deps will be a map, except for one (not (false? npm-deps)) check, but this will work as well in this case, since it is explicit about checking for not false? instead of true?. It also means this is now redundant:
(defn check-npm-deps [{:keys [npm-deps]}]
  (let [npm-deps (if (true? npm-deps) {} npm-deps)

dnolen 2020-06-06T16:35:20.234800Z

@didibus try master

baptiste-from-paris 2020-06-06T18:35:31.235900Z

Hello friends, I was looking at clojurescript code base and I was wondering why cljs compiler does not use clojure.tools.analyzer as it uses tools.reader. Thanks a lot