martinklepsch / boot-garden

Boot task to compile Garden stylesheets.
Eclipse Public License 1.0
37 stars 6 forks source link

Recompilation is not triggered when changes are in dependent ns #3

Closed jeluard closed 9 years ago

jeluard commented 9 years ago

If styles-var refers styles defined in different namespace the recompilation will not happen. It will only triggers if changes are done in styles-var namespace.

jeluard commented 9 years ago

Note that this only happen when dependent namespaces are defined in cljc files.

martinklepsch commented 9 years ago
[18:30:51]  <weavejester>   martinklepsch: It relies on tools.namespace for that.
[18:31:05]  <weavejester>   martinklepsch: So if you have an older dependency overriding it, it won't load cljc
[18:31:38]  <weavejester>   martinklepsch: And tools.namespace doesn't currently support cljc files with reader conditionals in the ns declaration

Will release a new version with bumped ns-tracker dependency which should include [clojure.tools.namespace "0.2.10"] supporting .cljc namespace reloading.

More info: http://dev.clojure.org/jira/browse/TNS-34

martinklepsch commented 9 years ago

I just pushed [org.martinklepsch/boot-garden "1.2.5-4"] with the aforementioned changes. Please close if this fixes your issues. Also note:

And tools.namespace doesn't currently support cljc files with reader conditionals in the ns declaration

which needs to be solved upstream.

jeluard commented 9 years ago

I can confirm this fixes the example. Unfortunately my project use conditionals in the ns definitions thus still fails. Do you mind if I keep this open up until the upstream changes are available?

martinklepsch commented 9 years ago

No, seems like the right thing to do. Thank you.

martinklepsch commented 9 years ago

I have some local changes using tools.namespace 0.2.11-SNAPSHOT that fix this problem. Will cut a new release as soon as this is available in a final version.

jeluard commented 9 years ago

Now that 0.2.11 is out does it make sense to cut a release? Or shall we wait for a new ns-tracker release?

martinklepsch commented 9 years ago

New ns-tracker release would be ideal but since we have pods I'm happy to cut a release with 0.2.11 added to the pod. PR welcome. If you can't do it I might get to it in the next 7 days. On Tue 7 Jul 2015 at 20:57 Julien Eluard notifications@github.com wrote:

Now that 0.2.11 is out does it make sense to cut a release? Or shall we wait for a new ns-tracker release?

— Reply to this email directly or view it on GitHub https://github.com/martinklepsch/boot-garden/issues/3#issuecomment-119303281 .

jeluard commented 9 years ago

I created a simple PR with the new dependency.

Since then my use-case has changed and my styles-var ns doesn't reference directly namespaces containing the styles. Maybe there could be an option to force the CSS generation each time?

martinklepsch commented 9 years ago

An option to always recompile might make sense. I don't understand your described setup though — it does reference namespaces containing styles but not directly? Example might help :) On Wed 8 Jul 2015 at 04:26 Julien Eluard notifications@github.com wrote:

I created a simple PR with the new dependency.

Since then my use-case has changed and my styles-var ns doesn't reference directly namespaces containing the styles. Maybe there could be an option to force the CSS generation each time?

— Reply to this email directly or view it on GitHub https://github.com/martinklepsch/boot-garden/issues/3#issuecomment-119401378 .

jeluard commented 9 years ago

Sure! I have a set of components that define their style in their own namespace. All those styles are referenced in a separate namespace via a function that wraps all styles and add some common stuff.

In my dev setup I have a ref in yet another namespace that is the result of calling this previous function with some specific parameters (theme stuff).

This last ref is the one boot-garden watches. Ideally I want to have my component style changes to be picked up. That might sound cumbersome but I think it's not so uncommon in practice.

martinklepsch commented 9 years ago

I might be misunderstanding but isn't that exactly where ns-tracker should come into play, noticing when references to things might have changed?

martinklepsch commented 9 years ago

@jeluard a small example project would be great. lein new tenzing +garden can give you the boilerplate.

jeluard commented 9 years ago

You are right it looks like ns-tracker properly handles this case. Great stuff!