I agree that these are not things I'd want to see incorporated into the
CLJS compiler, for sure. I think that it's the role of build tooling to do
this stuff. Boot does just fine driving the CLJS compiler, telling it where
externs are and so forth, and this is the way I'd most prefer, in a perfect
world. Even with Hoplon it's separated into a number of different
composable tasks, because asset pipeline stuff can't be made monolithic and
general. We need to leverage composition of simple components there and let
the end user decide how they need to be composed to build their unique
snowflake of a project.

The point I was making was that it's a problem that can and has been solved
elegantly with tooling alone, and doesn't need CLJS compiler integration. I
see a trend emerging where frustration with tooling is resulting in more
and more fascination with loading down core things with build concerns,
which I think would be a shame. The CLJS compiler does the job admirably
as-is (I also really have high hopes for shadow-build, but I'm not very
familiar with it yet; still learning).

--
Micha Niskin

On Wed, Nov 19, 2014 at 6:27 PM, Thomas Heller <[email protected]> wrote:

> Well yes, the compiler only needs to produce .js from .cljs.
>
> The "second phase" is "packaging" everything together, this is where
> Closure kicks in. That part needs externs, preamble and the like. I would
> agree that does not need to be in ClojureScript itself, the whole Closure
> part ist not actually needed for anything CLJS compilation related.
>
> Tools like shadow-build or lein-cljsbuild could handle that part on their
> own (shadow-build already does) and provide extended "features".
> Minification of the preamble is actually just Closure :simple optimizations
> of that code, I'll eventually add that.
>
> CSS is a whole other issue though, I would not attempt to address that but
> the sad part is that many JS libraries require them to display properly.
> Anyways, that has no place in ClojureScript.
>
> It might be worthwhile to remove the CloSure parts from ClojureScript,
> given the tooling required to make "proper" builds. It would simplify CLJS
> alot and since a big majority use external tools already, probably no one
> would notice.
>
> But that went a bit off-topic, since we'd still need a way to package
> external dependencies properly. ;)
>
> /thomas
>
> On Wednesday, November 19, 2014 10:34:38 PM UTC+1, Nikita Prokopov wrote:
> > I feel that managing CSS inclusion and third-party JS lib minification
> is kind of out of scope for CLJS compiler. Yes, these problems exists, but
> they are very broad, with a lot of solutions. I’m not sure we should try to
> solve them in CLJS compiler. I’m not even sure “preamble” feature should
> belong to CLJS compiler.
> >
> > The goal of CLJS is get .cljs sources in and produce executable .js code
> out. How this .js will be used depends on your app: you might include it as
> is, you might concatenate it with libs (preabmle), etc.
> >
> > :externs are important because without them libraries would not compile
> into executable .js source, therefore should be addressed somehow in
> compiler. Managing JS dependencies, minification, concatenation etc has, in
> my opinion, nothing to do with compilation.
>
> --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "ClojureScript" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojurescript/LtFMDxc5D00/unsubscribe.
> To unsubscribe from this group and all its topics, 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.

Reply via email to