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?
@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
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
I don’t think figwheel is required though
I’ve been following various docs and the template project: https://github.com/bhauman/devcards-template
the template project works for me
and it has figwheel and no start-ui calls
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
hmm
but my generated hello-world does not have that file generated, let me double check
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
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
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
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 .....
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:
@bhauman: yes, good travels. And devcards seems very intriguing so looking forward to exploring this more
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:
@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: https://github.com/darwin/plastic/commit/cf85285278bcc67df6eea1fcfc5fe2c439c017d1
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: https://github.com/darwin/plastic/blob/master/cljs/src/dev/plastic/dev/figwheel.cljs
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
ah, interesting. Yes, I suppose something there could be interfering
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
hmm… in his code itlooks like the :figwheel options that includes {:devcards true} is in the compiler map, not the overall build configuration map…
":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:
great!
Here's my devcards project if it helps anyone: https://github.com/decomplect/ive