emezeske/lein-cljsbuild

Trivial change in CLJC file causes recompile of all CLJS files

Open

#457 aperta il 19 gen 2017

Vedi su GitHub
 (0 commenti) (2 reazioni) (0 assegnatari)Clojure (153 fork)batch import
Help Wanted

Metriche repository

Star
 (1096 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

In a fairly large project I am working on, I have a separate source folder with .CLJC-files that are shared between the frontend (Clojurescript) and backend (Clojure).

I noticed that making a trivial change in a CLJC file (e.g., adding a blankline) causes all or most of the CLJC + Clojurescript files to be rebuilt. (See my question on http://stackoverflow.com/questions/41729871/changing-one-cljc-file-causes-full-recompile)

After further investigation, it appears that this problem is not caused by the specifics of my project, but is instead the way lein-cljsbuild intends to operate, to err on the side of safety. (see also https://github.com/emezeske/lein-cljsbuild/issues/345)

Even so, the end result is almost unworkable for me, because trivial changes to CLJC-files cause 45-second builds.

Wouldn't it be a good idea to add an option where the user can specify which (sub)folders in the source code contain "safe" CLJC files? Or, alternatively, an option to treat changes to CLJC-files as changes to CLJS-files (= only recompiles of directly impacted CLJS files), instead of changes to CLJ files (= fully codebase recompiles)?

Figwheel uses a similar configuration option:

:reload-clj-files {:clj true :cljc false}

Guida contributor