Fork me on GitHub
#reagent
<
2018-03-28
>
lwhorton00:03:26

ugh. so I have to use a charting library that’s depending on cljsjs/react 16^, but the latest version of reagent depends on cljsjs/react 15^

lwhorton00:03:44

is this a safe upgrade? who knows, the js world is spooky.

justinlee00:03:25

I think the latest reagent snapshot uses react 16

lwhorton00:03:02

yea I saw that, but man i’m so far removed from using the latest. i’ve been bitten so many times by lazy devs who release backwards incompatible stuff.

justinlee00:03:03

i also think you can use reagent 1.7 and just manually insert the new libraries, but of course you’ll have to add the create-react-class compatibility library too

justinlee00:03:16

actually I think it is in pretty good shape

justinlee00:03:42

the cljs side didn’t change much. juho mostly just added stuff to work with fragments.

justinlee00:03:56

but at any rate, I do think that old reagent will work with react 16

lwhorton00:03:36

ideally I could just from my library that requires 16 do an :exclusions and use my older 15 react brough in by reagent, eh?

lwhorton00:03:59

i mean, it’s a cljsjs package so theres a very low likelihood that you actually need the latest react.

lwhorton00:03:06

that’s a bad idea too, lol.

justinlee00:03:40

yea if you are using cljsjs you have to do an exclusion and then include in manually. and hope that there’s a cljsjs release for react 16 😛

justinlee00:03:46

this is why i use shadow 🙂

lwhorton00:03:49

i gave shadow a try, the repl is just no bueno and that’s where i do 50% of my work

lwhorton00:03:02

would be nice to have a cljs-focused tool like shadow that handles really common patterns like compile, hash, npm integration, etc. but if the repl isn’t at least on par with fighweel it’s a nonstarter, for me

justinlee00:03:26

what didn’t you like? the editing?

justinlee00:03:38

i’d really just like to see his npm management and externs inference get incorporated. it is so much better.

lwhorton00:03:45

it didnt offer history across sessions, if you executed a syntax error it would just quit the process, i couldnt figure out any way to get it to play with vim-fireplace

justinlee00:03:57

interesting. i mostly rely on hot reloading and the only thing i need the repl for is my ide

vikeri11:03:19

Are there any examples of how to use reagent with a react component from npm that is written in JSX? Preferably using the npm-deps option

juhoteperi11:03:41

@vikeri npm packages don't usually contain JSX code

vikeri11:03:01

@juhoteperi Double checked and yes it didn’t. Getting a bunch of errors though:

_meta.js:19 Uncaught ReferenceError: META is not defined
Uncaught ReferenceError: es6Symbols$$module$Users$viktor$www$projects$pilloxa_log_analyzer$node_modules$babel_runtime$node_modules$core_js$library$modules$es6_symbol is not defined
    at es6.symbol.js:100
Uncaught TypeError: Cannot set property 'wrap' of undefined
    at runtime.js:8
etc. Haven’t been using external libs outside of cljsjs in a while. So maybe it’s something obvious I’m missing

pesterhazy11:03:00

my understanding is that if the lib uses JSX, the npm package contains a compiled bundle so you don't need babel or whatever to use it

pesterhazy11:03:24

This should work but it's not particularly elegant

achikin12:03:30

I'm getting this message when trying to use <select> in reagent

achikin12:03:37

Warning: Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>.

achikin12:03:05

But when I add value to a <select> reagent sends another warning

achikin12:03:20

Warning: Failed prop type: Invalid prop `value` supplied to `Select`.

achikin12:03:42

Ah, nevermind. I've used something inappropriate as a value. Neither number nor string.

justinlee16:03:19

@vikeri what package are you trying to include? my guess is that you have failed to include a transitive dependency