Skip to content

Commit

Permalink
[build-properties][templates] remove flipper support (#26581)
Browse files Browse the repository at this point in the history
# Why

since flipper was removed from react-native 0.74 and it breaks the
nightlies testing. i'm going to remove flipper from main branch.

# How

- [templates] remove flipper
- [build-properties] remove flipper support
- [tools] remove flipper workaround patches for nightlies testing
  • Loading branch information
Kudo committed Jan 22, 2024
1 parent a5a6eec commit e19a15d
Show file tree
Hide file tree
Showing 39 changed files with 152 additions and 467 deletions.
3 changes: 0 additions & 3 deletions apps/bare-expo/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@ dependencies {
implementation jscFlavor
}

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

// LeakCanary 2 dependency
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.flipper.ReactNativeFlipper
import com.facebook.soloader.SoLoader

import expo.modules.ReactNativeHostWrapper
Expand Down Expand Up @@ -48,7 +47,6 @@ 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)
if (!USE_DEV_CLIENT) {
DevLauncherPackageDelegate.enableAutoSetup = false
DevMenuPackageDelegate.enableAutoSetup = false
Expand Down
18 changes: 0 additions & 18 deletions apps/bare-expo/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@ ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWO

prepare_react_native_project!

# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# ```js
# module.exports = {
# dependencies: {
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# ```
flipper_config = ENV['NO_FLIPPER'] == "1" || ENV['CI'] ? FlipperConfiguration.disabled : FlipperConfiguration.enabled

abstract_target 'BareExpoMain' do
pod 'expo-dev-menu', path: '../../../packages/expo-dev-menu', :testspecs => ['Tests', 'UITests']

Expand All @@ -39,7 +28,6 @@ abstract_target 'BareExpoMain' do

config = use_native_modules!

# Fix Google Sign-in and Flipper
post_install do |installer|
# `installer.pods_project` might be nil for `incremental_installation: true` and no new project generated
if installer.pods_project
Expand Down Expand Up @@ -77,10 +65,6 @@ abstract_target 'BareExpoMain' do
:new_arch_enabled => false,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/..",
#
# Uncomment to opt-in to using Flipper
# Note that if you have use_frameworks! enabled, Flipper will not work
# :flipper_configuration => flipper_config,
)
end

Expand All @@ -91,7 +75,6 @@ abstract_target 'BareExpoMain' do
:new_arch_enabled => false,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/..",
:flipper_configuration => FlipperConfiguration.disabled,
)
end

Expand All @@ -102,7 +85,6 @@ abstract_target 'BareExpoMain' do
:new_arch_enabled => false,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/..",
:flipper_configuration => FlipperConfiguration.disabled,
)

pod 'ExpoModulesTestCore', :path => "../../../packages/expo-modules-test-core/ios"
Expand Down
1 change: 0 additions & 1 deletion apps/fabric-tester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ dependencies {
}
}

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

import expo.modules.ApplicationLifecycleDispatcher
Expand Down Expand Up @@ -48,7 +47,6 @@ 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)
ApplicationLifecycleDispatcher.onApplicationCreate(this)
}

Expand Down

This file was deleted.

26 changes: 0 additions & 26 deletions apps/fabric-tester/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,6 @@ install! 'cocoapods',

prepare_react_native_project!

# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...), which will be excluded. To fix this,
# you can also exclude `react-native-flipper` in `react-native.config.js`
#
# ```js
# module.exports = {
# dependencies: {
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# }
# }
# ```
flipper_config = FlipperConfiguration.disabled
if ENV['NO_FLIPPER'] == '1' then
# Explicitly disabled through environment variables
flipper_config = FlipperConfiguration.disabled
elsif podfile_properties.key?('ios.flipper') then
# Configure Flipper in Podfile.properties.json
if podfile_properties['ios.flipper'] == 'true' then
flipper_config = FlipperConfiguration.enabled(["Debug", "Release"])
elsif podfile_properties['ios.flipper'] != 'false' then
flipper_config = FlipperConfiguration.enabled(["Debug", "Release"], { 'Flipper' => podfile_properties['ios.flipper'] })
end
end

target 'fabrictester' do
use_expo_modules!
config = use_native_modules!
Expand All @@ -50,8 +26,6 @@ target 'fabrictester' do
:fabric_enabled => true,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/..",
# Note that if you have use_frameworks! enabled, Flipper will not work if enabled
:flipper_configuration => flipper_config
)

