:optimization :whitespace is only slightly slower than none in my
experience, and requires no hackery.

The best explanation I found of this was in the Clojurescript Up and
Running book, though I imagine it must be documented online too. Basically,
optimization none completely bypasses Google Closure and leaves you with
the output of the ClojureScript compiler.

One of the features of the Google compiler is that it takes all of your
files and combines them into a single one. With optimization none, you get
one file per namespace, so you need to place these files in a reachable
place and manually tell Closure (the library, not the compiler) to load
them.

Optimization whitespace basically just does the concatenation, so it is
pretty fast, and does not require a different setup as it still retains the
feature of producing a single file. It is slower than none though, so
you'll probably have to balance the costs yourself.

@david: the :none value for :optimization does not seem to be mentioned at
all on the lein cljsbuild github project. In particular, the
sample.project.clj mentions explicitly "may be :whitespace, :simple or
:advanced".

On Wednesday, 26 November 2014, David Nolen <dnolen.li...@gmail.com> wrote:

> :advanced is only for release builds. :none is a fully supported
> option. To be honest I'm a bit surprised this is not clear after going
> through the documentation of either ClojureScript or lein cljsbuild.
> Would be happy to hear why you had difficulty finding this information
> and how we can make this point clearer.
>
> Thanks,
> David
>
> On Wed, Nov 26, 2014 at 10:09 AM, Matthew Gertner
> <matt...@salsitasoft.com <javascript:;>> wrote:
> > My colleague was complaining about waiting ~20 seconds for his
> ClojureScript to compile and discovered this post on Stack Overflow:
> http://stackoverflow.com/questions/20917202/auto-building-clojurescript-files-for-compojure-app.
> In a nutshell, compilation time goes _way_ down if `optimization` is set to
> `:none`, but some hackery is needed to get the resulting JS to run. (I
> didn't check yet whether `:none` is a supported value or whether any
> unsupported value would have the same effect.)
> >
> > Is there some option for turning off optimization completely that we
> haven't been able to find? If not, is there some reason not to support
> this? Wouldn't it be possible to adapt the parser so that it emits runnable
> JS without any optimization at all during the dev process? The compilation
> time speedup is really significant.
> >
> > --
> > 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 clojurescript+unsubscr...@googlegroups.com <javascript:;>.
> > To post to this group, send email to clojurescript@googlegroups.com
> <javascript:;>.
> > 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 clojurescript+unsubscr...@googlegroups.com <javascript:;>.
> To post to this group, send email to clojurescript@googlegroups.com
> <javascript:;>.
> 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 clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to