This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-22
Channels
- # beginners (124)
- # boot (7)
- # cider (73)
- # cljs-dev (37)
- # cljsrn (6)
- # clojure (85)
- # clojure-greece (4)
- # clojure-italy (67)
- # clojure-nl (6)
- # clojure-russia (4)
- # clojure-spec (6)
- # clojure-uk (48)
- # clojurescript (26)
- # cursive (5)
- # data-science (23)
- # datomic (63)
- # editors (5)
- # emacs (4)
- # graphql (13)
- # immutant (2)
- # lumo (4)
- # mount (3)
- # off-topic (1)
- # onyx (4)
- # pedestal (7)
- # portkey (10)
- # re-frame (14)
- # reagent (10)
- # ring-swagger (18)
- # shadow-cljs (97)
- # spacemacs (1)
- # tools-deps (9)
- # vim (1)
- # yada (13)
check out https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml, and pay particular attention to the dangerously bit. There is probably a way that you can achieve your goal that doesn't involve inlining HTML, and that way will not expose you to the problems that inlining HTML from a stream will.
@roti It sounds like you're using a static file from your question, and you're asking in clojurescript so you already have a build step. I strongly encourage you to check out kioo (https://github.com/ckirkendall/kioo) which lets you slurp up the contents of an HTML file as a template and returns a react virtual dom.
Hey folks, sorry if this is a repeat but is it common knowledge that cljsbuild will clobber variables in a let scope if they have variables of the same name but one is snake case and one is kebab case?
it's unavoidable
given ClojureScript's symbol mangling rules
I'm not sure it's documented anywhere
maybe it would be possible to add a warning
the tricky bit is that shadowing with the same name is often desired behavior
are you sure there's a difference?
I stuck an equivalent print statement in a figwheel project and it didn't clobber the variables
Interesting difference:
(defn aaa []
(let [foo-bar 1, foo_bar 2]
(println "aaa" foo-bar)
(println "bbb" foo_bar)))
(let [foo-bar 1, foo_bar 2]
(println "AAA" foo-bar)
(println "BBB" foo_bar))
(aaa)
AAA 1
BBB 2
aaa 2
bbb 2
When run from Figwheel, the shadowing happens only inside the function body, not in the top-level let
In any case, ignore my "avoidable" comment above 🙂
@djtango @pesterhazy it’s probably avoidable, but also I pretty minor issue
thanks for getting back to me! Agreed it's not idiomatic - I came across it when destructuring a snake-cased and processing it in-flight so it was somewhat indicative that the function was doing to much...
Right