Hi Maarten, Your email has finally given me the push to track this down.
Can you please give this version a try: https://github.com/lbradstreet/cljx (git clone, lein install and then change your version to 0.4.1-SNAPSHOT). I'm hoping that there are no dependency issues that were the reason for processing all the files on every save. Your cljs compilation will now be faster and will only occur once. This also fixes double test-refresh runs, which use a similar mechanism. I'll be trying it out. Please do the same and I'll create a PR to the main cljx repo. Cheers, Lucas @ghaz On 23 September 2014 21:36, Lucas Bradstreet <[email protected]> wrote: > Things are working pretty much identically for me and I'm quite sure > it's because of running cljx auto in parallel to cljsbuild auto and > will not occur when you save a cljs (non cljx) file. > > What I believe is happening is: > > 1. cljx is triggered by save of a cljx file > 2. cljx generates new cljs (and clj) versions of every cljx file > (unsure if this is necessary or implemented this way because it's > easier). > 3. These trigger cljsbuild auto before all of the cljs files have been > generated by cljx. > 4. cljsbuild auto is again triggered by the remaining files. > > Step 2. is also why you see long compilation files, as it is > rebuilding all of the newly generated cljs files, even though you have > only changed one file. > > By the way, I have a trick to improve the delay before recompilation > occurs, as the interaction between the 1000ms delay for each cljsbuild > and cljx can lead to a maximum 2s delay before cljsbuild runs. > > In my lein profiles :injections section: > > ; mess with watchtower internals so that we can > ; auto check for updated files more frequently > ; and cljx / cljsbuild > (require 'watchtower.core) > (alter-var-root #'watchtower.core/rate > (fn [_] > (fn [w _] > (assoc w :rate 50)))) > > Unfortunately, this makes it all but certain that you will get two > cljsbuild compilations every time, and it doesn't solve the > unnecessarily long cljs build times. > > I think the long term solution is for cljx auto to only generate new > cljs/clj files for only the changed file. > > Lucas > > On 22 September 2014 22:36, Alan Moore <[email protected]> wrote: >> Do you have a lein cljs auto running in the background? >> >> Alan >> >> -- >> Note that posts from new members are moderated - please be patient with your >> first post. >> --- >> You received this message because you are subscribed to the Google Groups >> "ClojureScript" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/clojurescript. -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
