Skip to content

Commit

Permalink
Remove ReactNative/Flipper Integration (#40935)
Browse files Browse the repository at this point in the history
Summary:

This is scheduled to land in 0.74, so I'm removed the native integration as this is not needed anymore.
The only thing I left is a stub class to ease the migration out of `ReactNativeFlipper`.

Changelog:
[Android] [Removed] - Remove ReactNative/Flipper Integration

Reviewed By: mdvacca, huntie, cipolleschi

Differential Revision: D50259817
  • Loading branch information
cortinico authored and facebook-github-bot committed Oct 16, 2023
1 parent 3d5324a commit 15f7c8e
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 178 deletions.
1 change: 0 additions & 1 deletion .circleci/configurations/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ jobs:
- packages/react-native/ReactAndroid/build/
- packages/react-native/ReactAndroid/hermes-engine/.cxx/
- packages/react-native/ReactAndroid/hermes-engine/build/
- packages/react-native/ReactAndroid/flipper-integration/build/
- packages/react-native/ReactAndroid/src/main/jni/prebuilt/
- packages/react-native-gradle-plugin/.gradle/
- packages/react-native-gradle-plugin/build/
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ project.xcworkspace
/packages/react-native/ReactAndroid/gradlew.bat
/packages/react-native/ReactAndroid/external-artifacts/build/
/packages/react-native/ReactAndroid/external-artifacts/artifacts/
/packages/react-native/ReactAndroid/flipper-integration/build/
/packages/react-native/ReactAndroid/hermes-engine/build/
/packages/react-native/ReactAndroid/hermes-engine/.cxx/
/packages/react-native/template/android/app/build/
Expand Down
3 changes: 0 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ tasks.register("publishAllToMavenTempLocal") {
description = "Publish all the artifacts to be available inside a Maven Local repository on /tmp."
dependsOn(":packages:react-native:ReactAndroid:publishAllPublicationsToMavenTempLocalRepository")
// We don't publish the external-artifacts to Maven Local as CircleCI is using it via workspace.
dependsOn(
":packages:react-native:ReactAndroid:flipper-integration:publishAllPublicationsToMavenTempLocalRepository")
dependsOn(
":packages:react-native:ReactAndroid:hermes-engine:publishAllPublicationsToMavenTempLocalRepository")
}
Expand All @@ -97,7 +95,6 @@ tasks.register("publishAllToSonatype") {
description = "Publish all the artifacts to Sonatype (Maven Central or Snapshot repository)"
dependsOn(":packages:react-native:ReactAndroid:publishToSonatype")
dependsOn(":packages:react-native:ReactAndroid:external-artifacts:publishToSonatype")
dependsOn(":packages:react-native:ReactAndroid:flipper-integration:publishToSonatype")
dependsOn(":packages:react-native:ReactAndroid:hermes-engine:publishToSonatype")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ internal object DependencyUtils {
/**
* This method takes care of configuring the resolution strategy for both the app and all the 3rd
* party libraries which are auto-linked. Specifically it takes care of:
* - Forcing the react-android/hermes-android/flipper-integration version to the one specified in
* the package.json
* - Forcing the react-android/hermes-android version to the one specified in the package.json
* - Substituting `react-native` with `react-android` and `hermes-engine` with `hermes-android`.
*/
fun configureDependencies(
Expand All @@ -71,7 +70,6 @@ internal object DependencyUtils {
}
configuration.resolutionStrategy.force(
"${groupString}:react-android:${versionString}",
"${groupString}:flipper-integration:${versionString}",
)
if (!(eachProject.findProperty(INTERNAL_USE_HERMES_NIGHTLY) as? String).toBoolean()) {
// Contributors only: The hermes-engine version is forced only if the user has
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ group = "com.facebook.react"

version =
parent?.extraProperties?.get("publishing_version")
?: error("publishing_version not set for flipper-integration")
?: error("publishing_version not set for external-artifacts")

configurations.maybeCreate("default")

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.flipper

import android.content.Context
import com.facebook.react.ReactInstanceManager

/**
* Stub class that does nothing to ease the migration out of Flipper. Users should stop calling
* `ReactNativeFlipper.initializeFlipper` in their `MainApplication.java` as this class will be
* removed in React Native 0.75 or future versions.
*/
@Deprecated(
message =
"ReactNative/Flipper integration is deprecated. Please remove the call to initializeFlipper from your MainApplication.java",
replaceWith = ReplaceWith(""),
level = DeprecationLevel.WARNING)
object ReactNativeFlipper {
@Suppress("UNUSED_PARAMETER")
@JvmStatic
@Deprecated(
message =
"ReactNative/Flipper integration is deprecated. Please remove the call to initializeFlipper from your MainApplication.java",
replaceWith = ReplaceWith(""),
level = DeprecationLevel.WARNING)
fun initializeFlipper(context: Context, reactInstanceManager: ReactInstanceManager) {
// no-op
}
}
4 changes: 0 additions & 4 deletions packages/react-native/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ androidx-tracing = "1.1.0"
assertj = "3.21.0"
download = "5.4.0"
fbjni = "0.5.1"
flipper = "0.201.0"
fresco = "3.0.0"
infer-annotation = "0.18.0"
javax-annotation-api = "1.3.2"
Expand Down Expand Up @@ -51,9 +50,6 @@ androidx-test-runner = { module = "androidx.test:runner", version.ref = "android
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidx-test" }

fbjni = { module = "com.facebook.fbjni:fbjni", version.ref = "fbjni" }
flipper = { module = "com.facebook.flipper:flipper", version.ref = "flipper" }
flipper-network-plugin = { module = "com.facebook.flipper:flipper-network-plugin", version.ref = "flipper" }
flipper-fresco-plugin = { module = "com.facebook.fresco:flipper-fresco-plugin", version.ref = "fresco" }
fresco = { module = "com.facebook.fresco:fresco", version.ref = "fresco" }
fresco-middleware = { module = "com.facebook.fresco:middleware", version.ref = "fresco" }
fresco-imagepipeline-okhttp3 = { module = "com.facebook.fresco:imagepipeline-okhttp3", version.ref = "fresco" }
Expand Down
5 changes: 0 additions & 5 deletions packages/react-native/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,3 @@ include(":packages:react-native:ReactAndroid:hermes-engine")

project(":packages:react-native:ReactAndroid:hermes-engine").projectDir =
file("ReactAndroid/hermes-engine/")

include(":packages:react-native:ReactAndroid:flipper-integration")

project(":packages:react-native:ReactAndroid:flipper-integration").projectDir =
file("ReactAndroid/flipper-integration/")
1 change: 0 additions & 1 deletion packages/react-native/template/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ android {
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation("com.facebook.react:flipper-integration")

if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import com.facebook.react.common.annotations.UnstableReactNativeAPI
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.flipper.ReactNativeFlipper
import com.facebook.soloader.SoLoader

@UnstableReactNativeAPI
Expand Down Expand Up @@ -47,6 +46,5 @@ class MainApplication : Application(), ReactApplication {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
}
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
}
}
1 change: 0 additions & 1 deletion packages/rn-tester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ android {
dependencies {
// Build React Native from source
implementation project(':packages:react-native:ReactAndroid')
implementation project(':packages:react-native:ReactAndroid:flipper-integration')

// Consume Hermes as built from source only for the Hermes variant.
hermesImplementation(project(":packages:react-native:ReactAndroid:hermes-engine"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import com.facebook.react.defaults.DefaultComponentsRegistry.Companion.register
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.fabric.ComponentFactory
import com.facebook.react.flipper.ReactNativeFlipper.initializeFlipper
import com.facebook.react.interfaces.exceptionmanager.ReactJsExceptionHandler
import com.facebook.react.module.model.ReactModuleInfo
import com.facebook.react.module.model.ReactModuleInfoProvider
Expand Down Expand Up @@ -122,7 +121,6 @@ class RNTesterApplication : Application(), ReactApplication {
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
load()
}
initializeFlipper(this, reactNativeHost.reactInstanceManager)
}

@UnstableReactNativeAPI
Expand Down
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pluginManagement {

include(
":packages:react-native:ReactAndroid",
":packages:react-native:ReactAndroid:flipper-integration",
":packages:react-native:ReactAndroid:hermes-engine",
":packages:react-native:ReactAndroid:external-artifacts",
":packages:rn-tester:android:app")
Expand Down

0 comments on commit 15f7c8e

Please sign in to comment.