bhauman / lein-figwheel

Figwheel builds your ClojureScript code and hot loads it into the browser as you are coding!
Eclipse Public License 1.0
2.88k stars 210 forks source link

Figwheel eating namespace metadata? #707

Closed gnl closed 6 years ago

gnl commented 6 years ago

Ghostwheel is using namespace metadata for its configuration and that doesn't seem to get picked up when using Figwheel. It works fine with Shadow CLJS.

I'm accessing the namespace metadata via (-> &env :ns :meta). I tried to take a look at the environment with this macro:

(defmacro print-env []
  `(clog (quote ~&env)))

Which works fine with shadow, but this is what happens with Figwheel:

dev:re-frame-playground.ghostwheel=> (g/print-env)
----  Could not Compile    ----

  failed compiling constant: clojure.lang.Atom@59115a81; class clojure.lang.Atom is not a valid ClojureScript constant.

----  Compiler Error  ----

Any thoughts?

gnl commented 6 years ago

Fixed it. I was accessing the namespace metadata in a weird way (because it makes runtime debugging of Ghostwheel's code generation easier), but apparently that only works on Shadow. (meta *ns*) works everywhere.

Except for this CLJS issue, where it looks like the build must be cleaned for changes in ns metadata to be picked up: https://dev.clojure.org/jira/browse/CLJS-1926

My preliminary testing confirmed that this is a problem.