With what Thomas Heller described here it might be worth pointing out again how
this is handled within boot-cljs. boot-cljs looks for a specific path in jars
and uses files in that location as #{preamble, extern, gclosure-lib} depending
on their file endings.
For example, a file ending in `.ext.js` will be supplied as extern to the
Clojurescript compiler.
This would provide a clear pattern to provide externs and via regular Maven
dependencies and some of the problems described by Thomas would be solved. Also
creating a file like `library.edn` wouldn't be necessary.
When I first saw this approach I also wasn't sure if I like it but after some
more discussions
with the Hoplon Team it seems very sane.
On Tuesday, November 18, 2014 12:05:08 PM UTC+1, Thomas Heller wrote:
> Hey,
>
> had a bit of time thinking about things.
>
> "deps.cljs" seems like a band aid to be honest, it might be better than
> without but I imagine we run into all sorts of issues in the future.
>
> In my projects I use CodeMirror quite frequently with a handcrafted (sort of
> incomplete) externs.js. To get everything working on the page I need to
> include the externs.js into my build and then load the codemirror.js (+ all
> modes and css) manually in the HTML, before my optimized CLJS. What happens
> if another CLJS library uses a different CodeMirror version than mine? Say v3
> vs v4? The externs are not compatible (well almost), but I basically cannot
> use that library without running into issues.
>
> I thought we might exploit the maven/leiningen ecosystem. Say someone
> released a [someone/codemirror-4.7.1], another library could still depend on
> 4.1.1 but maven will resolve that for us. The artifact itself could include a
> library.edn that describes it to the compiler (externs, preamble, provides,
> requires, variants, ...). We'd just need a way to tell the cljs compiler to
> include "library" codemirror with variants html-mode, css-mode and others so
> the can emit the correct preamble and include the externs in the
> optimization. Not sure how the library.edn would look but we should be able
> to figure this out.
>
> Of course that would require that someone takes to time to update and release
> javascript packages as a jar. But David is already doing that with
> [com.facebook/react "0.11.2"], maybe github+clojars is already a good enough
> platform to handle this.
>
> Just my 2 cents,
> /thomas
--
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.