Fork me on GitHub

@phil_r: (re: my datascript issue) Just updating figwheel didn't work for me. With the help of jaen over in #C07V8N22C I figured out the specific versions of things I needed to get it to work: Thanks again for taking a look!


@bhauman, maybe vim + ClojureScript + figwheel is such an edge case that there isn’t much demand for a solution?


That, and vimscript isn’t on the top of people’s list of languages to learn.


hmm.. anybody got an idea why this is happening

Marks-MacBook-Pro:opplz underplank$ lein figwheel
java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Named
 at clojure.core$name.invoke (core.clj:1518)
    clojure.lang.AFn.applyToHelper (
    clojure.lang.AFn.applyTo (
    clojure.core$apply.invoke (core.clj:626)
    clojure.core$update_in.doInvoke (core.clj:5698)
    clojure.lang.RestFn.invoke (
    figwheel_sidecar.config$apply_to_key.invoke (config.clj:117)
    figwheel_sidecar.config$fix_build_options.invoke (config.clj:164)
    clojure.lang.AFn.applyToHelper (
    clojure.lang.AFn.applyTo (
    clojure.core$apply.invoke (core.clj:626)
    clojure.core$update_in.doInvoke (core.clj:5698)
    clojure.lang.RestFn.invoke (
    figwheel_sidecar.config$fix_build.invoke (config.clj:187)
    clojure.core$mapv$fn__6311.invoke (core.clj:6353)
    clojure.lang.ArrayChunk.reduce (
    clojure.core.protocols/fn (protocols.clj:98)
    clojure.core.protocols$fn__6057$G__6052__6066.invoke (protocols.clj:19)
    clojure.core.protocols$seq_reduce.invoke (protocols.clj:31)
    clojure.core.protocols/fn (protocols.clj:60)
    clojure.core.protocols$fn__6031$G__6026__6044.invoke (protocols.clj:13)
    clojure.core$reduce.invoke (core.clj:6289)
    clojure.core$mapv.invoke (core.clj:6353)
    figwheel_sidecar.config$fix_builds.invoke (config.clj:190)
    figwheel_sidecar.config$prep_builds.invoke (config.clj:273)
    leiningen.figwheel$figwheel.doInvoke (figwheel.clj:75)
    clojure.lang.RestFn.invoke (
    clojure.lang.Var.invoke (
    clojure.lang.AFn.applyToHelper (
    clojure.lang.Var.applyTo (
    clojure.core$apply.invoke (core.clj:626)
    leiningen.core.main$partial_task$fn__6071.doInvoke (main.clj:253)
    clojure.lang.RestFn.invoke (
    clojure.lang.AFn.applyToHelper (
    clojure.lang.RestFn.applyTo (
    clojure.lang.AFunction$1.doInvoke (
    clojure.lang.RestFn.applyTo (
    clojure.core$apply.invoke (core.clj:626)
    leiningen.core.main$apply_task.invoke (main.clj:303)
    leiningen.core.main$resolve_and_apply.invoke (main.clj:309)
    leiningen.core.main$_main$fn__6136.invoke (main.clj:377)
    leiningen.core.main$_main.doInvoke (main.clj:366)
    clojure.lang.RestFn.invoke (
    clojure.lang.Var.invoke (
    clojure.lang.AFn.applyToHelper (
    clojure.lang.Var.applyTo (
    clojure.core$apply.invoke (core.clj:624)
    clojure.main$main_opt.invoke (main.clj:315)
    clojure.main$main.doInvoke (main.clj:420)
    clojure.lang.RestFn.invoke (
    clojure.lang.Var.invoke (
    clojure.lang.AFn.applyToHelper (
    clojure.lang.Var.applyTo (
    clojure.main.main (


@underplank: can you post your figwheel config? It looks like you’ve put a list in place of a symbol



{:id "dev"
             :source-paths ["src/cljs" "src/cljc" "env/dev/cljs" "test/cljs"]
             :figwheel true
             ;; {:css-dirs ["resources/public/css"]             ;; watch and update CSS
             ;;                 :on-jsload ""}
                  :compiler     {:main           ""
                                 :asset-path     "/js/compiled/out"
                                 :output-to      "resources/public/js/compiled/app.js"
                                 :output-dir     "resources/public/js/compiled/out"
                                 :source-map     "resources/public/js/compiled/"
                                 :optimizations  :none
                                 :cache-analysis true
                                 :pretty-print   true
                                 :source-map-timestamp true}}


is that what you wanted?


@underplank: the figwheel config looks fine to me. Just a hunch, but it may be a typo somewhere in the project file. I came across a similar-ish ClassCastException when I had a typo in a project.clj and was trying to use lein run


@nikp: thanks. i'll have a look around and see if I can find something like that. although its wierd that its only happening when starting figwheel, not doing a cljsbuild or anything else.


@nikp: thanks for the pointer. worked out it was a quoted namespace that was messing it up, from one of the other build targets.


@underplank: ahhh okay. Glad you worked it out


@bmaddy: yeah i was trying to reduce it to the smallest change to your project.clj that made it work, but i think i forgot a lein clean somewhere inbetween, sorry simple_smile


@wildermuthn: I use vim + figwheel for cljs; you can make it work if you use a version of fireplace from


but to be honest I almost never turn it on, figwheel is great for me on its own (thanks @bhauman!)


I’m wondering if it is possible to set some of my namespace(s) as implicit in my lein project, so I don’t have to require/prefix them in all files


Anyone got example code of Mustache + ClojureScript?


I have just created a new library and I want to use the trick where macros ns and library ns have the same name so the consumer does not have to include macros explicitly. I was unable to make it work. I see that Om uses it, but I wasn’t able to setup my repo to do the same thing. Help would be much appreciated, here is my code:


ah, nevermind, it does not work with :require :refer, it works when doing :require :as


I have a js js/Image object, I do not understand how it render in IRender/IRenderState


a.espolov: Render works against the virtual dom. What you have is a real dom element


a.espolov: you could insert it using will-update or something


@borkdude How to insert? What is this notation?


@a.espolov: or actually, did-update


Ok. I realized where I can insert your js/Image, but I was early I will not understand how to do it? Insert directly into the dom?


@a.espolov: just use jquery or however you would like to do it. You can also use a ref. This is all I can say about, without repeating documentation.


@a.espolov: their doc talks about accessing the dom directly - That might give you some ideas.


@darwin, I’ve started using .cljc files for macros I’m going to use in ClojureScript, you wind up getting the empty .cljs namespace for free without having an extra file in there.


@timgilbert: thanks, will try


@timgilbert: That's cool. The one thing I also wonder is whether you can do this in bootstrapped ClojureScript as well. I think to be portable there you need .cljs for the main ns and .cljc for the macros ns. And to be portable to Clojure, you need to simply put your macros in a differently-named ns.


I managed to implement server side prerendering of my reagent/re-frame single page application, but running JS on the server is quite slow. I’m wondering whether I should white-list the well known browsers and skip it for them, since they don’t really need it.


@darwin any progress with your boilerplate project? I've been trying to get macros to work correctly today, failing after 2 hours and counting


FYI I'm using the chestnut template, which starts with a src/{cljs,clj}/projectname structure


so far, it seems like macros aren't getting pulled regardless of whether I put the file in cljs nor clj, and regardless of the file extension


I'll try out your repo now


@whacked It works for me, I just have to reference the macros using :require :as, not :require :refer


@darwin oh I see what your original question meant now


@whacked: so your problem is different?


yeah, mine is simpler: I simply can't get local macros to work in cljs


maybe you didn’t set proper paths into lein’s project.clj? both :source-paths and :cljsbuild :builds … :source-paths are important


I will try the cljc route now


top-level source-paths is for macros (via clojure), cljsbuild paths are for clojurescript files


usually you want to set all source-paths to the same thing, see om:


have to go, good luck


is datascript known to be slow from JavaScript, I get very long read times even for a few hundreds datoms


@darwin ugh I got it. It appears that macros must be syntax-quoteed. My toy examples all looked like (defmacro [x] x) and those were failing


supposed to be obvious? 😕


is there an agreed upon form of saying "clojure and clojurescript"? Clojure/Script?


@martinklepsch: Clojure(Script) is the one I've seen the most


Is anybody doing any ClojureScript work with standard JS templating languages? Something like combining Om with Jade? Is that a thing?