devcards

Devcards aims to provide a visual REPL experience for ClojureScript https://github.com/bhauman/devcards
rberger 2020-11-21T19:03:27.006Z

Is it possible to use re-frame with devcards ? There is an old issue still open https://github.com/bhauman/devcards/issues/105 that seems to imply that its not easy to use re-frame with devcards

rberger 2020-11-23T21:00:34.007500Z

Sure it is possible or sure it is not possible? Any examples of how it is possible? Thanks!

nenadalm 2020-11-24T18:39:51.009200Z

it is possible. > You can then use the `defcard` macro. `defcard` is a multipurpose macro which is designed to take what you are working on elevate live into the browser. It can handle many types of data but primarily takes any type of ReactElement. (http://rigsomelight.com/devcards/#!/devdemos.defcard_api) You can convert hiccup using as-element function in reagent into the ReactElement: https://reagent-project.github.io/docs/master/reagent.core.html#var-as-element Example can be seen here: https://github.com/imatic/re-frame-form/blob/f88f9bf949541f661aae7ffca0f88c4a5a8e0ec2/examples/re-frame-form/src/example/core.cljs#L85 with the ui: https://imatic.github.io/re-frame-form/

rberger 2020-11-24T18:46:02.009600Z

Thanks! Will check that out. That issue in devcards just made me assume it was difficult to use re-frame with devcards. I ended up using nubank/workspaces but will go back and try it with devcards now. (actually had some issues with updates happening properly with workspaces that Ihaven’t debugged yet)

nenadalm 2020-11-24T18:50:57.009800Z

I don't have the problem with subscriptions. I've never tried workspaces.

rberger 2020-11-24T18:54:32.010Z

Appreciate your help!

rberger 2020-11-28T00:09:23.010300Z

Just to confirm, everything is working great for me with re-frame, devcards and shadow-cljs. I guess the issues people were having was more if they wanted separate re-frame app-db for individual devcards. I do not have that requirement. The issue of the cards / reagent components updating reactively in both devcards and workspaces, was my own error of not wrapping the hiccup passed to defcard-ng in a function.

👍 1