marklawlor / nativewind

React Native utility-first universal design system - powered by Tailwind CSS
https://nativewind.dev
MIT License
4.3k stars 233 forks source link

[v4] Should react-native-reanimated be an optional peer dependency? #889

Open jgornick opened 3 weeks ago

jgornick commented 3 weeks ago

If I never use the animated classes, I won't need react-native-reanimated to be available and built in my native app. However, I will continuously get unmeet peer dependency warnings until I add it, which means it'll autolinked and built with my app.

I noticed that it used to be an optional peer dependency, but is now required.

How is react-native-reanimated different than react-native-svg and react-native-safe-area-context, which are optional?

Thanks!

jgornick commented 3 weeks ago

Related to react-native-reanimated, does it need to be tightly coupled to version >=3.6.2? According to the docs, the APIs should be the same between 2.x and 3.x.

In order to provide greater adoption, does it make sense to open it up a bit?

derek-primumco commented 3 weeks ago

In my opinion, if someone is bothering to use Nativewind 4, especially in its current pre-release state, then they should definitely be on @latest for React Native Reanimated.

jgornick commented 3 weeks ago

I tend to agree with you, but when working on a production app used by many distributed component teams, it's not as easy as seems to just force latest.

If the API and features of a 3rd party module are the same across many versions (even majors like react-native-reanimated), a library consuming that module should support the minimum version via peer deps. This helps greatly with adoption of the library too.

But this thread is more about react-native-reanimated being a peer dependency, regardless of version 😄