Updating “RELEASE” dependencies in ClojureScript

TL;DR: Use lein -U deps to force leiningen to update SNAPSHOT and RELEASE dependencies in a Leiningen project.

You may have noticed that some clojure dependencies allow you to specify their version number as "RELEASE". This is useful when you’re working with libraries that need to be kept in sync with another piece of software that updates automatically.

Screen Shot 2018-09-10 at 6.29.31 AM.png

 

One example of this is the super useful Dirac REPL and debugger created by Antonin Hildebrand. Dirac provides ClojureScript developers with a fully-featured REPL and the ability to debug ClojureScript code right from Chrome DevTools (which is pretty sweet).

 

dirac-screenshot.pngTo work it’s magic, Dirac uses a Chrome extension that establishes the connection between DevTools and your application’s nrepl server.

The Dirac Chrome extension is actively updated and new versions are pushed regularly to the Chome App Store which is then updated automatically in Chrome. Always having the newest version is great for a tool like Dirac can but it can also mean that the extension can get out of sync with the version running in your app:

Screen Shot 2018-09-09 at 6.00.00 PM

One solution is to use the "RELEASE" version specifier in your project.clj file. In theory, this should keep the version of Dirac in your app in sync with the Chrome extension.

Unfortunately this doesn’t always work as intended because Leiningen only checks for new SNAPSHOT versions (and, I’m assuming, RELEASE versions) every 24 hours. To force lein to update the deps you must call lien -U deps and everything should be hunky-dory:

Screen Shot 2018-09-09 at 6.22.35 PM

Hope that helps!

Leave a Comment.