This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-21
Channels
- # admin-announcements (4)
- # beginners (41)
- # boot (46)
- # cider (8)
- # clojure (132)
- # clojure-austin (15)
- # clojure-belgium (3)
- # clojure-greece (3)
- # clojure-hk (1)
- # clojure-mexico (4)
- # clojure-quebec (5)
- # clojure-russia (46)
- # clojure-spec (225)
- # clojure-taiwan (1)
- # clojure-uk (17)
- # clojurescript (46)
- # clojurewerkz (1)
- # core-async (28)
- # cursive (9)
- # datascript (3)
- # datomic (5)
- # defnpodcast (42)
- # devcards (60)
- # emacs (27)
- # hoplon (7)
- # lein-figwheel (5)
- # leiningen (12)
- # mount (8)
- # om (13)
- # play-clj (2)
- # reagent (47)
- # rethinkdb (5)
- # ring-swagger (7)
- # spacemacs (9)
- # specter (12)
- # testing (1)
- # untangled (1)
- # vim (11)
- # yada (31)
@bhauman: what’s the purpose of the html-env?
function in devcards?
I can see you e.g. define some React lifecycle functions conditionally based on that
@bhauman: Right, I suspected that. but there are things like js/document.getElementById
that are used throughout the code
@bhauman: I wanna make the devcards-om-next
stuff compatible with that too. could you point me to the code paths that it uses?
gotcha
@bhauman: thanks, render-namespace-to-string
seems to be one of the things I’m looking for
@bhauman: this should work, I supose: (render-namespace-to-string *ns*)
@anmonteiro: before you make any render calls
makes sense, yeah
let me try that
and you also have to differentiate between the code that is just the card code and the code that is in the card... because the card may render but the card content may not. So starting with a bare hello world project may make more sense
@bhauman: hrm, no errors, but render-namespace-to-string
returns nil
my mistake
trying again
wrong namespace 🙂
@bhauman: get-cards-for-ns
also returning nil
correct ns now. I clearly must be doing something wrong
oh wow, now I then that comes to bite me again
@bhauman: still no dice
@devcards.system/app-state
returns the initial state without any cards
there are definitely calls to devcards.core.register_card
in the compiled JS
@bhauman: so it needs to block in load-data-from-channel!
somehow
it’s only getting the register_card calls after I call render-namespace-to-string
@bhauman: so a few problems I had to get through:
1. load-data-from-channel!
needed to be called like this: (go (<! (dc/load-data-from-channel!)))
2. my NS had -
which were munged so I needed to pass the munged symbol to render-namespace-to-string
3. now getting an error with React.renderToString
because it moved to ReactDOMServer.renderToString in later versions of React
¯\(ツ)/¯
using my own version of render-namespace-to-string
works (just replaced React.renderToString with ReactDOMServer.renderToString)
so kudos to you!
@bhauman: I’ll put something together in the next few days
maybe also convert from demunged ns symbols to the actual (munged) keyword that devcards uses internally