Closed tolitius closed 8 years ago
boot.user=> (start-repl)
cljs.user=> (require-macros '[mount.core :refer [defstate]])
nil
cljs.user=> (defstate a :start 42)
clojure.lang.ExceptionInfo: Unable to resolve var: cleanup-if-dirty in this context at line 1 <cljs repl> {:file "<cljs repl>", :line 1, :column 1, :tag :cljs/analysis-error}
cljs.user=> (require '[mount.core :as mount])
nil
cljs.user=> (defstate a :start 42)
#'cljs.user/a
looks like client sources are simply compiled before mount sources. once mount is "looked at" by compiler once, all is good: i.e. (require '[mount.core])
at the entry level of the application should solve this.
most likely has to do with defstate
being compiled at the earlier compilation stage (i.e. hence :require-macros
)
a transparent mount compilation needs more thinking (i.e. ship an aot
compliment jar, etc.), but at this point definitely needs to be documented.
0.1.9
refactors defstate
macro in a way that it no longer calls private functions directly.
thanks to @frankhenderson for reporting this. his sample project that confirms the behavior.