Skip to content

Commit 8d3726d

Browse files
authored
chore: react-native 0.80 (#979)
## 📜 Description Update react-native to 0.80. ## 💡 Motivation and Context To be updated with latest ecosystem change we need to use latest RN version. The new RN 0.80 is needed mostly because of deep import deprecation. Also some classes were migrated to kotlin in RN, so I had to double check that the lib can be successfully compiled on with latest RN. ## 📢 Changelog <!-- High level overview of important changes --> <!-- For example: fixed status bar manipulation; added new types declarations; --> <!-- If your changes don't affect one of platform/language below - then remove this platform/language --> ### CI - clean up disk space for android e2e builds to avoid random failures; ### JS - update RN to 0.80 - update all libs to their latest versions - linked `react-native-advanced-input-mask` for fabric project; - fix styles in `FocusedInputHandlers`; - fix styles in `KeyboardAvoidingView`; ### Android - fix attaching `TextWatcher`; - always forward `<StatusBar hidden />` to new API implementation, because old one may totally mess things up; ## 🤔 How Has This Been Tested? Tested manually on Pixel 9 Pro (API 35) and iPhone 16 (iOS 18.4), both new and old architecture. ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
1 parent 692494f commit 8d3726d

File tree

42 files changed

+6712
-5123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+6712
-5123
lines changed

.github/workflows/android-e2e-test.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ jobs:
3030
cancel-in-progress: true
3131
steps:
3232
- uses: actions/checkout@v4
33+
- name: Free Disk Space (Ubuntu)
34+
uses: jlumbroso/free-disk-space@main
35+
with:
36+
# force to remove default tools
37+
tool-cache: true
38+
# preserve Android
39+
android: false
3340
- uses: actions/setup-node@v4
3441
with:
3542
node-version: 18.x

FabricExample/Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
88
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
99
gem 'xcodeproj', '< 1.26.0'
1010
gem 'concurrent-ruby', '< 1.3.4'
11+
12+
# Ruby 3.4.0 has removed some libraries from the standard library.
13+
gem 'bigdecimal'
14+
gem 'logger'
15+
gem 'benchmark'
16+
gem 'mutex_m'

FabricExample/Gemfile.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ GEM
2222
json (>= 1.5.1)
2323
atomos (0.1.3)
2424
base64 (0.2.0)
25+
benchmark (0.1.0)
2526
bigdecimal (3.1.8)
2627
claide (1.1.0)
2728
cocoapods (1.15.2)
@@ -76,6 +77,7 @@ GEM
7677
i18n (1.14.5)
7778
concurrent-ruby (~> 1.0)
7879
json (2.7.2)
80+
logger (1.4.2)
7981
minitest (5.24.1)
8082
molinillo (0.8.0)
8183
mutex_m (0.2.0)
@@ -105,8 +107,12 @@ PLATFORMS
105107

106108
DEPENDENCIES
107109
activesupport (>= 6.1.7.5, != 7.1.0)
110+
benchmark
111+
bigdecimal
108112
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
109113
concurrent-ruby (< 1.3.4)
114+
logger
115+
mutex_m
110116
xcodeproj (< 1.26.0)
111117

112118
RUBY VERSION

FabricExample/android/app/src/main/java/com/keyboardcontrollerfabricexample/MainApplication.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ import android.app.Application
44
import com.facebook.react.PackageList
55
import com.facebook.react.ReactApplication
66
import com.facebook.react.ReactHost
7+
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
78
import com.facebook.react.ReactNativeHost
89
import com.facebook.react.ReactPackage
9-
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
1010
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1111
import com.facebook.react.defaults.DefaultReactNativeHost
12-
import com.facebook.react.soloader.OpenSourceMergedSoMapping
13-
import com.facebook.soloader.SoLoader
1412

1513
class MainApplication : Application(), ReactApplication {
1614
override val reactNativeHost: ReactNativeHost =
@@ -34,11 +32,7 @@ class MainApplication : Application(), ReactApplication {
3432

3533
override fun onCreate() {
3634
super.onCreate()
37-
SoLoader.init(this, OpenSourceMergedSoMapping)
38-
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
39-
// If you opted-in for the New Architecture, we load the native entry point for this app.
40-
load()
41-
}
35+
loadReactNative(this)
4236
}
4337
}
4438

FabricExample/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
compileSdkVersion = 35
66
targetSdkVersion = 35
77
ndkVersion = "27.1.12297006"
8-
kotlinVersion = "2.0.21"
8+
kotlinVersion = "2.1.20"
99
}
1010
repositories {
1111
google()
181 Bytes
Binary file not shown.

FabricExample/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

FabricExample/android/gradlew

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ case "$( uname )" in #(
114114
NONSTOP* ) nonstop=true ;;
115115
esac
116116

