[TNS-45] File in invalid path will mark namespace for reload Created: 13/Sep/16 Updated: 26/Sep/16
|Reporter:||Juho Teperi||Assignee:||Stuart Sierra|
Having a cljc file at path public/js/out/foo/bar.cljc with ns form (ns foo.bar) will result in namespace foo.bar being reloaded.
This is problematic because ClojureScript compiler will copy all the input files to :output-dir for source-map use. Lately as more libraries have started using cljc, and this has started causing problems in cases where library is used on Clojure env. Cljs compilation will result in reload of the library code, which can redefine protocols etc. and break the Clojure env.
I think it would make sense for tools.namespace to ignore changes where file path and namespace don't match.
|Comment by Juho Teperi [ 13/Sep/16 3:50 PM ]|
This is nearly the same to http://dev.clojure.org/jira/browse/TNS-24, but this case the inconsistently named ns will be reloade because there is a copy in the correct path.
|Comment by Juho Teperi [ 18/Sep/16 10:00 AM ]|
Proposed patch with a test.
find-sources-in-dir is the easiest place to do the check, because we need the directory path.
|Comment by Juho Teperi [ 26/Sep/16 6:43 AM ]|
Fixed a typo on the patch.