This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-09
Channels
- # admin-announcements (9)
- # boot (114)
- # cider (15)
- # cljs-dev (10)
- # clojure (35)
- # clojure-boston (5)
- # clojure-dev (39)
- # clojure-greece (1)
- # clojure-japan (10)
- # clojure-nl (3)
- # clojure-poland (2)
- # clojure-russia (10)
- # clojure-sg (8)
- # clojure-switzerland (1)
- # clojure-uk (34)
- # clojurescript (76)
- # clojurescript-ios (3)
- # clojurewerkz (1)
- # clojurex (9)
- # cursive (3)
- # datomic (1)
- # devcards (137)
- # emacs (5)
- # events (1)
- # hoplon (99)
- # jobs (1)
- # ldnclj (50)
- # off-topic (1)
- # om (3)
- # onyx (10)
- # re-frame (4)
- # reagent (1)
- # ring-swagger (15)
- # yada (35)
Been using devcards for a week now. It’s really magnified the power of Figwheel tremendously, and in unexpected ways. I have a card that renders a modal component, and it renders the component 6 different ways with 6 different values passed into it. Styling this component became so efficient that a task I usually pass on to others became joyful.
I ended up completing work on a css-generation module that I’d neglected for the last month.
@wildermuthn: just came to ask about the css matter =] Do you just stuff your styles in resources/styles.css, or inline, or...?
I use goog.cssom
css functions to add styles to the “cssom” which I had never heard about before. So it is fake inlining, but you get the benefits
sorry, that’s goog.cssom
@wildermuthn: looks like what I need, thanks much, I would not want to screw the beautiful devcards UI 😉
It’s pretty nice isn’t it!
If you want to modify styles that are already in place, I think someone mentioned Enlive is a good tool for that. Have you used it?
@wildermuthn: nice is one of an understatement for devcards, indeed =]
ah, ok. I see there’s https://github.com/ckirkendall/enfocus too
Can't figure myself how it'd be used in devcards, but anyway I just want to safely style my content, not devcards
@wildermuthn: thankies!
@wildermuthn @fdserr I plan on looking into kioo for this - as I understand it, it's enlive for React. https://github.com/ckirkendall/kioo
Also, very happy to see there's a closure thing for cssom. I'm hoping to port some code to cljs that manipulates the cssom someday. Thanks @wildermuthn
I want to do a prod build of my devcards but when I do and open index.html it's always blank. Essentially what I want to do is treat devcards as a blog and just deploy it but I want to build using advanced compilation in the prod build. Anyone doing this? Is there something I'm missing? Why is my index.html not displaying my devcards?
actually I don't think this will work at all, doing a build of the "devcards" profile and then just opening the cards.html also shows a blank page. Maybe it was not intended to be used in this fashion?
@frankhale: Can you post your config?
How are you running your prod build?
I'll take a look and see if I can get it working
essentially I just want to take everything in the resources/public folder and deploy it and then open index.html and see my devcards. Not sure why it just shows an empty page.
even if I do a cljsbuild devcards and use the unoptimized code it still shows a blank page
I think you might need to add the info from here into your prod profile https://github.com/bhauman/devcards#devcards-without-figwheel
Thanks I'm looking now. I tried :figwheel { :devcards true } in my prod profile but I suppose that was not enough. LOL!
This is not reassuring me: WARNING: Use of undeclared Var devcards.core/start-devcard-ui!*
I'll just file an issue on Github since I've already blown this chat up and it'd be difficult to follow exactly what I'm trying to do
@frankhale: If I figure it out I'll let you know, taking a look right now.
Here is a succinct version of what I want to do: https://github.com/bhauman/devcards/issues/46
@frankhale: you need to require devcard.core
when I require [devcards.core :as dc] I get a compiler warning WARNING: Use of undeclared Var devcards.core/string
I did modify the project.clj to include main and figwheel in the prod compiler section
okay, that's fine. I deploy the newly compiled prod files and I see the devcards basic ui but no devcards show up.
@frankhale: I'm getting the same thing here.
Thanks for the confirmation @shaun-mahood
@frankhale: hmmm interesting and you have devcards true in the :compiler options?
@frankhale: please read the docs
@frankhale: they aren't clear enough
okay I think I've performed these steps correctly now: https://github.com/bhauman/devcards#devcards-without-figwheel but I still see just a plain devcards UI but none of the devcards in the project. I'm still plugging away at this.
maybe it's not clear what I'm trying to do. I just want to run: lein new devcards helloworld and then deploy a production copy of the resources\public files to a server and have it run the devcards. I think I've followed the README instructions but I still see an empty devcards UI without the one devcard created using the template.
@frankhale: I just got it to work
so you will need to post your project. Also, you are shift reloading your browser right?
again this is a failure on my part. I failed to comprehend the README. I had :devcards true outside of the compiler section of the prod
and to clarify your question about how I'm viewing the files. I copy everything out of resources\public into it's own folder and use node live-server to serve the files. I'm good to go now!
what I want to do ultimately is deploy these files to my http://github.io site and use it as a make shift blog
@frankhale: Can you put the working project up on github?
yes I will do that @shaun-mahood. Thank you for your help as well!
@bhauman: I'll see if I can write up some instructions on how to do this from the lein template (specifically for this use case)
@shaun-mahood: Thanks!!
actually if someone could clarify the devcards docs around this that would be super helpful.
@bhauman: Happy to attempt it
The README section for using devcards without figwheel is fine I think. It was my problem that I did not thoroughly read it and put it into practice.
I'm going to upload my helloworld with some instructions on how to build and deploy as if devcards is the "main app"
I think it'd be helpful for a section in the README or maybe wiki that talks about deploying devcards as if it is the "main app". I can see other people wanting to use it as a sort of programmers blog application. It has the perfect format. A namespace can be treated as if it's a blog post. That's how I want to use it on my http://github.io site.
Sample project and initial commit is here: https://github.com/frankhale/hello-devcards
Thanks @bhauman and @shaun-mahood for your help! I seriously appreciate it!!!
@bhauman @frankhale: Added a pull request to update readme to clarify deployment and running without figwheel https://github.com/bhauman/devcards/pull/47
(defcard dom-node-not-updating
"Seems dom-node doesn't update?"
(dom-node
(fn [state node]
(set! (.-innerHTML node) (str "Click me count: " (:count @state)))
(set! (.-onclick node) #(swap! state update-in [:count] inc))))
{:count 0}
{:inspect-data true
:watch-atom true})
@shaun-mahood: I just looked at your pull request. Great stuff!!! Thank you!
it is in devcards, just add it to the macros list:
(:require-macros
[devcards.core :as dc :refer [defcard deftest dom-node
defcard-doc mkdn-pprint-source]])
Doc is at the bottom here: http://rigsomelight.com/devcards/#!/devdemos.defcard_api
If not working for you either @frankhale I'll file an issue.