Skip to content

Commit 7c62704

Browse files
committed
re-introduce cljs.closure/compile-file skip analysis optimization
builds are "non-interactive". That is, the unit of compilation for projects is nearly always at the module (namespace) level. Here ns information triggers analysis when required so skipping analysis is not problematic. builds now default to "non-interactive". Cold builds when there is no work to do is now quite fast. the real default is "interactive" so REPLs can continue to work as they have.
1 parent 68894f0 commit 7c62704

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/clj/cljs/closure.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,8 @@ should contain the source for the given namespace name."
13651365
([source opts compiler-env]
13661366
(env/with-compiler-env compiler-env
13671367
(let [compiler-stats (:compiler-stats opts)
1368-
all-opts (add-implicit-options opts)
1368+
all-opts (assoc (add-implicit-options opts)
1369+
:compilation-mode :non-interactive)
13691370
emit-constants (or (and (= (:optimizations opts) :advanced)
13701371
(not (false? (:optimize-constants opts))))
13711372
(:optimize-constants opts))]

src/clj/cljs/compiler.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,10 +1113,11 @@
11131113
:visited (conj visited ns)})))
11141114
ret))
11151115
(do
1116-
;; always populate compilation environment with analysis information
1116+
;; populate compilation environment with analysis information
11171117
;; while it would seem this isn't necessary avoiding to do so damages
11181118
;; composition of smaller compilation units like expressions (i.e. REPLs)
1119-
(when-not (contains? (::ana/namespaces @env/*compiler*) ns)
1119+
(when (and (not= (:compilation-mode opts) :non-interactive)
1120+
(not (contains? (::ana/namespaces @env/*compiler*) ns)))
11201121
(with-core-cljs opts (fn [] (ana/analyze-file src-file opts))))
11211122
ns-info)))
11221123
(catch Exception e

0 commit comments

Comments
 (0)