post_install do |installer|
Expand Down
15 changes: 0 additions & 15 deletions apps/native-tests/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,6 @@ podfile_properties = JSON.parse(File.read('./Podfile.properties.json')) rescue {

prepare_react_native_project!

# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# ```js
# module.exports = {
# dependencies: {
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# ```
flipper_config = ENV['NO_FLIPPER'] == "1" || ENV['CI'] ? FlipperConfiguration.disabled : FlipperConfiguration.enabled

platform :ios, podfile_properties['ios.deploymentTarget'] || '13.4'
install! 'cocoapods',
:deterministic_uuids => false
Expand All @@ -40,10 +29,6 @@ target 'NativeTests' do
:hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/..",
#
# Uncomment to opt-in to using Flipper
# Note that if you have use_frameworks! enabled, Flipper will not work
# :flipper_configuration => flipper_config,
)

post_install do |installer|
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2461,15 +2461,15 @@ index 9430b0f9b6..07c9fce65d 100644
+
+module.exports = config;
diff --git a/templates/expo-template-bare-minimum/package.json b/templates/expo-template-bare-minimum/package.json
index 69e7eb9619..5029c75e79 100644
index 69e7eb9619..442e1c5722 100644
--- a/templates/expo-template-bare-minimum/package.json
+++ b/templates/expo-template-bare-minimum/package.json
@@ -1,7 +1,7 @@
{
"name": "expo-template-bare-minimum",
"description": "This bare project template includes a minimal setup for using unimodules with React Native.",
- "version": "45.0.6",
+ "version": "50.0.26",
+ "version": "50.0.30",
"main": "index.js",
"scripts": {
"start": "expo start --dev-client",
Expand All @@ -2484,7 +2484,7 @@ index 69e7eb9619..5029c75e79 100644
- "react-dom": "17.0.2",
- "react-native": "0.68.2",
- "react-native-web": "0.17.7"
+ "expo": "~50.0.0-preview.11",
+ "expo": "~50.0.2",
+ "expo-status-bar": "~1.11.1",
+ "react": "18.2.0",
+ "react-native": "0.73.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ index 0e77904834..0000000000
- ],
-)
diff --git a/templates/expo-template-bare-minimum/android/app/build.gradle b/templates/expo-template-bare-minimum/android/app/build.gradle
index 346fb02564..a265c80fa9 100644
index 346fb02564..a5123eed53 100644
--- a/templates/expo-template-bare-minimum/android/app/build.gradle
+++ b/templates/expo-template-bare-minimum/android/app/build.gradle
@@ -1,232 +1,97 @@
@@ -1,232 +1,95 @@
apply plugin: "com.android.application"
-
-import com.android.build.OutputFile
Expand Down Expand Up @@ -298,7 +298,7 @@ index 346fb02564..a265c80fa9 100644
versionCode 1
versionName "1.0"
- buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
-
- if (isNewArchitectureEnabled()) {
- // We configure the NDK build only if you decide to opt-in for the New Architecture.
- externalNativeBuild {
Expand Down Expand Up @@ -378,11 +378,10 @@ index 346fb02564..a265c80fa9 100644
- universalApk false // If true, also generate a universal APK
- include (*reactNativeArchitectures())
- }
+ buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString())
}
signingConfigs {
debug {
@@ -244,25 +109,11 @@ android {
@@ -244,25 +107,11 @@ android {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
Expand All @@ -409,7 +408,7 @@ index 346fb02564..a265c80fa9 100644
}

// Apply static values from `gradle.properties` to the `android.packagingOptions`
@@ -286,82 +137,35 @@ android {
@@ -286,82 +135,35 @@ android {
}

dependencies {
Expand Down Expand Up @@ -879,10 +878,10 @@ index 7deb688b07..0000000000
-}
diff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt
new file mode 100644
index 0000000000..8258c40ed4
index 0000000000..87fedbbfde
--- /dev/null
+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt
@@ -0,0 +1,65 @@
@@ -0,0 +1,61 @@
+package com.helloworld
+
+import android.app.Application
Expand All @@ -894,7 +893,6 @@ index 0000000000..8258c40ed4
+import com.facebook.react.ReactNativeHost
+import com.facebook.react.ReactPackage
+import com.facebook.react.ReactHost
+import com.facebook.react.config.ReactFeatureFlags
+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
+import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
+import com.facebook.react.defaults.DefaultReactNativeHost
Expand Down Expand Up @@ -930,9 +928,6 @@ index 0000000000..8258c40ed4
+ override fun onCreate() {
+ super.onCreate()
+ SoLoader.init(this, false)
+ if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {
+ ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false
+ }
+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
+ // If you opted-in for the New Architecture, we load the native entry point for this app.
+ load()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2482,15 +2482,15 @@ index 9430b0f9b6..07c9fce65d 100644
+
+module.exports = config;
diff --git a/templates/expo-template-bare-minimum/package.json b/templates/expo-template-bare-minimum/package.json
index d5ca09a584..5029c75e79 100644
index d5ca09a584..442e1c5722 100644
--- a/templates/expo-template-bare-minimum/package.json
+++ b/templates/expo-template-bare-minimum/package.json
@@ -1,7 +1,7 @@
{
"name": "expo-template-bare-minimum",
"description": "This bare project template includes a minimal setup for using unimodules with React Native.",
- "version": "46.0.37",
+ "version": "50.0.26",
+ "version": "50.0.30",
"main": "index.js",
"scripts": {
"start": "expo start --dev-client",
Expand All @@ -2505,7 +2505,7 @@ index d5ca09a584..5029c75e79 100644
- "react-dom": "18.0.0",
- "react-native": "0.69.9",
- "react-native-web": "~0.18.7"
+ "expo": "~50.0.0-preview.11",
+ "expo": "~50.0.2",
+ "expo-status-bar": "~1.11.1",
+ "react": "18.2.0",
+ "react-native": "0.73.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ index 0e77904834..0000000000
- ],
-)
diff --git a/templates/expo-template-bare-minimum/android/app/build.gradle b/templates/expo-template-bare-minimum/android/app/build.gradle
index f0293fe400..a265c80fa9 100644
index f0293fe400..a5123eed53 100644
--- a/templates/expo-template-bare-minimum/android/app/build.gradle
+++ b/templates/expo-template-bare-minimum/android/app/build.gradle
@@ -1,235 +1,97 @@
@@ -1,235 +1,95 @@
apply plugin: "com.android.application"
-
-import com.android.build.OutputFile
Expand Down Expand Up @@ -300,7 +300,7 @@ index f0293fe400..a265c80fa9 100644
versionCode 1
versionName "1.0"
- buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
-
- if (isNewArchitectureEnabled()) {
- // We configure the NDK build only if you decide to opt-in for the New Architecture.
- externalNativeBuild {
Expand Down Expand Up @@ -381,11 +381,10 @@ index f0293fe400..a265c80fa9 100644
- universalApk false // If true, also generate a universal APK
- include (*reactNativeArchitectures())
- }
+ buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString())
}
signingConfigs {
debug {
@@ -247,25 +109,11 @@ android {
@@ -247,25 +107,11 @@ android {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
Expand All @@ -412,7 +411,7 @@ index f0293fe400..a265c80fa9 100644
}

// Apply static values from `gradle.properties` to the `android.packagingOptions`
@@ -289,88 +137,35 @@ android {
@@ -289,88 +135,35 @@ android {
}

dependencies {
Expand Down Expand Up @@ -914,10 +913,10 @@ index 7deb688b07..0000000000
-}
diff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt
new file mode 100644
index 0000000000..8258c40ed4
index 0000000000..87fedbbfde
--- /dev/null
+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt
@@ -0,0 +1,65 @@
@@ -0,0 +1,61 @@
+package com.helloworld
+
+import android.app.Application
Expand All @@ -929,7 +928,6 @@ index 0000000000..8258c40ed4
+import com.facebook.react.ReactNativeHost
+import com.facebook.react.ReactPackage
+import com.facebook.react.ReactHost
+import com.facebook.react.config.ReactFeatureFlags
+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
+import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
+import com.facebook.react.defaults.DefaultReactNativeHost
Expand Down Expand Up @@ -965,9 +963,6 @@ index 0000000000..8258c40ed4
+ override fun onCreate() {
+ super.onCreate()
+ SoLoader.init(this, false)
+ if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {
+ ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false
+ }
+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
+ // If you opted-in for the New Architecture, we load the native entry point for this app.
+ load()
Expand Down

0 comments on commit e19a15d

Please sign in to comment.