Fork me on GitHub
#devcards2015-09-08
>
darwin13:09:56

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

darwin13:09:41

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

ericstewart13:09:32

@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

ericstewart13:09:00

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

darwin13:09:20

@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

darwin13:09:48

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

darwin13:09:00

when namespaces are defined or go away

ericstewart13:09:17

I don’t think figwheel is required though

ericstewart13:09:55

I’ve been following various docs and the template project: https://github.com/bhauman/devcards-template

darwin13:09:37

the template project works for me

darwin13:09:00

and it has figwheel and no start-ui calls

ericstewart13:09:36

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

darwin13:09:42

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

darwin13:09:11

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

ericstewart13:09:12

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

darwin13:09:08

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

darwin13:09:21

maybe I’m using some older version

ericstewart13:09:11

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

darwin13:09:24

and that generated piece works for me

ericstewart13:09:56

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

bhauman14:09:21

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 .....

ericstewart14:09:05

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

darwin14:09:09

@bhauman: thanks! but we will figure it out

darwin14:09:26

happy travels! simple_smile

ericstewart14:09:05

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

ericstewart14:09:39

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

ericstewart14:09:11

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

darwin14:09:33

yes, this is what I did so far, but my project is more complex: https://github.com/darwin/plastic/commit/cf85285278bcc67df6eea1fcfc5fe2c439c017d1

ericstewart14:09:34

and is that the one you are loading?

darwin14:09:22

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

darwin14:09:14

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

ericstewart14:09:26

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

bhauman14:09:23

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

ericstewart14:09:45

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

bhauman14:09:14

":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.

darwin15:09:01

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

darwin15:09:07

great! it works like a charm simple_smile

meow20:09:28

Here's my devcards project if it helps anyone: https://github.com/decomplect/ive