devcards

Devcards aims to provide a visual REPL experience for ClojureScript https://github.com/bhauman/devcards
fdserr 2018-06-06T10:14:50.000432Z

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

bhauman 2018-06-06T15:42:06.000675Z

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

bhauman 2018-06-06T15:43:21.000012Z

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

dpsutton 2018-06-06T15:48:39.000404Z

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

dpsutton 2018-06-06T15:48:51.000220Z

(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!)

๐Ÿ‘ 1
fdserr 2018-06-06T15:55:49.000131Z

@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?

fdserr 2018-06-06T15:57:18.000142Z

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

bhauman 2018-06-06T15:59:57.000678Z

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

bhauman 2018-06-06T16:00:35.000367Z

and a separate cards.html file that loads it

bhauman 2018-06-06T16:01:50.000885Z

@fdserr ^

fdserr 2018-06-06T16:27:10.000368Z

@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^

bhauman 2018-06-06T16:28:21.000612Z

I can't see that link

fdserr 2018-06-06T16:28:51.000386Z

now?

fdserr 2018-06-06T16:29:01.000613Z

https://gitlab.com/fdserr/de2e.clj

bhauman 2018-06-06T16:29:48.000335Z

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

bhauman 2018-06-06T16:30:51.000665Z

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

bhauman 2018-06-06T16:31:29.000186Z

also :refer shouldn't work like that

bhauman 2018-06-06T16:31:57.000075Z

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

bhauman 2018-06-06T16:32:16.000717Z

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

fdserr 2018-06-06T16:32:43.000729Z

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

fdserr 2018-06-06T16:33:45.000820Z

thanks x1000 for the hint, gonna try and report ๐Ÿ˜

bhauman 2018-06-06T16:34:02.000552Z

cool!

fdserr 2018-06-06T16:39:37.000846Z

(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!

๐ŸŽ‰ 1
bhauman 2018-06-06T16:40:41.000431Z

awesome

fdserr 2018-06-06T16:42:06.000559Z

Thank you Bruce, merry coding!

๐Ÿ‘ 1
fdserr 2018-06-06T16:50:26.000163Z

@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 ๐Ÿ˜

bhauman 2018-06-06T16:54:47.000180Z

@fdserr start-devcard-ui! is a macro

bhauman 2018-06-06T16:55:09.000499Z

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

bhauman 2018-06-06T16:55:13.000394Z

is a function

fdserr 2018-06-06T17:04:42.000669Z

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

(enable-console-print!)

(defcard "Welcome!")

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

fdserr 2018-06-06T17:05:32.000622Z

(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

bhauman 2018-06-06T17:06:09.000545Z

well thats weird

bhauman 2018-06-06T17:06:17.000097Z

but I'm glad you got it working

fdserr 2018-06-06T17:06:40.000210Z

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

fdserr 2018-06-06T17:08:37.000333Z

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

fdserr 2018-06-06T17:13:01.000622Z

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! ๐Ÿ™

bhauman 2018-06-06T17:56:40.000085Z

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

bhauman 2018-06-06T17:56:51.000747Z

that may be the problem

fdserr 2018-06-06T18:07:44.000021Z

Oh. Will deffo try this alchemy ๐Ÿ‘