helix

Luke Johnson 2021-08-26T20:50:03.004200Z

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?

lilactown 2021-08-26T20:50:42.004600Z

helix should work with any version of React that includes hooks

lilactown 2021-08-26T20:50:55.004800Z

which is > React 16.8

lilactown 2021-08-26T20:51:12.005300Z

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

lilactown 2021-08-26T20:51:27.005700Z

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

Luke Johnson 2021-08-26T20:55:08.006700Z

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

lilactown 2021-08-26T20:55:44.006900Z

not really

lilactown 2021-08-26T20:56:09.007500Z

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

lilactown 2021-08-26T20:56:25.007800Z

so I'm currently testing against 17.0.1

lilactown 2021-08-26T20:57:08.008600Z

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

lilactown 2021-08-26T20:57:32.009200Z

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

lilactown 2021-08-26T20:58:23.010300Z

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

lilactown 2021-08-26T21:00:02.010600Z

sorry for the confusion!

Luke Johnson 2021-08-26T21:01:37.011Z

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

šŸ™‡šŸ» 1