Fork me on GitHub
#om
<
2017-07-08
>
ajs05:07:47

What is the last version of Om now/previous I could upgrade a legacy code base to? Looks like it is the same repo as Om Next, is that right?

johnny.martin15:07:55

I thought I remembered seeing fixes to get SVG working. But sadly <rect/> renders without any attributes. I must be missing something. I have a one line modification to https://github.com/omcljs/om/wiki/Quick-Start-%28om.next%29

(dom/div nil "Hello, world!")
changed to
(dom/svg {:width "100%" :height "100%"}
                   (dom/rect {:width 100 :height 66
                              :x 50 :y 50
                              :fill "blue"}))
My project.clj uses versions recommended by the quick start tutorial,
;  :dependencies [[org.clojure/clojure "1.8.0"]
;                 [org.clojure/clojurescript "1.9.671"]
;                 [org.omcljs/om "1.0.0-beta1"]
;                 [figwheel-sidecar "0.5.4-6"]])

  :dependencies [[org.clojure/clojure "1.7.0"]
                 [org.clojure/clojurescript "1.7.170"]
                 [org.omcljs/om "1.0.0-alpha34"]
                 [figwheel-sidecar "0.5.0-SNAPSHOT" :scope "test"]])
When I tried with more recent versions (commented out), React.js responded with a hint,
Warning: Unknown props `meta`, `cnt`, `arr`, `__hash`, `cljs$lang$protocol_mask$partition0$`, `cljs$lang$protocol_mask$partition1$` on <svg> tag. Remove these props from the element. For details, see  in svg

the-kenny16:07:25

@johnny.martin: you're using {...} instead of #js{...} to set the props on your <rect/>

the-kenny16:07:09

@johnny.martin:`#js{...}` creates a Javascript object, {...} creates a ClojureScript map

johnny.martin16:07:18

Arrg., of course.... Thank you!

the-kenny16:07:12

@johnny.martin For later, I recommend sablono (https://github.com/r0man/sablono). It gets you the known hiccup syntax which I find nicer to read.

matan19:07:58

the-kenny: I just saw this comment, doesn't om/om.next come with something like this itself?

the-kenny21:07:23

It does? Haven't seen it.

jeremys20:07:17

Hey guys I have a question about query in om next. Specifically, can I design a query such that I indicate that I want the received props to be a vector of maps instead of a map ? For instance, looking at the “Components, Identity & Normalization” from the wiki, the ListView component doesn’t have a query of it’s own. I quess my question is, could I make similar components that expose a query indicating the list to display ? If possible, what would it look like ?