reagent-project / reagent

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

Remove default React dependencies #537

Closed Deraen closed 3 years ago

Deraen commented 3 years ago

This is already implemented in 0d4424af3c0db323347c0e7c02aab96fbfbb96d1

I'm opening this in case someone has comments about this, and to keep track of tasks that should be done before this is released:

Purpose of the change is to make it easier for Reagent consumers to select how and what React version they use (so continuing the previous changes which moved DOM functions to separate ns). Providing direct dependency to cljsjs packages adds unnecessary packages to environments where they aren't needed, like projects using shadow-cljs, or React-native projects. This also makes it more obvious that consumer projects can select React version themselves, as Reagent should support different React version quite well.

It is also similar to how in JS ecosystem the React libraries declare React as peerDependency, meaning that npm will warn if React isn't provided, but the consumer projects have to provide React dependency themselves.

Note: though this is breaking change, I'm thinking of using 1.1 as the next version number. Reagent doesn't need to follow SemVer and I think this isn't so big breaking change that this would demand 2.0 release.

Deraen commented 3 years ago

https://github.com/reagent-project/reagent-template/pull/183