This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-10
Channels
- # aws (45)
- # bangalore-clj (16)
- # beginners (109)
- # boot (137)
- # cider (7)
- # cljs-dev (54)
- # cljsrn (22)
- # clojure (77)
- # clojure-conj (1)
- # clojure-greece (2)
- # clojure-nl (5)
- # clojure-russia (36)
- # clojure-spec (15)
- # clojure-uk (54)
- # clojurescript (118)
- # cursive (7)
- # datomic (25)
- # emacs (33)
- # hoplon (276)
- # klipse (38)
- # lein-figwheel (1)
- # leiningen (9)
- # melbourne (1)
- # off-topic (18)
- # om (98)
- # onyx (6)
- # pedestal (1)
- # perun (24)
- # re-frame (46)
- # reagent (6)
- # ring-swagger (3)
- # spacemacs (67)
- # specter (15)
- # untangled (33)
- # vim (6)
@anmonteiro any chance that you could cut a new alpha release of compassus including this change? https://github.com/compassus/compassus/commit/2122406a26392d840dd9df3daf8645de520677e6
is using parser
inside the env
argument in the parser functions intended for running queries within the parser functions?
levitanong: I think so.. for recursive parsing
For server side rendering, the content inside a (dom/script)
is being html-escaped. Is this correct? Is there a way to avoid this?
Example
(dom/render-to-str (dom/script nil "foo('bar');"))
=> "<script data-reactroot=\"\" data-reactid=\"1\" data-react-checksum=\"-1720051763\"> foo('bar');</script>"
@petterik probably a bug. We need to check how React acts in that case
@anmonteiro thanks
@petterik hrm:
(dom/render-to-str (dom/script nil "'foo bar'"))
"<script data-reactroot=\"\" data-reactid=\"1\" data-react-checksum=\"1770461025\">'foo bar'</script>"
seems like the correct behavior
(this is at the node repl using react dom server)
you'll have to do it like this:
cljs.user=> (dom/render-to-str (dom/script #js {:dangerouslySetInnerHTML #js {:__html "'foo bar'"}}))
"<script data-reactroot=\"\" data-reactid=\"1\" data-react-checksum=\"-1734339355\">'foo bar'</script>"
(dom/render-to-str (dom/script {:type "text/javascript" :dangerouslySetInnerHTML {:__html "'foo'"}}))
=> "<script type=\"text/javascript\" data-reactroot=\"\" data-reactid=\"1\" data-react-checksum=\"297998988\"></script>"
we might not handle dangerouslySetInnerHTML
in Om
open an issue please 🙂
@anmonteiro will do!
thanks!
@anmonteiro Verified that it works with a simple string and in our app with more complex examples! Thanks creating a patch so fast!
awesome 👍
question, should I close the issue now that I've verified it? Or is that something you do when the pull request has been merged?
should be closed when the PR is merged
it's OK to leave it open
hi. is it possible to wrap a defui in a function in order to pass it params? i think i may be getting error because of this: "Map literal must contain an even number of forms", either that or i need to bind them somehow?
@sophiago you can do that but ui
exists to make anonymous components. i.e.:
(ui
Object
(render [this]
...))
the error you're getting has nothing to do with any of this, you're most likely creating a map with an odd number of forms 🙂
which means you don't have a value for some key
sorry...anyway, the reason i asked that specific question was because i figured maybe the param wasn't being passed through hence resulting in the mismatch
@sophiago hrm something wrong with the syntax there?
matrix(args)
is JS, (matrix args)
is ClojureScript
well, it's not about matrices
it's about Lisp syntax
you probably also want to drop the #
I think
unless you want the div
child to be a function
but I suspect you want the result of the function
if you have an error Figwheel won't compile
it should show you its HUD with the error
really exciting now to see how om.next interops with this decent sized library i wrote
hmm, it's compiling. but i switched to ui and not i'm getting Use of undeclared Var core/ui and errors from the following lines that are also replicated in the js
@anmonteiro the matrix syntax...that's not core.matrix you were thinking, but js interop, right? because that seems to be the last warning i'm getting
it might be the case i just need to quote it and have the symbol "matrix" at the front of the list?
@sophiago uh as I said I didn't mean "matrix syntax", but lisp syntax in general
I'm not sure what you're trying to achieve, but if matrix
is a function it needs to be inside the parens
(matrix ...)
it does seem like that from the css, but doesn't really make sense to have a function inside a selector?
oh.. is matrix
a CSS thing?
then everything should probably be inside a string
"matrix( ... )"
hrm, so if it's CSS you need to pass it as a string
like you'd do in plain JavaScript
the next thing is putting #js
in front of the map
and now i have to run to go see rich talk about spec since it'll likely be standing room only and i tend to be late to those things
oh it's not
sorry
you only need to pass #js
to dom/
stuff