lynaghk / cljx

Write a portable codebase targeting Clojure/ClojureScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLJX overrides Piggieback dependency

jarohen opened this issue · comments

Hi Kevin/all,

I think there's an incompatibility between CLJX and browser REPLs caused by CLJX's middleware adding its own dependency (including its version of Piggieback - currently 0.1.0, latest is 0.1.3) to the project in preference to any other version of Piggieback that users specify in their project.clj.

It's been raised on the mailing list at https://groups.google.com/forum/?fromgroups=#!topic/clojurescript/-ZfDekURO6I - although I've had other problems with this in the past - sorry for not reporting it sooner.

I currently work around it with this gist: https://gist.github.com/james-henderson/4c890844903f6054334b - essentially, by replicating what the middleware does in my own project.clj.

I can think of a couple of solutions off the top of my head, (although I suspect with your familiarity with the codebase, you'll probably have more ideas!):

  • Updating the piggieback dependency to 0.1.3 (the easy solution!)
  • Using leinjacker's leinjacker.deps/add-if-missing rather than just conj - this would mean that users could add their own CLJX dependency with exclusions, and the middleware wouldn't override it
  • Adding the CLJX dependency in a way that doesn't take preference over other dependencies (I'm not entirely sure about how lein resolves version conflicts, so not sure if it's possible to do this reliably?)

Thanks for writing and maintaining CLJX btw, it's really helped my Clojure/ClojureScript workflow - a much appreciated library!

James

Ooooh, this is the same problem as cemerick/austin#37, except you found the cause! :-D :-D

I'll get a new release of cljx and Austin out shortly with a fix. Thanks for filing this.

Hi Chas - that's good to know, thanks!

Looking forward to a fix :)

James

Going for option (1) for now, just bumping the piggieback dep to match Austin's. The underlying incompatibility is between older revs of piggieback and current revs of ClojureScript, so this shouldn't recur. A more rigorous solution is more challenging than it looks. :-/

This is on master now, and will be available in 0.4.0 shortly.