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 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