{"action":"created","issue":{"url":"https://api.github.com/repos/emezeske/lein-cljsbuild/issues/362","labels_url":"https://api.github.com/repos/emezeske/lein-cljsbuild/issues/362/labels{/name}","comments_url":"https://api.github.com/repos/emezeske/lein-cljsbuild/issues/362/comments","events_url":"https://api.github.com/repos/emezeske/lein-cljsbuild/issues/362/events","html_url":"https://github.com/emezeske/lein-cljsbuild/issues/362","id":55418382,"number":362,"title":"reload loads incorrect files (reload too hungry)","user":{"login":"danskarda","id":1554681,"avatar_url":"https://avatars.githubusercontent.com/u/1554681?v=3","gravatar_id":"","url":"https://api.github.com/users/danskarda","html_url":"https://github.com/danskarda","followers_url":"https://api.github.com/users/danskarda/followers","following_url":"https://api.github.com/users/danskarda/following{/other_user}","gists_url":"https://api.github.com/users/danskarda/gists{/gist_id}","starred_url":"https://api.github.com/users/danskarda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danskarda/subscriptions","organizations_url":"https://api.github.com/users/danskarda/orgs","repos_url":"https://api.github.com/users/danskarda/repos","events_url":"https://api.github.com/users/danskarda/events{/privacy}","received_events_url":"https://api.github.com/users/danskarda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-25T15:03:55Z","updated_at":"2015-01-26T17:16:41Z","closed_at":null,"body":"New bug  was introduced by changes in reload logic in 1.0.4 (I guess in 5485e25bfa6c44cdf0e9d7cb106584915cec0616).\r\n\r\nThe problem is:\r\n1) cljsbuild once starts\r\n2) cljsbuild.compiler/reload-clojure hungrily loads all (!) .clj files it finds\r\n\r\nSide note: cljsbuild should not load all files it finds. First it slows down startup time. Second: there could be side effects!\r\n\r\n3) some files are not reachable (because they are on different path).\r\n4) cljsbuild throws multiple errors and user cries after upgrade\r\n\r\nPrior the patch I mentioned earlier, cljsbuild loaded only .clj files which included defmacro. Now this condition is gone so the issue become more visible.\r\n\r\nreload functionality should be improved in two ways\r\n\r\n1) do not reload anything before first compilation\r\n2) use standard solution to reload clj files. Use refresh from http://github.com/clojure/tools.namespace \r\n\r\nBug #360 seems to be caused by same reload problem. Unfortunately #361 fixes only one consequence, not the rootcause.\r\n"},"comment":{"url":"https://api.github.com/repos/emezeske/lein-cljsbuild/issues/comments/71497805","html_url":"https://github.com/emezeske/lein-cljsbuild/issues/362#issuecomment-71497805","issue_url":"https://api.github.com/repos/emezeske/lein-cljsbuild/issues/362","id":71497805,"user":{"login":"bhauman","id":2624,"avatar_url":"https://avatars.githubusercontent.com/u/2624?v=3","gravatar_id":"","url":"https://api.github.com/users/bhauman","html_url":"https://github.com/bhauman","followers_url":"https://api.github.com/users/bhauman/followers","following_url":"https://api.github.com/users/bhauman/following{/other_user}","gists_url":"https://api.github.com/users/bhauman/gists{/gist_id}","starred_url":"https://api.github.com/users/bhauman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhauman/subscriptions","organizations_url":"https://api.github.com/users/bhauman/orgs","repos_url":"https://api.github.com/users/bhauman/repos","events_url":"https://api.github.com/users/bhauman/events{/privacy}","received_events_url":"https://api.github.com/users/bhauman/received_events","type":"User","site_admin":false},"created_at":"2015-01-26T17:16:41Z","updated_at":"2015-01-26T17:16:41Z","body":"Nothing here will affect figwheel.  Actually I think this needs to be solved in figwheel as well.\r\n\r\nSo I totally agree about not reloading clj before first compilation in both `once` and `auto`.  These are resolved anyway and this is a source of problems.\r\n\r\nI think that it is fairly important for `auto` to output the same thing as `once`.  That means `auto` needs to reload clj files that have changed.\r\n\r\nI am not sure that cljsbuild needs to account for devs placing side effecting clj files, or clj files with unresolved deps on the cljsbuild watch paths.\r\n\r\nI don't think its over the top to expect devs to understand that if they put a clj file in a watch path it's going to get reloaded even if it's not required. So I think staying with simplicity of `load` solves the problem for the vast majority of the use cases.\r\n\r\nAdding a flag that says don't reload non-macro clj files could work.\r\n\r\n@cemerick ?\r\n"}}