Fork me on GitHub
#reagent
<
2016-08-10
>
pesterhazy13:08:23

hiccup doesn't support the [:div {:style {:margin-top 10}}] syntax, or am I missing something?

pesterhazy13:08:34

(hiccup as in without reagent)

mikethompson13:08:00

Oh, wait. You mean server side hiccup, not Reagent?

pesterhazy13:08:39

server-side, yeah

reefersleep15:08:47

Is it possible to write css pseudoclass attributes in hiccup?

savelichalex15:08:34

@pesterhazy: you should use string, like margin-top: 10px in :style

pesterhazy16:08:33

@savelichalex: I understand, just mentioning that it'd be cool to support reagent-style attributes in hiccup too

savelichalex16:08:47

@pesterhazy: absolutly agree with you, last time I was confused too about it

savelichalex16:08:17

especially after reagent

shaun-mahood17:08:50

@pesterhazy: You up for opening an issue on the hiccup project to see if it's possible to add the reagent syntax as an option?

porglezomp19:08:39

So for reacting to ratoms, we have watch, cursor, and track, and anything else? I’m still shaky on how/when to use each, and I can’t find a good guide. Does someone have a good tutorial about them?

porglezomp19:08:58

Honestly track makes the most sense to me right now, so that’s what I’m using, but it means I have a lot of one-off functions.

shaun-mahood20:08:38

@porglezomp: Would reaction count as another way of reacting to ratoms in your list, or is that at a different level from what you're looking at?

porglezomp20:08:28

That would count. Any idea where to read about all of them?

shaun-mahood20:08:10

For reaction, the re-frame intro has a pretty good description I think https://github.com/Day8/re-frame#how-flow-happens-in-reagent

shaun-mahood20:08:29

No idea of any good resources for watch or track, though

lwhorton20:08:00

ugh.. can someone explain to me the confusing react package ecosystem? i’m trying to properly bring in reagent, exclude react, then bring in react from cljsjs, but man it’s confusing

lwhorton20:08:00

there’s react, r-dom, r-dom-server, but react itself isn’t really clear on what you need: r-dom/server is an extension to or a stack ontop of r-dom? and what about r-with-addons- is that the whole package with addons, or a ‘plugin’?

shaun-mahood20:08:22

@lwhorton: What exactly are you trying to do?

lwhorton20:08:57

I have 2 stacks running, a cljs app and a js app. the cljs wraps around the js. both apps have dependencies on some react libraries. i cannot figure out how to pull in reagent, and react, without duplicate version of react, if my js lib also needs the react-dom and dom/server libs.

lwhorton20:08:35

via cljsjs the libs are ultimately just tacked onto window.{library}, so i can reference from inside the js window.ReactDOM if I need it, works fine.

lwhorton20:08:07

The issue is I’m getting two copies of react on the page somehow, which is causing issues— and I dont know if that’s because I’m packaging things incorrectly.

lwhorton20:08:07

but there’s seemingly no documentation about “if you want react-\, you need first have react then ‘extend’ it with react-”… or whatever packaging strategy they’re using

lwhorton20:08:17

i’m attempting this in the boot configs:

[reagent "0.6.0-alpha" :exclusions [cljsjs/react cljsjs/react-dom cljsjs/react-dom-server]]
                  ,,,[cljsjs/react-with-addons "15.1.0-0"]
                  ,,,[cljsjs/react-dom "15.1.0-0"]
                  ,,,[cljsjs/react-dom-server "15.1.0-0"]

lwhorton20:08:29

but it’s not immediately clear that’s correct, either

oahner20:08:57

@lwhorton: your js code already makes use of react?

lwhorton20:08:01

previousl the js contained the cljs, but my cljs project grew large enough to warrant a flip - so now cljs needs to provide react instead of the other way around

lwhorton20:08:11

so .. yes - it did previously make use of react

oahner20:08:13

then you shouldn't have multiple copies of react loaded on the page

oahner20:08:15

if you take out your own js dependency and only use reagent without exclusions, do you end up with clashing react dependencies?

lwhorton20:08:21

ill try that

lwhorton20:08:32

(huge build times, be back in a sec)

oahner20:08:10

in any case, if the js portion of your project uses react or provides react, and you want to use that js code from cljs, you could simply package your js code as a foreign dependency and include react's externs in your own js library

oahner20:08:19

since it would effectively contain react at that point