reagent-project / reagent

A minimalistic ClojureScript interface to React.js
http://reagent-project.github.io/
MIT License
4.76k stars 414 forks source link

Support React 17.0.2 #536

Closed lowecg closed 3 years ago

lowecg commented 3 years ago

Is it possible to use React version 17.0.2? My builds are outputting the following warnings:

NPM dependency "react" has installed version "17.0.2"
"17.0.1" was required by jar:file:/Users/lowecg/.m2/repository/reagent/reagent/1.0.0/reagent-1.0.0.jar!/deps.cljs
NPM dependency "react-dom" has installed version "17.0.2"
"17.0.1" was required by jar:file:/Users/lowecg/.m2/repository/reagent/reagent/1.0.0/reagent-1.0.0.jar!/deps.cljs

The React release for 17.0.2 seems worthwhile since it addresses a "SharedArrayBuffer cross-origin isolation" warning in Chrome.

https://github.com/facebook/react/blob/master/CHANGELOG.md#1702-march-22-2021

Forgive a potentially naive question - does deps.cljs support an NPM-style semver wildcarding (^ = latest minor, ~ = latest patch). If so, would latest patch be worth considering?

Deraen commented 3 years ago

I don't think deps.cljs supports wildcards, but I'm not sure.

Anyway, those warnings are from Shadow-cljs?

Reagent itself should be fully compatible with this React, seeing that this is minor release. Will be fine to update default React in Reagent, but there won't be Reagent release for every React update to just update deps. You could just ignore those warnings when you select the React version yourself, or find a way to disable these warnings in the build tool you use.

lowecg commented 3 years ago

Understood and thank you for the response.

Those warnings are from Shadow-cljs, yes. Sorry, I forgot to mention that!

I couldn't see a way to disable these particular warnings, but I did end up disabling NPM dependencies from Shadow-cljs entirely which certainly does remove the warning.

I found a similar issue on the shadow-cljs project. According to the following comment, the CLJSJS dependency isn't used anyway so turning off NPM dependencies is the only course.

https://github.com/thheller/shadow-cljs/issues/800#issuecomment-725716087

You can set :npm-deps {:install false} in shadow-cljs.edn at the top level.

Deraen commented 3 years ago

I'm also just disabling automatic npm-deps on every shadow-cljs project and make sure the build scripts just call npm directly. As mentioned by Thomas, :npm-deps is very limited.