devcards

Devcards aims to provide a visual REPL experience for ClojureScript https://github.com/bhauman/devcards
2016-09-22T01:09:18.000057Z

do people use devcards with github pages? is it typical to just commit the compiled JS, or is there a better way?

kauko 2016-09-22T06:37:39.000058Z

Isn't that pretty much the only way? Not really related to devcards though 🙂

kauko 2016-09-22T06:38:17.000059Z

(I'm not saying that's not a proper question to this channel, but rather that devcards to gh pages shouldn't be any more complicated than any other cljs/js thingy to gh pages)

2016-09-22T14:37:30.000060Z

honestly didn't know if there was another way. have never used gh pages before

bhagany 2016-09-22T15:41:22.000061Z

@eyelidlessness: looks like I’m treading the same path you just have - trying to get a devcards ui on github pages. I’m currently stuck on the advanced build not including any of my code (but it has react twice, I think?). I made sure I had :devcards true in the right place, as that’s what fixed yours, but still no dice. would you mind posting your cljsbuild config?

bhagany 2016-09-22T15:42:37.000062Z

here’s mine, for reference:

:github-pages {:source-paths ["src" "dev"]
                              :compiler {:output-to "docs/gh-pages.js"
                                         :main snowth.devcards
                                         :devcards true
                                         :optimizations :advanced}}

2016-09-22T15:43:26.000063Z

is :github-pages the id?

bhagany 2016-09-22T15:43:30.000064Z

yes

bhagany 2016-09-22T15:43:37.000065Z

and I am calling devcards.core/start-devcard-ui!

2016-09-22T15:44:17.000067Z

one of mine (i'm testing against both reagent 0.5.1 and 0.6.0 so i have a nearly identical 0.6.0 compilation):

{:id "0.5.1"
 :source-paths ["docs" "src" "test"]
 :compiler {:devcards true
            :optimizations :advanced
            :output-dir "docs/0.5.1/out"
            :output-to "docs/0.5.1/build.js"
            :source-map "docs/0.5.1/build.js.map"}
 :notify-command ["phantomjs"
                  "test/phantomjs_runner.js"
                  "docs/0.5.1/build.js"]}

2016-09-22T15:45:19.000069Z

you may want to use the [{:id "github-pages" ... }] structure, as i am pretty sure that's preferred

2016-09-22T15:45:35.000070Z

not sure if it'll affect your build but it can, i've seen cljsbuild do some wonky things with the map structure

bhagany 2016-09-22T15:45:49.000071Z

alright, I’ll give that a shot. I could never tell which one was preferred 🙂

2016-09-22T15:46:08.000072Z

pretty sure vector of id'd map is preferred, though there are some outdated wiki pages which are not so clear 🙂

bhagany 2016-09-22T15:48:12.000073Z

same result

2016-09-22T15:48:30.000074Z

any js errors?

bhagany 2016-09-22T15:49:46.000075Z

there’s an error that I think occurs because of react being included twice, during compilation:

SEVERE: file:/Users/brent/.m2/repository/cljsjs/react-dom/0.14.3-0/react-dom-0.14.3-0.jar!/cljsjs/react-dom/common/react-dom.ext.js:85: ERROR - constant ReactDOMServer assigned a value more than once.
Original definition at file:/Users/brent/.m2/repository/cljsjs/react-dom-server/0.14.3-0/react-dom-server-0.14.3-0.jar!/cljsjs/react-dom-server/common/react-dom-server.ext.js:13
var ReactDOMServer = {};

bhagany 2016-09-22T15:51:24.000078Z

aha

2016-09-22T15:51:50.000079Z

worth noting, this is my devcards dependency:

[devcards "0.2.1-7"
 :exclusions [org.clojure/clojure
              org.clojure/clojurescript
              cljsjs/react
              cljsjs/react-dom
              cljsjs/react-server]]

2016-09-22T15:52:42.000080Z

i specify clojure/clojurescript directly, and use the react deps provided by each version of reagent i test

bhagany 2016-09-22T15:53:16.000081Z

well, this is promising - it wrote an out directory for the first time

bhagany 2016-09-22T15:53:33.000082Z

I had removed :output-dir before because it appeared to not be using it

bhagany 2016-09-22T15:56:25.000083Z

success!

bhagany 2016-09-22T15:56:27.000084Z

many thanks

2016-09-22T15:57:32.000085Z

:thumbsup: