Skip to content

Commit

Permalink
fix reloading of clj files in cljs dirs
Browse files Browse the repository at this point in the history
cljsbuild “auto” produces different results than “once” if a clj file
that is a dependency of a clj based macro file.  This is because
non-macro clj files are not reloaded on change.

The issue behind #210
appears to have been resolved as of clojurescript 2202.

I removed the guard that only allows .clj files that contain macros to
be reloaded.  I have tested this and it works pretty darn good :)
  • Loading branch information
Bruce Hauman committed Dec 12, 2014
1 parent 76ba940 commit 5485e25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion support/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
:distribution :repo}
:dependencies
[[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2197"
[org.clojure/clojurescript "0.0-2411"
:exclusions [org.apache.ant/ant]]
[fs "1.1.2"]
[clj-stacktrace "0.2.5"]]
Expand Down
8 changes: 1 addition & 7 deletions support/src/cljsbuild/compiler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,7 @@
; not affect any cljs file mtimes, we have to clear the cache here to force everything
; to be rebuilt.
(fs/delete-dir (:output-dir compiler-options))
(doseq [path paths
; only Clojure files that define macros can possibly affect
; ClojureScript compilation; those that don't might define the "same"
; namespace as a same-named ClojureScript file, and thus interfere
; with cljsc's usage of Clojure namespaces during compilation. gh-210
:when (-> path (string/replace #"^/" "") io/resource
^String slurp (.contains "defmacro"))]
(doseq [path paths]
(try
(load (drop-extension path))
(catch Throwable e
Expand Down

0 comments on commit 5485e25

Please sign in to comment.