You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a project that is attempting to provide a portable API for both Clojure and ClojureScript, any overlapping aliases in conjunction with lein-cljsbuild's reload-clojure function will produce a ClojureScript compilation failure.
In short, reload-clojure loads any Clojure files that are on its :source-paths, and because the ClojureScript compiler reuses the Clojure reader, the former creates any namespaces that have aliases defined, in order for the latter can properly resolve namespaced keywords. So, if Clojure and ClojureScript files are on lein-cljsbuild's :source-path that create analogous namespaces with identical aliases (roughly unavoidable if one is using a tool like cljx or lein-dalap to produce a portable API), ClojureScript compilation will always fail.
A partial "fix" would be to have reload-clojure be called only if lein-cljsbuild is in "auto" mode, watching for source changes, but perhaps there's a smarter, more general solution?
The text was updated successfully, but these errors were encountered:
This issue seems to be resolved as of clojurescript 2202 and is certainly not present in the current release 2411. There is no longer a need to not reload non macro .clj files in cljs source directories.
Given a project that is attempting to provide a portable API for both Clojure and ClojureScript, any overlapping aliases in conjunction with lein-cljsbuild's
reload-clojure
function will produce a ClojureScript compilation failure.In short,
reload-clojure
loads any Clojure files that are on its:source-paths
, and because the ClojureScript compiler reuses the Clojure reader, the former creates any namespaces that have aliases defined, in order for the latter can properly resolve namespaced keywords. So, if Clojure and ClojureScript files are on lein-cljsbuild's:source-path
that create analogous namespaces with identical aliases (roughly unavoidable if one is using a tool like cljx or lein-dalap to produce a portable API), ClojureScript compilation will always fail.A minimal testcase is available here.
A partial "fix" would be to have
reload-clojure
be called only if lein-cljsbuild is in "auto" mode, watching for source changes, but perhaps there's a smarter, more general solution?The text was updated successfully, but these errors were encountered: