Fork me on GitHub
#cljs-dev
<
2020-04-21
>
dnolen13:04:06

@mfikes was there a specific reason the REPL doesn't print the version if it's synthetic?

mfikes13:04:45

No real compelling reason. It could print the number if useful.

mfikes13:04:06

It looks like 0.0.xyz which might be helpful

dnolen13:04:37

fixed in master

dnolen13:04:46

tools like Cursive uses this to detect the REPL type

dnolen13:04:11

so might as always emit - I was actually scratching my head for long time wondering why sometimes Cursive would detect other times not

dnolen13:04:23

the difference was ClojureScript git dep or not

frozar16:04:41

@dnolen Hi, I'm back about the cljs.analyzer.api/analyze-file failure on a file of the specter package. After a while, I'm able to propose you a synthetic example of the issue in the demo repo: https://github.com/frozar/cljdoc_specter_support The synthetic example is in essential.cljc:

(ns essential
  #?(:cljs (:require-macros
            [essential
              :refer
             [varialization]]))

  ;; The following line makes the difference. If this line is uncomment
  ;; the cljs.analyzer.api/analyze-file function will execute successfully
  ;; on essential.cljc
  ;; #?(:cljs (:use [cljs.core :only [coll?]]))
  )

#?(:clj
   (do
     (defmacro varialization
       [arg]
       `(var ~arg))
     ))

(defn simple []
  (varialization coll?))
With this file, you would get the weird message about the unresolvable coll? symbol. If you uncomment the (:use [cljs.core :only [coll?]]) header line, the analysis succeed. My interpretation is that, during the execution of analyze-file on essential.cljc, the environment doesn't involve the cljs.core namespace by default. So it doesn't find coll?. Questions: Is it true? If yes, is it intentional?

dnolen16:04:41

you need to analyze core first

frozar17:04:02

Hummm, OK, so I should analyse the core to update my environment and send it to the analyzer-file function, this is it?

dnolen17:04:06

I believe there's a with-core helper in the api

dnolen17:04:11

look for that

frozar17:04:55

Nice, thank you for your amazing reactivity 🙂