React Native v0.73.2 Flipper dependency for Android

182 Views Asked by At

I just scaffolded default project using react-native cli with react-native v0.73.2 and for Android build.gradle has flipper dependency as below

implementation("com.facebook.react:flipper-integration")

my doubt: why is dependency marked as implementation? when the flipper is there only for debugging purposes.

1

There are 1 best solutions below

2
Pratik Prakash Bindage On

The implementation keyword in Gradle is used to declare a dependency that will be included in the app's runtime classpath.

This means that the dependency will be available to all classes in the app, including those that are not directly dependent on it.

Flipper is a debugging tool for React Native apps. It provides a variety of features, such as the ability to inspect the app's state, step through code, and set breakpoints. Flipper is not required for the app to run, but it can be very helpful for debugging purposes.

There are a few reasons why Flipper might be marked as an implementation dependency, even though it is only used for debugging.

First, it is possible that Flipper may be used by some of the app's classes even if they are not directly dependent on it. For example, Flipper may be used by the app's logging library to provide additional debugging information.

Second, marking Flipper as an implementation dependency ensures that it will be available to all classes in the app, even if they are not directly dependent on it. This can be helpful for debugging purposes, as it allows you to easily access Flipper from any class in the app.

If you are not using Flipper for debugging purposes, you can remove it from the app's dependencies. However, if you are using Flipper for debugging purposes, it is recommended that you leave it marked as an implementation dependency.