How do I avoid duplication in a cljsbuild project? - clojurescript

The :cljsbuild section of my project.clj has a lot of duplication:
:cljsbuild {
:builds {:dev {:source-paths ["src-cljs"]
:compiler {:output-dir "resources/public/js"
:output-to "resources/public/js/main.js"
:optimizations :whitespace
:pretty-print true
:source-map "resources/public/js/main.map"
:language-in :ecmascript5
:foreign-libs [{:file "third-party/mutation-summary/mutation-summary.js"
:provides ["MutationSummary"]}]}}
:production {:source-paths ["src-cljs"]
:compiler {:output-to "resources/public/js/main-min.js"
:optimizations :advanced
:pretty-print false
:language-in :ecmascript5
:foreign-libs [{:file "third-party/mutation-summary/mutation-summary.js"
:provides ["MutationSummary"]}]}}
:test {:source-paths ["src-cljs" "test-cljs"]
:compiler {:output-to "resources/private/js/unit-test.js"
:optimizations :whitespace
:pretty-print true
:language-in :ecmascript5
:preamble ["react/react.min.js"]
:externs ["react/externs/react.js"]
:foreign-libs [{:file "third-party/mutation-summary/mutation-summary.js"
:provides ["MutationSummary"]}]}}}
:test-commands {"unit-tests" ["slimerjs" :runner
"resources/private/js/unit-test.js"]}}
I'm sure that it must be possible to use profiles to remove this duplication, but my Leiningen fu is lacking.