117-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117+
CLASSPATH="\\\"\\\""
118118

119119

120120
# Determine the Java command to use to start the JVM.
@@ -205,15 +205,15 @@ fi
205205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206206

207207
# Collect all arguments for the java command:
208-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209209
# and any embedded shellness will be escaped.
210210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211211
# treated as '${Hostname}' itself on the command line.
212212

213213
set -- \
214214
"-Dorg.gradle.appname=$APP_BASE_NAME" \
215215
-classpath "$CLASSPATH" \
216-
org.gradle.wrapper.GradleWrapperMain \
216+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217217
"$@"
218218

219219
# Stop when "xargs" is not available.

FabricExample/android/gradlew.bat

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
@REM Copyright (c) Meta Platforms, Inc. and affiliates.
2+
@REM
3+
@REM This source code is licensed under the MIT license found in the
4+
@REM LICENSE file in the root directory of this source tree.
5+
16
@rem
27
@rem Copyright 2015 the original author or authors.
38
@rem
@@ -70,11 +75,11 @@ goto fail
7075
:execute
7176
@rem Setup the command line
7277

73-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
78+
set CLASSPATH=
7479

7580

7681
@rem Execute Gradle
77-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
82+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7883

7984
:end
8085
@rem End local scope for the variables with windows NT shell

FabricExample/ios/AppDelegate.swift

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,45 @@ import ReactAppDependencyProvider
1111
import UIKit
1212

1313
@main
14-
class AppDelegate: RCTAppDelegate {
15-
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
16-
moduleName = "KeyboardControllerFabricExample"
17-
dependencyProvider = RCTAppDependencyProvider()
18-
19-
// You can add your custom initial props in the dictionary below.
20-
// They will be passed down to the ViewController used by React Native.
21-
initialProps = [:]
22-
23-
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
24-
}
25-
26-
override func sourceURL(for _: RCTBridge) -> URL? {
27-
bundleURL()
28-
}
14+
class AppDelegate: UIResponder, UIApplicationDelegate {
15+
var window: UIWindow?
16+
17+
var reactNativeDelegate: ReactNativeDelegate?
18+
var reactNativeFactory: RCTReactNativeFactory?
19+
20+
func application(
21+
_ application: UIApplication,
22+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
23+
) -> Bool {
24+
let delegate = ReactNativeDelegate()
25+
let factory = RCTReactNativeFactory(delegate: delegate)
26+
delegate.dependencyProvider = RCTAppDependencyProvider()
27+
28+
reactNativeDelegate = delegate
29+
reactNativeFactory = factory
30+
31+
window = UIWindow(frame: UIScreen.main.bounds)
32+
33+
factory.startReactNative(
34+
withModuleName: "KeyboardControllerFabricExample",
35+
in: window,
36+
launchOptions: launchOptions
37+
)
38+
39+
return true
40+
}
41+
}
42+
43+
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
44+
override func sourceURL(for bridge: RCTBridge) -> URL? {
45+
self.bundleURL()
46+
}
2947

30-
override func bundleURL() -> URL? {
31-
#if DEBUG
32-
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
33-
#else
34-
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
35-
#endif
36-
}
48+
override func bundleURL() -> URL? {
49+
#if DEBUG
50+
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
51+
#else
52+
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
53+
#endif
54+
}
3755
}

0 commit comments

Comments
 (0)