Fork me on GitHub
#reagent
<
2016-10-06
>
mikethompson12:10:19

@superstructor ^^^^ do you have any advice

borkdude12:10:44

Reagent now is dependent on these two packages: [cljsjs/react-dom "15.2.1-0"] [cljsjs/react-dom-server "15.2.1-0”] Before we had this in our build.boot: [reagent "0.6.0-rc" :exclusions [cljsjs/react]] [cljsjs/react-with-addons "15.1.0-0”] When upgrading: [reagent "0.6.0" :exclusions [cljsjs/react]] [cljsjs/react-with-addons "15.3.1-0”] should I instead add react-dom and react-dom-server to the exclusions?

juhoteperi12:10:36

@borkdude You need both react-dom and react-dom-server, but you can either 1. use global exclusion to drop react dep from react-dom and react-dom-server 2. exclude react-dom and dom-server from reagent and add direct dep to all three packages

borkdude12:10:14

@juhoteperi what about: [reagent "0.6.0" :exclusions [cljsjs/react]] [cljsjs/react-with-addons "15.3.1-0”] is that sufficient?

juhoteperi12:10:00

@borkdude No, reagent doesn't have direct dependency to cljsjs/react so that exclusion doesn't work

borkdude12:10:23

I guess we did something wrong before also then

borkdude12:10:29

but I’ll go for your solution thanks @juhoteperi

juhoteperi12:10:43

:exclusions [cljsjs/react]
:dependencies [[reagent "0.6.0"]
               [cljsjs/react-with-addons "..."]]

;; or

:dependencies [[reagent "0.6.0" :exclusions [cljsjs/react-dom cljsjs/react-dom-server]]
               [cljsjs/react-with-addons "..."]
               [cljsjs/react-dom "..." :exclusions [cljsjs/react]]
               [cljsjs/react-dom-server "..." :exclusions [cljsjs/react]]]

juhoteperi12:10:54

I guess Reagent readme should be updated

borkdude12:10:03

I have the second. Why would the first also work?

juhoteperi12:10:43

global exclusions are applied to transitive dependencies also

borkdude12:10:12

ah sorry, I didn’t see the global exclusion

j_pb12:10:38

Hey, does one of you know if it's intentional that you can't nest wraps in cursors? Or if it's a bug?

reefersleep12:10:39

What do you mean, @j_pb? Could you give an example?

j_pb12:10:28

@reefersleep Not sure if there is just a case missing in the assert or if it's done intentionally.

reefersleep12:10:03

Good question. I can see that I am not it to answer it, as I only just heard of r/wrap when you introduced it now 🙂

j_pb12:10:32

This could be caused by wrap not being reactive

j_pb12:10:11

It behaves like an atom, in my case that is ok, because changing the wrap will also nuke the component hierarchy below.

reefersleep12:10:54

From the description on https://reagent-project.github.io/news/news050.html , I think you're on the right path with wrap not being reactive. But that's as far as I can get right now 🙂

borkdude13:10:48

Has this been renamed in React? (reagent/adapt-react-class js/React.addons.CSSTransitionGroup)

borkdude13:10:33

How should I get this object from react when I’m using cljsjs/react (with add-ons)?

borkdude13:10:37

Should this be correct code (indentation aside)?

(ns foo
    (:require [cljsjs.react :as react]
              [reagent.core :as reagent]))
  (reagent/adapt-react-class react/ReactCSSTransitionGroup)

pesterhazy15:10:27

@borkdude I think it just adds js/React to the global namespace

borkdude15:10:45

yeah it’s been solved, thanks

pesterhazy15:10:14

how was it solved?

borkdude20:10:29

@pesterhazy I had to write js/React.addons.CSSTransitionGroup or something

borkdude20:10:23

@pesterhazy but the major issue was that some other dependency pulled in react instead of react with addons

juhoteperi20:10:02

I created PR to fix with-addons example on Reagent readme: https://github.com/reagent-project/reagent/pull/266

borkdude20:10:01

@juhoteperi actually this worked for me eventually:

[reagent "0.6.0" :exclusions [cljsjs/react]]
    [cljsjs/react-with-addons "15.2.1-0"]

borkdude20:10:43

the exclusion probably works on transitive dependencies, so it works for react-dom as well which is a dependency of reagent

juhoteperi20:10:07

@borkdude Did you check the dependency tree? It might work due to with-addons overwriting foreign-lib from normal dep, but you could still have the dependency on classpath

borkdude20:10:35

I think I checked, but I’ll check again

juhoteperi20:10:43

You are correct.

juhoteperi20:10:51

I did check deps tree again myself

borkdude20:10:56

[reagent "0.6.0" :exclusions [[cljsjs/react]]]
├── [cljsjs/react-dom-server "15.2.1-0"]
└── [cljsjs/react-dom "15.2.1-0”]
…
[cljsjs/react-bootstrap "0.30.2-0" :exclusions [[org.webjars.bower/bootstrap] [cljsjs/react]]]
└── [cljsjs/bootstrap "3.3.6-0"]
[cljsjs/react-with-addons "15.2.1-0"]

juhoteperi20:10:42

I have probably had transitive dependencies to cljsjs/react from other deps than Reagent which is why I have used global exclusion

borkdude20:10:42

I probably forgot to restart boot, so that’s why I became confused…. or something. Don’t know. ¯\(ツ)