reagent

A minimalistic ClojureScript interface to React.js http://reagent-project.github.io/
2020-04-15T12:53:30.163800Z

Hello, we updated Reagent from version 0.8.1 to the newest version and somehow got ourselves a weird problem with our CLJS tests in CI (Linux). We have lein-doo + karma + Chrome setup for the tests and after the update the tests fail with the error

Chrome Headless 79.0.3945.130 (Linux x86_64) ERROR
  Uncaught ReferenceError: module$<path_here>$node_modules$object_assign$index is not defined
  at target/generated/js-tests/public/test-js/out/react.production.min.js:4:231
  ReferenceError: module$<path_here>$node_modules$object_assign$index is not defined
      at target/generated/js-tests/public/test-js/out/react.production.min.js:4:231
We use react from cljsjs (as a direct dependency, but same version that comes with Reagent). This does not happen on my machine (mac) - there isn't even that file target/generated/js-tests/public/test-js/out/react.production.min.js present on my machine. We use cljs compiler options for the karma related things but for nothing else:
:npm-deps {:karma "5.0.1"
           :karma-cljs-test "0.1.0"
           :karma-chrome-launcher "3.1.0"}
but now I noticed the generated package.json does have react and react-dom in it whereas before they weren't there. Not sure if it is related though. Any ideas where the problem could be? Many different things are present but as the problem happened after Reagent update, I thought I'd ask here first.

2020-04-15T12:58:06.163900Z

Well now I set

:install-deps false
for those test npm deps, removed react and react-dom from node_modules and now the tests run just fine. Is Reagent somehow adding react and react-dom to the generated package.json?

2020-04-15T13:19:17.164100Z

Is this everything working as intended and me just not understanding how install-deps option works?

juhoteperi 2020-04-15T14:41:18.164300Z

Working as intended. Reagent declares npm dependency on React (mostly for Shadow-cljs use) and if you set :install-deps true those will be installed: https://github.com/reagent-project/reagent/blob/master/src/deps.cljs

aarkerio 2020-04-15T17:05:25.165300Z

hi! what function replace "reagent/render" ?

p-himik 2020-04-15T17:06:53.165400Z

IIRC reagent.dom/render. It should be in the deprecation notice.

aarkerio 2020-04-15T17:08:35.165600Z

I'm getting "reagent.core/render is deprecated"

aarkerio 2020-04-15T17:10:28.165800Z

"mount-root" looks like is the new thing.

arttuka 2020-04-15T17:11:59.166Z

it's reagent.dom/render , like p-himik already said

aarkerio 2020-04-15T17:12:10.166200Z

I see, thx!

kenny 2020-04-15T23:41:40.167Z

Is there a table with which versions of React are compatible with which versions of Reagent?