Distributing ClojureScript Libraries packaging/dependencies

2011-08-09 Thread Eric Merritt
Hello All, Are there any thoughts yet on distributing ClojureScript libraries? ClojureScript does whole program optimization, it needs the sources. Copying the sources into your main project isn't really a solution, not a long term solution at the very least. At the very least it would be nice of

Re: Distributing ClojureScript Libraries packaging/dependencies

2011-08-09 Thread Brenton
There isn't an official way to do this now but you can package a ClojureScript library (of .cljs files) into a jar and add it to the classpath. Once on the classpath, the namespaces in the library can then be required and used just as you would currently use clojure.set or clojure.string. ClojureS

Re: Distributing ClojureScript Libraries packaging/dependencies

2011-08-09 Thread Marko Kocić
If you mark your public functions with ^:export, even advanced optimization will keep those functions intact. You can campile your library into js, and distribute that file. You can use this compiled file just as any other Closure compatible javascript library. Regards, Marko -- You received t

Re: Distributing ClojureScript Libraries packaging/dependencies

2011-08-09 Thread Chris Granger
FWIW, I've already done what Brenton describes (jar'ing the compiler and such) for noir-cljs (https://github.com/ibdknox/noir-cljs) which adds compilation as middleware. I've also gone the route of jar'ing up my clojurescript stuff and that has worked really well. It seems to me that there's no rea

Re: Distributing ClojureScript Libraries packaging/dependencies

2011-08-09 Thread Eric Merritt
On Tue, Aug 9, 2011 at 9:25 AM, Brenton wrote: > There isn't an official way to do this now but you can package a > ClojureScript library (of .cljs files) into a jar and add it to the > classpath. Once on the classpath, the namespaces in the library can > then be required and used just as you woul

Re: Distributing ClojureScript Libraries packaging/dependencies

2011-08-09 Thread Eric Merritt
Thanks Marko! However, I am looking at using this for a new project and I am going to try to treat javascript as nothing more the assembler for the browser. That being the case I am really going to try to avoid worrying too much about how Clojurescript compiles to Javascript. The other side of tha

Re: Distributing ClojureScript Libraries packaging/dependencies

2011-08-09 Thread Eric Merritt
On Tue, Aug 9, 2011 at 1:08 PM, Chris Granger wrote: > FWIW, I've already done what Brenton describes (jar'ing the compiler > and such) for noir-cljs (https://github.com/ibdknox/noir-cljs) which > adds compilation as middleware. This is actually really really great. Though a little specific to no