A not so pretty but viable solution is to add a def or defn above your defproject that holds the standard parameters that you are reusing, eg: (Not spellchecked nor functioning example)
(def defaults
"Returns default compiler options"
{:language-in :ecmascript5
:foreign-libs [{:file "third-party/mutation-summary/mutation-summary.js"
:provides ["MutationSummary"]}]})
And then to mergethat map with the custom values:
:builds {:dev {:source-paths ["src-cljs"]
:compiler (merge defaults {:pretty-print true})

Related

What webserver does npx shadow-cljs release app use?

What webserver does shadow cljs with this config:
{:source-paths ["src"]
:dependencies [[binaryage/devtools "1.0.6"]
[nrepl "0.9.0"]
[reagent "1.1.1"]]
:builds {:app {:target :browser
:output-dir "public/js"
:asset-path "/js"
:modules {:app {:entries [simpletodo.core]}}
:devtools {:after-load simpletodo.core/mount-root}}}
:dev-http {3000 {:root "public"
:handler user/app}}}
and using:
npx shadow-cljs release app

Clojurescript Build with Modules - Constants Table Crashing

I'm building an app using:
lein cljsbuild once min
where my min config is
{:id "min"
:source-paths ["src"]
:compiler {:output-dir "resources/public/js"
:main app.core
:optimizations :advanced
:modules {:app
{:output-to "resources/public/js/app.js"
:entries #{app.core}}}
:pretty-print false}}
I end up with 3 js files: cljs_base.js, constants_table.js and app.js
When I include them in my index.html file in that order, I get a console exception:
Uncaught TypeError: cljs.core.Keyword is not a constructor
at constants_table.js:1
If I add :optimize-constants false then it builds the modules correctly.

lein-doo not running the tests, what's going on?

When I try running the tests with lein-doo I get this error:
ERROR: doo was not loaded from the compiled script.
Make sure you start your tests using doo-tests or doo-all-tests
and that you include that file in your build
My project.clj looks like this:
(defproject tech.dashman/clientcommon "0.1.0-SNAPSHOT"
:description "Dashman - Common library to all clients"
:url "https://dashman.tech"
:min-lein-version "2.3.4"
:source-paths ["src"]
:cljsbuild {:builds {:test {:source-paths ["src" "test"]
:compiler {:output-to "target/test/clientcommon.js"
:output-dir "target/test"
:target :nodejs
:main clientcommon.test-runner}}}}
:doo {:build "test"
:debug true} ; Run tests: lein doo phantom
:dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
[org.clojure/clojurescript "1.9.229" :scope "provided"]
[com.taoensso/sente "1.11.0"]
[mount "0.1.10"]
[prismatic/schema "1.1.3"]
[cljsjs/react-with-addons "15.2.1-0"]
[reagent "0.6.0" :exclusions [cljsjs/react]]
[re-frame "0.8.0"]
[tech.dashman/reagent-toolbox "0.1.0-SNAPSHOT"]
[doo "0.1.7"]]
:plugins [[s3-wagon-private "1.3.0"]
[lein-cljsbuild "1.1.4"]
[lein-doo "0.1.7"]])
and my test-runner file looks like this:
(ns clientcommon.test-runner
(:require [doo.runner :refer-macros [doo-tests doo-all-tests]]
[clientcommon.crypto-test]
[clientcommon.util-test]))
(doo-tests 'clientcommon.crypto-test
'clientcommon.util-test)
I'm doing this on Windows and I found a related bug but it claims to be fixed: https://github.com/bensu/doo/issues/60
Any ideas what's going on?

Weird unexpected error when building a target for the second time

I turned on verbosity of cljsbuild to try to understand what's going on, the first time I run lein cljsbuild once I see this:
$ lein cljsbuild once
Compiling ClojureScript.
Compiling "resources/public/js/app.js" from ("src/cljs" "src/cljc" "env/dev/cljs")...
... lots of output ....
Successfully compiled "resources/public/js/app.js" in 13.321 seconds.
Compiling "target/js/server-side.js" from ["src/cljs" "src/cljc" "src/node"]...
Analyzing jar:file:/Users/pupeno/.m2/repository/org/clojure/clojurescript/1.7.122/clojurescript-1.7.122.jar!/cljs/core.cljs
Analyzing jar:file:/Users/pupeno/.m2/repository/org/clojure/clojurescript/1.7.122/clojurescript-1.7.122.jar!/cljs/nodejs.cljs
Compiling target/js/server-side/cljs/nodejs.cljs
Compiling target/js/server-side/cljs/core.cljs
Applying optimizations :simple to 12 sources
Successfully compiled "target/js/server-side.js" in 16.043 seconds.
Note that it said it was optimizing 12 sources. When I run it again, with a small change so that target/js/server-side.js needs to be recompiled, this happens:
$ lein cljsbuild once
Compiling ClojureScript.
Compiling "target/js/server-side.js" from ["src/cljs" "src/cljc" "src/node"]...
Analyzing jar:file:/Users/pupeno/.m2/repository/org/clojure/clojurescript/1.7.122/clojurescript-1.7.122.jar!/cljs/core.cljs
Analyzing jar:file:/Users/pupeno/.m2/repository/org/clojure/clojurescript/1.7.122/clojurescript-1.7.122.jar!/cljs/nodejs.cljs
Compiling target/js/server-side/cljs/nodejs.cljs
Compiling target/js/server-side/cljs/core.cljs
Applying optimizations :simple to 13 sources
Sep 16, 2015 11:29:22 PM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: cljs.nodejs:1: ERROR - namespace "cljs.nodejs" cannot be provided twice
goog.provide('cljs.nodejs');
^
Sep 16, 2015 11:29:22 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 1 error(s), 0 warning(s)
ERROR: JSC_DUPLICATE_NAMESPACE_ERROR. namespace "cljs.nodejs" cannot be provided twice at cljs.nodejs line 1 : 0
Successfully compiled "target/js/server-side.js" in 11.125 seconds.
So how now it says it's optimizing 13 sources and boom! it fails. Any ideas why?
Going into a bit of details, my project.clj looks like this:
(defproject projectx "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[ring-server "0.4.0"]
[cljsjs/react "0.13.3-1"]
[reagent "0.5.1"]
[reagent-forms "0.5.9"]
[reagent-utils "0.1.5"]
[ring "1.4.0"]
[ring/ring-defaults "0.1.5"]
[prone "0.8.2"]
[compojure "1.4.0"]
[hiccup "1.0.5"]
[environ "1.0.1"]
[org.clojure/clojurescript "1.7.122" :scope "provided"]
[bidi "1.21.0"]
[kibu/pushy "0.3.3"]
[aleph "0.4.0"]]
:plugins [[lein-environ "1.0.0"]
[lein-asset-minifier "0.2.2"]
[lein-npm "0.6.1"]]
:ring {:handler projectx.handler/app
:uberwar-name "projectx.war"}
:min-lein-version "2.5.0"
:uberjar-name "projectx.jar"
:main projectx.server
:clean-targets ^{:protect false} [:target-path
[:cljsbuild :builds :app :compiler :output-dir]
[:cljsbuild :builds :app :compiler :output-to]]
:source-paths ["src/clj" "src/cljc"]
:minify-assets {:assets {"resources/public/css/site.min.css" "resources/public/css/site.css"}}
:cljsbuild {:builds {:app {:source-paths ["src/cljs" "src/cljc"]
:compiler {:output-to "resources/public/js/app.js"
:output-dir "resources/public/js/app"
:main "projectx.dev"
:verbose true}}
:server-side {:source-paths ["src/cljs" "src/cljc" "src/node"]
:compiler {:output-to "target/js/server-side.js"
:output-dir "target/js/server-side"
:target :nodejs
:main "projectx.node"
:optimizations :simple
:verbose true}}}}
:npm {:dependencies [[xmlhttprequest "1.7.0"]
[express "4.13.3"]]}
:profiles {:dev {:repl-options {:init-ns projectx.repl}
:dependencies [[ring/ring-mock "0.3.0"]
[ring/ring-devel "1.4.0"]
[lein-figwheel "0.3.9"]
[org.clojure/tools.nrepl "0.2.11"]
[pjstadig/humane-test-output "0.7.0"]]
:source-paths ["env/dev/clj"]
:plugins [[lein-figwheel "0.3.9"]
[lein-cljsbuild "1.0.6"]]
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]
:figwheel {:http-server-root "public"
:server-port 3449
:nrepl-port 7002
:css-dirs ["resources/public/css"]
:ring-handler projectx.handler/app}
:env {:dev true}
:cljsbuild {:builds {:app {:source-paths ["env/dev/cljs"]
:compiler {:optimizations :none
:source-map true
:pretty-print true}}
:server-side {:compiler {:optimizations :simple
:source-map "target/js/server-side.js.map"
:pretty-print true}}}}}
:uberjar {:hooks [leiningen.cljsbuild minify-assets.plugin/hooks]
:env {:production true}
:aot :all
:omit-source true
:cljsbuild {:jar true
:builds {:app {:source-paths ["env/prod/cljs"]
:compiler {:optimizations :advanced
:pretty-print false}}
:server-side {:compiler {:optimizations :advanced
:pretty-print false}}}}}})
These are all the mentions of goog.provide('cljs.nodejs') in my project:
$ grep -R "goog.provide('cljs.nodejs')" .
./target/js/server-side/B616C7F.js:goog.provide('cljs.nodejs');
./target/js/server-side/cljs/nodejs.js:goog.provide('cljs.nodejs');
./target/js/server-side/D2E353E.js:goog.provide('cljs.nodejs');
projectx.node, a file that is included in server-side but not app contains:
(ns projectx.node
(:require [cljs.nodejs]))
(cljs.nodejs/enable-util-print!)
(defn -main [& args]
(println "NodeJS!!!"))
(set! *main-cli-fn* -main)
If I remove the mentions of nodejs from this file or if I remove :target :nodejs, then the problem goes away (but so does my compatibility with NodeJS).
In case it's useful, the CLASSPATH contains:
/Users/pupeno/Projects/clojure/projectx/test
/Users/pupeno/Projects/clojure/projectx/env/dev/clj
/Users/pupeno/Projects/clojure/projectx/src/clj
/Users/pupeno/Projects/clojure/projectx/src/cljc
/Users/pupeno/Projects/clojure/projectx/dev-resources
/Users/pupeno/Projects/clojure/projectx/resources
/Users/pupeno/Projects/clojure/projectx/target/classes
/Users/pupeno/.m2/repository/digest/digest/1.4.4/digest-1.4.4.jar
/Users/pupeno/.m2/repository/org/apache/maven/maven-model-builder/3.0.4/maven-model-builder-3.0.4.jar
/Users/pupeno/.m2/repository/org/apache/maven/maven-repository-metadata/3.0.4/maven-repository-metadata-3.0.4.jar
/Users/pupeno/.m2/repository/clojure-complete/clojure-complete/0.2.3/clojure-complete-0.2.3.jar
/Users/pupeno/.m2/repository/org/clojure/tools.namespace/0.2.10/tools.namespace-0.2.10.jar
/Users/pupeno/.m2/repository/org/apache/maven/wagon/wagon-provider-api/2.2/wagon-provider-api-2.2.jar
/Users/pupeno/.m2/repository/org/apache/maven/wagon/wagon-http/2.2/wagon-http-2.2.jar
/Users/pupeno/.m2/repository/org/clojure/tools.reader/0.10.0-alpha3/tools.reader-0.10.0-alpha3.jar
/Users/pupeno/.m2/repository/org/eclipse/jetty/jetty-http/9.2.10.v20150310/jetty-http-9.2.10.v20150310.jar
/Users/pupeno/.m2/repository/ring/ring-mock/0.3.0/ring-mock-0.3.0.jar
/Users/pupeno/.m2/repository/instaparse/instaparse/1.4.0/instaparse-1.4.0.jar
/Users/pupeno/.m2/repository/prismatic/schema/0.4.3/schema-0.4.3.jar
/Users/pupeno/.m2/repository/watchtower/watchtower/0.1.1/watchtower-0.1.1.jar
/Users/pupeno/.m2/repository/http-kit/http-kit/2.1.18/http-kit-2.1.18.jar
/Users/pupeno/.m2/repository/org/ow2/asm/asm-all/4.1/asm-all-4.1.jar
/Users/pupeno/.m2/repository/org/sonatype/aether/aether-impl/1.13.1/aether-impl-1.13.1.jar
/Users/pupeno/.m2/repository/org/clojure/data.priority-map/0.0.2/data.priority-map-0.0.2.jar
/Users/pupeno/.m2/repository/manifold/manifold/0.1.0/manifold-0.1.0.jar
/Users/pupeno/.m2/repository/org/eclipse/jetty/jetty-server/9.2.10.v20150310/jetty-server-9.2.10.v20150310.jar
/Users/pupeno/.m2/repository/org/clojure/tools.macro/0.1.5/tools.macro-0.1.5.jar
/Users/pupeno/.m2/repository/clj-tuple/clj-tuple/0.2.1/clj-tuple-0.2.1.jar
/Users/pupeno/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
/Users/pupeno/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.6/plexus-utils-2.0.6.jar
/Users/pupeno/.m2/repository/org/apache/httpcomponents/httpcore/4.1.2/httpcore-4.1.2.jar
/Users/pupeno/.m2/repository/org/clojure/core.memoize/0.5.6/core.memoize-0.5.6.jar
/Users/pupeno/.m2/repository/ring/ring-ssl/0.2.1/ring-ssl-0.2.1.jar
/Users/pupeno/.m2/repository/ring/ring-headers/0.1.3/ring-headers-0.1.3.jar
/Users/pupeno/.m2/repository/ring/ring-codec/1.0.0/ring-codec-1.0.0.jar
/Users/pupeno/.m2/repository/ring/ring-servlet/1.4.0/ring-servlet-1.4.0.jar
/Users/pupeno/.m2/repository/org/clojure/core.cache/0.6.3/core.cache-0.6.3.jar
/Users/pupeno/.m2/repository/org/jsoup/jsoup/1.6.1/jsoup-1.6.1.jar
/Users/pupeno/.m2/repository/clj-time/clj-time/0.9.0/clj-time-0.9.0.jar
/Users/pupeno/.m2/repository/org/apache/httpcomponents/httpclient/4.1.2/httpclient-4.1.2.jar
/Users/pupeno/.m2/repository/lein-figwheel/lein-figwheel/0.3.9/lein-figwheel-0.3.9.jar
/Users/pupeno/.m2/repository/org/sonatype/sisu/sisu-guice/3.0.3/sisu-guice-3.0.3-no_aop.jar
/Users/pupeno/.m2/repository/kibu/pushy/0.3.3/pushy-0.3.3.jar
/Users/pupeno/.m2/repository/org/codehaus/plexus/plexus-classworlds/2.4/plexus-classworlds-2.4.jar
/Users/pupeno/.m2/repository/org/clojure/core.async/0.1.346.0-17112a-alpha/core.async-0.1.346.0-17112a-alpha.jar
/Users/pupeno/.m2/repository/reagent/reagent/0.5.1/reagent-0.5.1.jar
/Users/pupeno/.m2/repository/ring/ring-devel/1.4.0/ring-devel-1.4.0.jar
/Users/pupeno/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar
/Users/pupeno/.m2/repository/org/clojure/google-closure-library-third-party/0.0-20150805-acd8b553/google-closure-library-third-party-0.0-20150805-acd8b553.jar
/Users/pupeno/.m2/repository/com/cemerick/pomegranate/0.3.0/pomegranate-0.3.0.jar
/Users/pupeno/.m2/repository/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar
/Users/pupeno/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.2.3/sisu-inject-bean-2.2.3.jar
/Users/pupeno/.m2/repository/cljsjs/react/0.13.3-1/react-0.13.3-1.jar
/Users/pupeno/.m2/repository/org/sonatype/aether/aether-util/1.13.1/aether-util-1.13.1.jar
/Users/pupeno/.m2/repository/org/clojure/tools.analyzer.jvm/0.1.0-beta12/tools.analyzer.jvm-0.1.0-beta12.jar
/Users/pupeno/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar
/Users/pupeno/.m2/repository/crypto-equality/crypto-equality/1.0.0/crypto-equality-1.0.0.jar
/Users/pupeno/.m2/repository/org/apache/maven/maven-aether-provider/3.0.4/maven-aether-provider-3.0.4.jar
/Users/pupeno/.m2/repository/ring/ring-jetty-adapter/1.4.0/ring-jetty-adapter-1.4.0.jar
/Users/pupeno/.m2/repository/org/sonatype/aether/aether-connector-wagon/1.13.1/aether-connector-wagon-1.13.1.jar
/Users/pupeno/.m2/repository/com/cemerick/clojurescript.test/0.0.4/clojurescript.test-0.0.4.jar
/Users/pupeno/.m2/repository/org/sonatype/sisu/sisu-inject-plexus/2.2.3/sisu-inject-plexus-2.2.3.jar
/Users/pupeno/.m2/repository/org/apache/maven/wagon/wagon-http-shared4/2.2/wagon-http-shared4-2.2.jar
/Users/pupeno/.m2/repository/org/clojure/tools.nrepl/0.2.11/tools.nrepl-0.2.11.jar
/Users/pupeno/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
/Users/pupeno/.m2/repository/args4j/args4j/2.0.26/args4j-2.0.26.jar
/Users/pupeno/.m2/repository/hiccup/hiccup/1.0.5/hiccup-1.0.5.jar
/Users/pupeno/.m2/repository/ring-server/ring-server/0.4.0/ring-server-0.4.0.jar
/Users/pupeno/.m2/repository/com/cemerick/url/0.1.1/url-0.1.1.jar
/Users/pupeno/.m2/repository/environ/environ/1.0.1/environ-1.0.1.jar
/Users/pupeno/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar
/Users/pupeno/.m2/repository/ring-refresh/ring-refresh/0.1.2/ring-refresh-0.1.2.jar
/Users/pupeno/.m2/repository/org/clojure/tools.logging/0.3.1/tools.logging-0.3.1.jar
/Users/pupeno/.m2/repository/pathetic/pathetic/0.5.0/pathetic-0.5.0.jar
/Users/pupeno/.m2/repository/figwheel-sidecar/figwheel-sidecar/0.3.9/figwheel-sidecar-0.3.9.jar
/Users/pupeno/.m2/repository/org/eclipse/jetty/jetty-io/9.2.10.v20150310/jetty-io-9.2.10.v20150310.jar
/Users/pupeno/.m2/repository/org/clojure/clojure/1.7.0/clojure-1.7.0.jar
/Users/pupeno/.m2/repository/com/cemerick/piggieback/0.1.5/piggieback-0.1.5.jar
/Users/pupeno/.m2/repository/ring/ring-core/1.4.0/ring-core-1.4.0.jar
/Users/pupeno/.m2/repository/org/tcrawley/dynapath/0.2.3/dynapath-0.2.3.jar
/Users/pupeno/.m2/repository/org/clojure/java.classpath/0.2.2/java.classpath-0.2.2.jar
/Users/pupeno/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar
/Users/pupeno/.m2/repository/clj-stacktrace/clj-stacktrace/0.2.8/clj-stacktrace-0.2.8.jar
/Users/pupeno/.m2/repository/pjstadig/humane-test-output/0.7.0/humane-test-output-0.7.0.jar
/Users/pupeno/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
/Users/pupeno/.m2/repository/aleph/aleph/0.4.0/aleph-0.4.0.jar
/Users/pupeno/.m2/repository/compojure/compojure/1.4.0/compojure-1.4.0.jar
/Users/pupeno/.m2/repository/com/google/javascript/closure-compiler/v20150729/closure-compiler-v20150729.jar
/Users/pupeno/.m2/repository/com/google/javascript/closure-compiler-externs/v20150729/closure-compiler-externs-v20150729.jar
/Users/pupeno/.m2/repository/ring/ring-anti-forgery/1.0.0/ring-anti-forgery-1.0.0.jar
/Users/pupeno/.m2/repository/riddley/riddley/0.1.9/riddley-0.1.9.jar
/Users/pupeno/.m2/repository/org/clojure/google-closure-library/0.0-20150805-acd8b553/google-closure-library-0.0-20150805-acd8b553.jar
/Users/pupeno/.m2/repository/org/apache/maven/maven-model/3.0.4/maven-model-3.0.4.jar
/Users/pupeno/.m2/repository/primitive-math/primitive-math/0.1.4/primitive-math-0.1.4.jar
/Users/pupeno/.m2/repository/potemkin/potemkin/0.3.13/potemkin-0.3.13.jar
/Users/pupeno/.m2/repository/org/clojure/tools.analyzer/0.1.0-beta12/tools.analyzer-0.1.0-beta12.jar
/Users/pupeno/.m2/repository/ring/ring/1.4.0/ring-1.4.0.jar
/Users/pupeno/.m2/repository/byte-streams/byte-streams/0.2.0/byte-streams-0.2.0.jar
/Users/pupeno/.m2/repository/ns-tracker/ns-tracker/0.3.0/ns-tracker-0.3.0.jar
/Users/pupeno/.m2/repository/medley/medley/0.6.0/medley-0.6.0.jar
/Users/pupeno/.m2/repository/org/mozilla/rhino/1.7R5/rhino-1.7R5.jar
/Users/pupeno/.m2/repository/crypto-random/crypto-random/1.2.0/crypto-random-1.2.0.jar
/Users/pupeno/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar
/Users/pupeno/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar
/Users/pupeno/.m2/repository/prone/prone/0.8.2/prone-0.8.2.jar
/Users/pupeno/.m2/repository/org/sonatype/aether/aether-api/1.13.1/aether-api-1.13.1.jar
/Users/pupeno/.m2/repository/io/netty/netty-all/4.1.0.Beta4/netty-all-4.1.0.Beta4.jar
/Users/pupeno/.m2/repository/reagent-forms/reagent-forms/0.5.9/reagent-forms-0.5.9.jar
/Users/pupeno/.m2/repository/clojurescript-build/clojurescript-build/0.1.9/clojurescript-build-0.1.9.jar
/Users/pupeno/.m2/repository/org/clojure/data.json/0.2.6/data.json-0.2.6.jar
/Users/pupeno/.m2/repository/ring/ring-defaults/0.1.5/ring-defaults-0.1.5.jar
/Users/pupeno/.m2/repository/reagent-utils/reagent-utils/0.1.5/reagent-utils-0.1.5.jar
/Users/pupeno/.m2/repository/joda-time/joda-time/2.6/joda-time-2.6.jar
/Users/pupeno/.m2/repository/com/google/guava/guava/18.0/guava-18.0.jar
/Users/pupeno/.m2/repository/commons-fileupload/commons-fileupload/1.3.1/commons-fileupload-1.3.1.jar
/Users/pupeno/.m2/repository/org/eclipse/jetty/jetty-util/9.2.10.v20150310/jetty-util-9.2.10.v20150310.jar
/Users/pupeno/.m2/repository/org/clojure/clojurescript/1.7.122/clojurescript-1.7.122.jar
/Users/pupeno/.m2/repository/ring-cors/ring-cors/0.1.7/ring-cors-0.1.7.jar
/Users/pupeno/.m2/repository/io/aleph/dirigiste/0.1.0/dirigiste-0.1.0.jar
/Users/pupeno/.m2/repository/clout/clout/2.1.2/clout-2.1.2.jar
/Users/pupeno/.m2/repository/org/sonatype/aether/aether-connector-file/1.13.1/aether-connector-file-1.13.1.jar
/Users/pupeno/.m2/repository/org/sonatype/aether/aether-spi/1.13.1/aether-spi-1.13.1.jar
/Users/pupeno/.m2/repository/figwheel/figwheel/0.3.9/figwheel-0.3.9.jar
/Users/pupeno/.m2/repository/bidi/bidi/1.21.0/bidi-1.21.0.jar
By now, I'm convinced this is a bug: http://dev.clojure.org/jira/browse/CLJS-1452
Further investigation shows this happens with ClojureScript 1.7.107 and 1.7.122, but not with 1.7.48 or 1.7.132.

clojurescript advanced compilation - size

I am new to clojurescript.
Is it normal to have a javascript file of "77 KB" after advanced compilation?
I have one clojurescript file:
I am using leinigen: lein cljsbuild once
(ns my-staff.core)
(defn ^:export main []
(.write js/document "<p>Hello from my_staff.core.main()</p>"))
(defproject my-staff "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.4.0"]
[org.clojure/clojurescript "0.0-1586"]]
:source-paths ["src-clj"]; source path for clojure
:plugins [[lein-cljsbuild "0.3.0"]]
:cljsbuild {
:builds [{
:source-paths ["src-cljs"]
:compiler {
:output-to "public/javascripts/main.js"
:optimizations :advanced
:pretty-print false}}]})
Yes, that's normal. The Google Closure compiler has trouble optimizing some of the code that the clojurescript compiler currently emits. This is expected to improve over time. Check CLJS-257 for progress.