Skip to content

Commit 71bffde

Browse files
committed
Upgrade to React Native 0.83.2 with new architecture
Reconcile the WIP react-native 0.83 / new-architecture work (originally on the william/rn83 branch) onto current npm-based develop. Bump react 19.2.0, react-native 0.83.2, react-native-reanimated 4.2.x, react-native-worklets 0.7.x, react-native-bootsplash 7.x and expo 55; keep develop's newer crypto native deps (piratechain, zcash, zano). Port the native iOS (Expo new-arch AppDelegate, Info.plist) and Android (newArchEnabled, gradle, MainActivity/ MainApplication) changes, drop the obsolete r3-hack Reanimated-3 Android workaround in favor of Reanimated 4 under the new architecture, and remove the no-longer-needed react-native 0.79 patch.
1 parent e30a7f6 commit 71bffde

51 files changed

Lines changed: 7689 additions & 3936 deletions

Some content is hidden

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

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased (develop)
44

5+
- changed: Upgrade to React Native 0.83.2 and enable the new architecture (Fabric/TurboModules)
6+
57
## 4.49.0 (staging)
68

79
- added: Monero wallet import support

android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
android:roundIcon="@mipmap/ic_launcher_round"
3737
android:allowBackup="false"
3838
android:usesCleartextTraffic="true"
39-
android:theme="@style/AppTheme">
39+
android:theme="@style/AppTheme"
40+
android:supportsRtl="true">
4041
<meta-data android:name="io.sentry.auto-init" android:value="false" />
4142
<meta-data android:name="com.google.firebase.messaging.default_notification_icon"
4243
android:resource="@mipmap/edge_logo_hollow" />

android/app/src/main/java/co/edgesecure/app/MainApplication.kt

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,10 @@ import android.content.res.Configuration
55
import com.facebook.react.PackageList
66
import com.facebook.react.ReactApplication
77
import com.facebook.react.ReactHost
8-
import com.facebook.react.ReactNativeHost
9-
import com.facebook.react.ReactPackage
10-
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
11-
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
12-
import com.facebook.react.defaults.DefaultReactNativeHost
8+
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
139
import com.facebook.react.modules.i18nmanager.I18nUtil
14-
import com.facebook.react.soloader.OpenSourceMergedSoMapping
15-
import com.facebook.soloader.SoLoader
16-
import expo.modules.ApplicationLifecycleDispatcher.onApplicationCreate
17-
import expo.modules.ApplicationLifecycleDispatcher.onConfigurationChanged
18-
import expo.modules.ReactNativeHostWrapper
10+
import expo.modules.ApplicationLifecycleDispatcher
11+
import expo.modules.ExpoReactHostFactory
1912
import io.sentry.Hint
2013
import io.sentry.SentryEvent
2114
import io.sentry.SentryLevel
@@ -26,28 +19,20 @@ import io.sentry.android.core.SentryAndroid
2619
class MainApplication :
2720
Application(),
2821
ReactApplication {
29-
override val reactNativeHost: ReactNativeHost =
30-
ReactNativeHostWrapper(
31-
this,
32-
object : DefaultReactNativeHost(this) {
33-
override fun getPackages(): List<ReactPackage> {
34-
// Packages that cannot be autolinked yet can be added manually here, for
35-
// example:
36-
// packages.add(new MyReactNativePackage());
37-
return PackageList(this).packages
38-
}
39-
40-
override fun getJSMainModuleName(): String = "index"
41-
42-
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
43-
44-
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
45-
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
46-
},
22+
override val reactHost: ReactHost by lazy {
23+
ExpoReactHostFactory.getDefaultReactHost(
24+
context = applicationContext,
25+
packageList =
26+
PackageList(this).packages.apply {
27+
// Packages that cannot be autolinked yet can be added manually here, for example:
28+
// add(MyReactNativePackage())
29+
},
30+
// The app's JS entry is `index.ts`; match the iOS bundle root so Metro
31+
// resolves `index` instead of the default `index.android` (which the new
32+
// ExpoReactHostFactory derives from jsBundleAssetPath and does not exist).
33+
jsMainModulePath = "index",
4734
)
48-
49-
override val reactHost: ReactHost
50-
get() = getDefaultReactHost(applicationContext, reactNativeHost)
35+
}
5136

5237
override fun onCreate() {
5338
super.onCreate()
@@ -102,17 +87,18 @@ class MainApplication :
10287
// Background task:
10388
MessagesWorker.ensureScheduled(context)
10489
// MessagesWorker.testRun(context);
105-
SoLoader.init(this, OpenSourceMergedSoMapping)
106-
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
107-
// If you opted-in for the New Architecture, we load the native entry point for this
108-
// app.
109-
load()
110-
}
111-
onApplicationCreate(this)
90+
91+
// React Native template code:
92+
loadReactNative(this)
93+
94+
// Expo integration:
95+
ApplicationLifecycleDispatcher.onApplicationCreate(this)
11296
}
11397

11498
override fun onConfigurationChanged(newConfig: Configuration) {
11599
super.onConfigurationChanged(newConfig)
116-
onConfigurationChanged(this, newConfig)
100+
101+
// Expo integration:
102+
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)
117103
}
118104
}

