do people use devcards with github pages? is it typical to just commit the compiled JS, or is there a better way?
Isn't that pretty much the only way? Not really related to devcards though 🙂
(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)
honestly didn't know if there was another way. have never used gh pages before
@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?
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}}
is :github-pages
the id?
yes
and I am calling devcards.core/start-devcard-ui!
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"]}
you may want to use the [{:id "github-pages" ... }]
structure, as i am pretty sure that's preferred
not sure if it'll affect your build but it can, i've seen cljsbuild do some wonky things with the map structure
alright, I’ll give that a shot. I could never tell which one was preferred 🙂
pretty sure vector of id'd map is preferred, though there are some outdated wiki pages which are not so clear 🙂
same result
any js errors?
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 = {};
aha
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]]
i specify clojure/clojurescript directly, and use the react deps provided by each version of reagent i test
well, this is promising - it wrote an out
directory for the first time
I had removed :output-dir
before because it appeared to not be using it
success!
many thanks
:thumbsup: