Thomas, Hoplon handles the whole shebang. We've been using it successfully for about a year now in production. The system encompasses JS preamble, externs, and resources. All of these are processed in correct dependency order according to the dependency graph. Versions of our JARs are pinned to the versions of the 3rd party libraries they contain.
An example: https://github.com/tailrecursion/hoplon-demos/tree/master/jquery-date-picker. This demo has dependencies on two Hoplon "contrib" libraries, which are CLJS wrappers for 3rd party JS things (in this case Twitter Bootstrap and the jQuery Date Range Picker plugin). These contrib dependencies themselves depend on "vendor" libraries which contain the 3rd party JS and corresponding resources. Hoplon understands how to integrate these into your project, and it works. Here is the source: * contrib libraries: https://github.com/tailrecursion/hoplon/tree/master/contrib * vendor libraries: https://github.com/tailrecursion/hoplon/tree/master/vendor The README files describe the methodology used to create new ones. (Note that this is for Boot v1, which is a little different from how we will be doing things with Boot v2. Still in the process of transitioning.) Here are the associated artifacts on Clojars: * contrib libraries: https://clojars.org/groups/io.hoplon * vendor libraries: https://clojars.org/groups/io.hoplon.vendor Our system addresses a number of problems: * Correctly resolve transitive dependencies (eg. the jQuery date picker has transitive dependencies on jQuery and MomentJS, which need to be loaded in the correct order in the client). * Prevent inclusion of multiple instances of 3rd party JS (eg. including jQuery more than once is a no-go). * Automate and encapsulate resources in the dependency jars (eg. the date picker ships with CSS which is automatically loaded correctly in the app). * Ensure that externs are provided and used transparently to the user, with the correct version used with the associated JS. Things that are not implemented currently and are waiting for boot v2: * Properly namespace resources to avoid collisions with resources in other JARs and facilitate efficient search from the classpath. * Use dependency classifiers to select between minified (the default) and unminified JS, source maps, etc. * Better tasks for visualizing JS dependencies during the build. This is a complete solution that has had a good deal of thought put into it and has been used successfully for some time now. The improvements listed above are the result of this. -- Micha Niskin On Tue, Nov 18, 2014 at 12:27 PM, Paul Bostrom <[email protected]> wrote: > My $0.02, I think it would be nice to leverage the extensive list of > libraries already packaged at http://www.webjars.org as well as use that > as a model for packaging new libraries on clojars. This requires using > something like a library.edn file or just the project.clj file to specify > what should get pulled in as part of the library. For example, here is the > project.clj file I used in my proof of concept code-mirror wrapper to > include support for Clojure mode and paren matching: > https://github.com/pbostrom/om-codemirror/blob/master/project.clj > > In any case, any potential solution will probably have to ride the > coattails of a popular library before it gains any traction. > > -- > 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.
