Fork me on GitHub
#devcards
<
2018-06-06
>
fdserr10:06:50

Hi there! please hint how to use devcards from figwheel.main? - fw.main setup working - in xxx.core.cljs required devcards, start-devcard-ui! - {:main xxx.core :figwheel {:devcards true}} in dev.cljs.edn not sure about this? => I see the devcards UI, but not my card's ns

bhauman15:06:06

@fsderr I'm going to be making it easy to integrate devcards in the near future

bhauman15:06:21

but untill then you would need do your second choice "in xxx.core.cljs required devcards, start-devcard-ui!"

dpsutton15:06:39

@fdserr i think you have to require all of the namespaces that you use defcard in the namespace that you call start-devcard-ui!

dpsutton15:06:51

(ns cards.core
  (:require [devcards.core :as dc]
            [cards.document-cards]
            [cards.allergies-cards]
            [cards.claims.payment-reconciliation]
            [cards.problem-list-cards]
            [cards.examinations-physical]
            [cards.review-of-systems]
            [cards.claims.careteam]
            [cards.tasks-cards])
  (:require-macros
   [devcards.core :refer [defcard]]))

(dc/start-devcard-ui!)

👍 4
fdserr15:06:49

@bhauman yeah, saw your kanban, can’t be thankful enough for your hard work 😉 any idea/pointer as why it wouldn’t work with my setup? does fw.main catch the ‘devcards true’ entry in build conf?

fdserr15:06:18

@dpsutton thanks Dan, I only have one ns so far.

bhauman15:06:57

@fdserr it will be easiest if you have a seperate build config cards.cljs.edn that :main cards.core in it

bhauman16:06:35

and a separate cards.html file that loads it

fdserr16:06:10

@bhauman I'm kinda doing that: https://gitlab.com/fdserr/de2e.clj I suspect the devcards flag is not being picked up. Can you please give me a pointer into either fw or dc code, I might be able to get it straightened? Can't live with no cards lol, so no rush I'm back to lein meanwhile^

bhauman16:06:21

I can't see that link

bhauman16:06:48

@fdserr the figwheel key doesn't work at all in figwheel-main

bhauman16:06:51

@fdserr the defcard has to be before the call to start-ui

bhauman16:06:29

also :refer shouldn't work like that

bhauman16:06:57

unless things have changed you I thought you couldn't :refer to macros like that

bhauman16:06:16

I thought you could only do that in (:require-macros

fdserr16:06:43

@bhauman :include-macros + :refer works most of the time, but some quirks

fdserr16:06:45

thanks x1000 for the hint, gonna try and report 😁

fdserr16:06:37

(ns de2e.core
  (:require
    [devcards.core
     :refer [start-devcard-ui!]])
  (:require-macros
    [devcards.core
     :refer [defcard deftest]]))

(enable-console-print!)

(defcard "Welcome!")

(start-devcard-ui!)
=> devcards awesomeness!!! @bhauman president!

🎉 4
fdserr16:06:06

Thank you Bruce, merry coding!

👍 4
fdserr16:06:26

@bhauman awh 😂 I refreshed :3449/cards.html from lein project, you bet it worked. :9500/ from figwheel.main setup still not showing my ns... Not a blocker, take it easy, run for president anyway 😁

bhauman16:06:47

@fdserr start-devcard-ui! is a macro

bhauman16:06:09

(devcards.core/start-devcard-ui!*)

bhauman16:06:13

is a function

fdserr17:06:42

(ns de2e.core
  (:require-macros
    [devcards.core
     :refer [defcard deftest start-devcard-ui!]]))

(enable-console-print!)

(defcard "Welcome!")

(start-devcard-ui!)
=> no dc ui

fdserr17:06:32

(ns de2e.core
  (:require
    [devcards.core
     :refer [start-devcard-ui!*]])
  (:require-macros
    [devcards.core
     :refer [defcard deftest]]))

(enable-console-print!)

(defcard "Welcome!")

(start-devcard-ui!*)
=> sweetness

bhauman17:06:09

well thats weird

bhauman17:06:17

but I'm glad you got it working

fdserr17:06:40

no star => sweetness as well?!?! how come the compiler don't scream 8-0

fdserr17:06:37

not showing my ns yet lol. never mind, let's give it some hammock^

fdserr17:06:01

just to annoy you^:

(ns de2e.core
  (:require
    [devcards.core
     :refer [start-devcard-ui!]])
  (:require-macros
    [devcards.core
     :refer [defcard deftest]]))

(enable-console-print!)

(defcard "Welcome!")

(start-devcard-ui!)
=> shows dc ui (not the card tho) Again, not a big deal, dc very much alright with lein. Talk to you soon! 🙏

bhauman17:06:40

@fdserr I'd be sure to put the cards in a different ns than the start devcard ui

bhauman17:06:51

that may be the problem

fdserr18:06:44

Oh. Will deffo try this alchemy 👍