ring icon indicating copy to clipboard operation
ring copied to clipboard

require syntax causes wrap-reload not to reload some namespaces

Open leroix opened this issue 9 years ago • 6 comments

I have a project where core.clj requiring looks something like this:

(:require 
            ...
            [rafl.ui-backend
             [api-proxy :as api]
             (apis :as apis)
             (config :refer [config])
             (auth :as auth :refer [ensure-auth-session])
             (raflapi :as raflapi)
             (hooahyoo :as hooahyoo)
             (entries :as entries)
             (filemaker :as filemaker)]
            [rafl.ui-backend.templates
             (index :as index)])

This [namespace (subnamespace1 :as x) (subnamespace2 :as y) ...] syntax seems to cause certain namespaces not to reload. For instance, core.clj reloads fine. However, a change to raflapi.clj is not reloaded. If, after changing raflapi.clj, I change core.clj, the change in raflapi.clj gets reloaded. I couldn't figure out a pattern that governed which namespaces would be reloaded properly.

[Fix] Flattening the require syntax causes all namespaces to be reloaded properly.

leroix avatar Jan 27 '16 17:01 leroix

What happens if you use vectors instead of lists? e.g. [filemaker :as filemaker] instead of (filemaker :as filemaker)?

weavejester avatar Jan 27 '16 17:01 weavejester

Nope, that doesn't seem to fix the problem.

leroix avatar Jan 27 '16 17:01 leroix

Does adding the [org.clojure/tools.namespace "0.2.11"] dependency to your project fix the issue?

weavejester avatar Jan 27 '16 17:01 weavejester

I guess I should also add that I'm using ring-core version 1.3.2 which is using 0.2.2 of ns-tracker.

Working on testing your suggestion.

leroix avatar Jan 27 '16 17:01 leroix

Adding [org.clojure/tools.namespace "0.2.11"] doesn't seem to change anything.

leroix avatar Jan 27 '16 17:01 leroix

This issue might require some code changes to ns-tracker. Sounds like it's not accounting for something.

weavejester avatar Jan 27 '16 23:01 weavejester