Fork me on GitHub
#helix
<
2021-08-26
>
Luke Johnson20:08:03

Hello. Thanks for a great library. We use helix for one of the primary apps at Guaranteed Rate! I’m am a little confused about the version of react to use with Helix. Because we bring in a few other react-dependent npm dependencies, we have to also have react as a peer dependency. Anyway, helix uses "react": "^17.0.1" in the packages.json, but then requires

{:npm-deps {react "16.13.1"
            react-refresh "0.8.1"}}
in src/deps.cljs If I add "react": "^17.0.2" to my own package.json, I get errors like
NPM dependency "react" has installed version "^17.0.2"
"16.13.1" was required by jar:file:/Users/user/.m2/repository/lilactown/helix/0.1.1/helix-0.1.1.jar!/deps.cljs
NPM dependency "react-refresh" has installed version "^0.10.0"
"0.8.1" was required by jar:file:/Users/user/.m2/repository/lilactown/helix/0.1.1/helix-0.1.1.jar!/deps.cljs
Is this a possible bug/oversight, or a complete misunderstanding of things on my part?

lilactown20:08:42

helix should work with any version of React that includes hooks

lilactown20:08:55

which is > React 16.8

lilactown20:08:12

the deps.cljs was my way of trying to make things easy but in practice I think it's a mistake

lilactown20:08:27

those errors are not errors, just warnings by shadow-cljs. they do not block anything

Luke Johnson20:08:08

That makes sense. Is it intentional to have different versions in those 2 files?

lilactown20:08:09

the package.json in the repo for helix is for tests and local development of the library. it has no bearing on your application

lilactown20:08:25

so I'm currently testing against 17.0.1

lilactown20:08:08

the deps.cljs i added at some point because i had this idea that someone should be able to install helix without messing with their own package.json, if they don't want to control the version of React they use

lilactown20:08:32

so shadow-cljs and other tools will look at deps.cljs and automatically install whatever is in there for you

lilactown20:08:23

you can override it by providing your own versions in your app's package.json, which you've done. this generates a warning, but helix supports anything > React 16.8 so it's fine

lilactown21:08:02

sorry for the confusion!

Luke Johnson21:08:37

Thanks for all the context. I appreciate it. And thanks again for a great library!

3