Devcards aims to provide a visual REPL experience for ClojureScript

I’m trying to integrate devcarsd into my existing project, it looks like I’m missing something, the devcards UI is not rendering, I tried to dig into sources a bit and I don’t understand who is responsible for calling start-devcard-ui! or start-ui


I see bunch of exported functions, is it supposed to be called by figwheel running in the same javascript context?

ericstewart 2015-09-08T13:35:32.000005Z

@darwin: I think I’m only one step ahead of you (trying to integrate into an existing project). I believe you are responsible for calling start-devcard-ui! and the recommendation seems to be to have a cljsbuild specifically for devcards

ericstewart 2015-09-08T13:36:00.000006Z

I’m at the point of getting the ui to show (when I call start-devcard-ui!) but can’t get any cards to show up


@ericstewart: that’s what I did, I followed the docs, I think my problem is that for some reason figwheel is not present in my page


I have a feeling that figwheel is responsible for driving devcard’s UI, for added dynamism


when namespaces are defined or go away

ericstewart 2015-09-08T13:37:17.000010Z

I don’t think figwheel is required though

ericstewart 2015-09-08T13:37:55.000011Z

I’ve been following various docs and the template project:


the template project works for me


and it has figwheel and no start-ui calls

ericstewart 2015-09-08T13:39:36.000015Z

hmm.. I see that it does have a start-devcard-ui call…. in devcards-core.cljs


when I call start-devcard-ui! manually the UI gets rendered, but it is empty, it has no knowledge about my namespaces




but my generated hello-world does not have that file generated, let me double check

ericstewart 2015-09-08T13:41:12.000019Z

in devcards-core.cljs, which calls (devcards.core/start-devcard-ui!) it requires the primary core namespace


do you have that file in generated project? lein new devcards hello-world


I don’t


maybe I’m using some older version

ericstewart 2015-09-08T13:44:11.000023Z

hmm.. you are right… I don’t either… I’ve been mainly browsing the source in github, which is different than what I have generated too


and that generated piece works for me

ericstewart 2015-09-08T13:48:56.000025Z

and it is also using devcards 0.2.0-SNAPSHOT…. while running, looking at target/figwheel_temp/devcards/figwheel/connect.cljs it it getting the (devcards.core/start-devcard-ui!) call there

bhauman 2015-09-08T14:02:21.000026Z

Hey guys I getting ready to travel today and I'm behind, otherwise I jump right in here. I'll be available tomorrow for sure and I'll check back later .....

ericstewart 2015-09-08T14:03:05.000027Z

Thanks @bhauman. I think I just made a breakthrough and got it working, but need to make sure I understand what I did


@bhauman: thanks! but we will figure it out


happy travels! :simple_smile:

ericstewart 2015-09-08T14:04:05.000030Z

@bhauman: yes, good travels. And devcards seems very intriguing so looking forward to exploring this more

ericstewart 2015-09-08T14:06:39.000031Z

so, in my case I had my own call to start-devcard-ui! in my cljs source, but as you pointed out figwheel is doing this itself (presumably because we pass :devcards true to figwheel int eh cljsbuild settings. For me the devcards ui had been starting but no cards. Now when I just let figwheel do it my cards are picked up and displayed


@ericstewart: congrats! :simple_smile:

ericstewart 2015-09-08T14:09:11.000033Z

@darwin: in your project are you generating a separate js file for devcards as the template project does?


yes, this is what I did so far, but my project is more complex:

ericstewart 2015-09-08T14:09:34.000035Z

and is that the one you are loading?


yes, but I have my own figwheel client config and patches, so I need to go back and start from scratch I guess


this is what I do to figwheel:


I have to go now, will get back in 3 hours and then will continue, I’m pretty confident, I will be able to figure the issue out, will report back

ericstewart 2015-09-08T14:13:26.000040Z

ah, interesting. Yes, I suppose something there could be interfering

bhauman 2015-09-08T14:14:23.000041Z

Here's the secret if you don't use :devcards true in the :Figwheel config you need to put devcards true in the build options

ericstewart 2015-09-08T14:17:45.000042Z

hmm… in his code itlooks like the :figwheel options that includes {:devcards true} is in the compiler map, not the overall build configuration map…

bhauman 2015-09-08T14:26:14.000043Z

":devcards true" in the Figwheel options generates the start-ui code and propagates devcards true to the compiler config. We need devcards true in the compiler config as a switch to enable or disable the defcard macro.


ah, that might be it, my original :figwheel key was in :compiler of :cljsbuild profile (probably a mistake from early days)


great! it works like a charm :simple_smile:

ericstewart 2015-09-08T15:58:55.000046Z


meow 2015-09-08T20:45:28.000047Z

Here's my devcards project if it helps anyone: