Reloading cljs namespaces?

50 views
Skip to first unread message

James MacAulay

unread,
Apr 16, 2014, 9:14:55 AM4/16/14
to clojur...@googlegroups.com
In Clojure, I like using tools.namespace to reload namespaces. This works well with Stuart Sierra's "reloaded" workflow, and I really like it as a quick way of running tests with fresh code when I'm doing TDD.

Is there a good way to reload ClojureScript namespaces from within a phantomjs project REPL in Austin? Apparently I can't use `:reload` or `:reload-all` in my cljs requires, and the only way I've found to get fresh code directly is to actually define a new namespace with a new name, like `(ns new-name (:require my-lib))`. I guess there's a way of explicitly unloading a namespace so that I can use the same name and still get fresh code from disk, but it all seems pretty clunky (though maybe less so with the help of some convenience functions/macros).

If I use Chrome instead of phantomjs and have `lein cljsbuild auto` going, I can at least refresh my browser to get all fresh namespaces. What's a good workflow to reload namespaces with phantomjs?

Thanks all,
James

Reply all
Reply to author
Forward
0 new messages