devcards

Devcards aims to provide a visual REPL experience for ClojureScript https://github.com/bhauman/devcards
macroz 2016-07-15T06:09:40.000097Z

@nberger how about getting that included in the main?

2016-07-15T06:26:16.000098Z

People definitely seem to wonder how to use re-frame with devcards: https://github.com/Day8/re-frame-template/issues/28 https://github.com/bhauman/devcards/issues/105

2016-07-15T11:38:17.000100Z

I am having trouble using both the dom-node and defcard-om-next helpers with an om-next component. They don't render with the notification Card has not mounted DOM node.

anmonteiro 2016-07-15T11:52:33.000101Z

@bbss: if you’re using defcard-om-next in Devcards itself you might want to consider using https://github.com/anmonteiro/devcards-om-next

anmonteiro 2016-07-15T11:53:00.000103Z

it provides the same helpers (`defcard-om-next` and om-next-root) with support for reloadable code

anmonteiro 2016-07-15T11:53:10.000104Z

(e.g. doesn’t lose component local state on reload)

2016-07-15T11:53:56.000105Z

Okay giving it a go, thanks @anmonteiro

anmonteiro 2016-07-15T11:54:21.000106Z

@bbss: wrt to your actual problem, you don’t need dom-node to use defcard-om-next

anmonteiro 2016-07-15T11:54:28.000107Z

simply drop your Root component there

2016-07-15T11:54:45.000108Z

I meant either one, the same for om-root

anmonteiro 2016-07-15T11:54:46.000109Z

example:

(defcard-om-next my-card
  MyComponent)

2016-07-15T11:55:20.000110Z

I think something is wrong with my dependencies or so.

2016-07-15T11:55:39.000111Z

If I copy the examples from the devcards repo they don't work, neither do the ones from the om next repo

anmonteiro 2016-07-15T11:55:42.000112Z

if they don’t render then you might just have a runtime error

anmonteiro 2016-07-15T11:55:47.000113Z

oh

2016-07-15T11:55:51.000114Z

No errors to be found

anmonteiro 2016-07-15T11:56:11.000115Z

are those devcards online somewhere?

anmonteiro 2016-07-15T11:56:15.000116Z

I can take a quick look

anmonteiro 2016-07-15T11:56:56.000119Z

@bbss: those I know, and they work for me

anmonteiro 2016-07-15T11:57:04.000120Z

I meant your project

2016-07-15T11:57:38.000121Z

Hmm but if I copy those they don't work for me. I don't have the project online but it's just a couple of lines.

anmonteiro 2016-07-15T11:58:42.000122Z

@bbss: maybe something wrong with your namespace requires?

2016-07-15T11:58:57.000123Z

possible

anmonteiro 2016-07-15T11:59:00.000124Z

Just guessing here if I can’t have a look

2016-07-15T11:59:54.000125Z

(ns synth.devcards.adsr
  (:require
   [synth.devcards.time]
   [synth.devcards.player]
   [synth.devcards.editor]
   [synth.devcards.radial-menu]
   [clojure.data :as data :refer [diff]]
   [om.next :as om :refer-macros [defui]]
   [om.dom :as dom]
   )
  (:require-macros
   [devcards.core :as dc :refer [defcard defcard-om-next dom-node]]
   [cljs.core.async.macros :refer [go]])
  )

anmonteiro 2016-07-15T12:01:09.000126Z

@bbss: does your CLJS build have :devcards true?

2016-07-15T12:01:33.000128Z

yes

2016-07-15T12:01:40.000129Z

it's live-reloading and all

anmonteiro 2016-07-15T12:05:06.000130Z

@bbss: FWIW the namespace declaration looks good

2016-07-15T12:05:43.000131Z

Yea "it worked before".

2016-07-15T12:06:12.000132Z

Anyway I'll dive a little deeper and give your library a go as well. Thanks for your effort.

anmonteiro 2016-07-15T12:06:14.000133Z

if you’re using figwheel, try (reset-autobuild)

2016-07-15T12:06:24.000135Z

Okay

anmonteiro 2016-07-15T12:06:30.000136Z

at the CLJS REPL

2016-07-15T12:13:03.000137Z

nope, didn't help. I had tried lein clean before. Maybe it's an old dependency in my maven cache or so.

anmonteiro 2016-07-15T12:15:12.000138Z

@bbss: one last thought: which Om version are you using?

2016-07-15T12:15:33.000139Z

38 alpha

anmonteiro 2016-07-15T12:15:40.000140Z

hrm that should work, yeah

2016-07-15T12:17:17.000141Z

I'll figure it out 🙂 thanks anyway

bhauman 2016-07-15T13:20:31.000142Z

@bbss: what version of figwheel are you using?

2016-07-15T13:25:35.000143Z

@bhauman: in dependencies: [figwheel-sidecar "0.5.4-7"] in profiles:

:profiles {:dev
             {:dependencies [[binaryage/dirac "0.6.1"]
                             [ring/ring-devel "1.5.0"]
                             [com.cemerick/piggieback "0.2.1"]
                             [figwheel-sidecar "0.5.4-7"]

bhauman 2016-07-15T13:25:52.000145Z

Geez

bhauman 2016-07-15T13:26:50.000146Z

well I would back off to a simple example at this point

2016-07-15T13:27:03.000147Z

Okay

bhauman 2016-07-15T13:27:24.000148Z

would be interested to here whats causing this

bhauman 2016-07-15T13:28:31.000149Z

I'm going to be delving back into devcards work in a few weeks hopefully, so many cool opportunities to support spec

2016-07-15T13:29:08.000150Z

I love the changes to figwheel showing the expected signature on mistakes!

bhauman 2016-07-15T13:30:15.000151Z

hmmm not sure what you are talking about, your talking about code context, or the propagation of clojure 1.9 macro errors?

2016-07-15T13:31:01.000153Z

I mean the macro errors I guess

2016-07-15T13:32:22.000154Z

The arrow pointing to the place where things are going wrong and also showing when for instance an arguments list is too short.

bhauman 2016-07-15T13:41:56.000155Z

are you using clojure 1.9?? I think you may be getting new clojure macro errors along with figwheels context stuff

2016-07-15T13:42:16.000156Z

I am using that yes

bhauman 2016-07-15T13:42:25.000157Z

so the new 1.9 stuff is just flowing through I think

2016-07-15T13:42:46.000158Z

when I try to define a react method on a defui

2016-07-15T13:43:41.000159Z

I forget the next-props for example, it tells me so fast!

2016-07-15T13:43:47.000160Z

It's almost like having types 😛

bhauman 2016-07-15T13:45:57.000161Z

I'm really happy it works so well, I'm surpised myself sometimes

bhauman 2016-07-15T13:47:06.000162Z

And I'm planning on some big improvements

2016-07-15T13:49:42.000163Z

Even more goodies! 🙂