Fork me on GitHub
#devcards
<
2016-09-22
>
eyelidlessness01:09:18

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

kauko06:09:39

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

kauko06:09:17

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

eyelidlessness14:09:30

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

bhagany15:09:22

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

bhagany15:09:37

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}}

eyelidlessness15:09:26

is :github-pages the id?

bhagany15:09:37

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

eyelidlessness15:09:17

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"]}

eyelidlessness15:09:19

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

eyelidlessness15:09:35

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

bhagany15:09:49

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

eyelidlessness15:09:08

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

bhagany15:09:12

same result

bhagany15:09:46

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 = {};

eyelidlessness15:09:50

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]]

eyelidlessness15:09:42

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

bhagany15:09:16

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

bhagany15:09:33

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

bhagany15:09:27

many thanks