android/build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ buildscript {
22
ext {
33
buildToolsVersion = "35.0.0"
44
minSdkVersion = 28 // Edge modified from 21
5-
compileSdkVersion = 35
6-
targetSdkVersion = 35
5+
compileSdkVersion = 36
6+
targetSdkVersion = 36
77
ndkVersion = "27.1.12297006"
88
kotlinVersion = "2.3.20" // Required by zcash-android-sdk >= 2.4.8 (Kotlin 2.3 metadata)
99
}
@@ -28,4 +28,9 @@ buildscript {
2828
}
2929
}
3030

31+
// KSP no longer uses the <kotlin>-<ksp> version scheme past Kotlin 2.2.x; for Kotlin
32+
// 2.3 (required by zcash-android-sdk) use the independently-versioned KSP2 line, since
33+
// expo-root-project's Kotlin->KSP lookup table does not yet know Kotlin 2.3.
34+
ext.kspVersion = "2.3.9"
3135
apply plugin: "com.facebook.react.rootproject"
36+
apply plugin: "expo-root-project"

android/gradle.properties

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ android.useAndroidX=true
2424
# Automatically convert third-party libraries to use AndroidX
2525
android.enableJetifier=true
2626

27-
# Version of flipper SDK to use with React Native
28-
FLIPPER_VERSION=0.125.0
29-
3027
# Use this property to specify which architecture you want to build.
3128
# You can also override it from the CLI using
3229
# ./gradlew <task> -PreactNativeArchitectures=x86_64
@@ -37,10 +34,15 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a
3734
# your application. You should enable this flag either if you want
3835
# to write custom TurboModules/Fabric components OR use libraries that
3936
# are providing them.
40-
newArchEnabled=false
37+
newArchEnabled=true
4138

4239
# Use this property to enable or disable the Hermes JS engine.
4340
# If set to false, you will be using JSC instead.
4441
hermesEnabled=true
4542

43+
# Use this property to enable edge-to-edge display support.
44+
# This allows your app to draw behind system bars for an immersive UI.
45+
# Note: Only works with ReactActivity and should not be used with custom Activity.
46+
edgeToEdgeEnabled=false
47+
4648
VisionCamera_enableCodeScanner=true
59 Bytes
Binary file not shown.

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.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

android/gradlew

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

android/gradlew.bat

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

android/settings.gradle

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
1-
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
2-
plugins { id("com.facebook.react.settings") }
3-
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
1+
// Expo integration:
2+
pluginManagement {
3+
includeBuild("../node_modules/@react-native/gradle-plugin")
4+
includeBuild("../node_modules/expo-modules-autolinking/android/expo-gradle-plugin")
5+
}
6+
plugins {
7+
id("com.facebook.react.settings")
8+
id("expo-autolinking-settings")
9+
}
10+
extensions.configure(com.facebook.react.ReactSettingsExtension) {
11+
ex -> ex.autolinkLibrariesFromCommand(expoAutolinking.rnConfigCommand)
12+
}
13+
14+
// React template code:
415
rootProject.name = 'co.edgesecure.app'
516
include ':app'
617
includeBuild('../node_modules/@react-native/gradle-plugin')
718

8-
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
9-
useExpoModules()
19+
// Expo integration:
20+
expoAutolinking.useExpoModules()
21+
expoAutolinking.useExpoVersionCatalog()
22+
includeBuild(expoAutolinking.reactNativeGradlePlugin)

0 commit comments

Comments
 (0)