Skip to content

Commit 75f81d9

Browse files
Teodor Ciuraruclaude
andcommitted
feat: upgrade react-native-expo to Expo SDK 54
Upgrades Expo SDK from 53 to 54 and regenerates native folders. ## Changes - Upgrade Expo SDK: ~53 → ~54.0.25 - Upgrade React: 19.0.0 → 19.1.0 - Upgrade React Native: 0.79.5 → 0.81.5 - Update all Expo packages to SDK 54 versions - Add SafeAreaProvider from react-native-safe-area-context - Add react-native-worklets (peer dependency for reanimated) - Add Expo 54 Android config (edgeToEdgeEnabled, predictiveBackGestureEnabled) - Enable reactCompiler experiment - Add dark mode splash screen config - Regenerate ios/ and android/ folders via expo prebuild ## Files Changed - package.json: Dependency upgrades - app.json: Expo 54 config additions - App.tsx: SafeAreaProvider wrapper - .gitignore: Updated to match template - yarn.lock: Updated lockfile - ios/: Regenerated with Expo SDK 54 - android/: Regenerated with Expo SDK 54 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent c1f1086 commit 75f81d9

File tree

22 files changed

+2761
-2199
lines changed

22 files changed

+2761
-2199
lines changed

react-native-expo/.gitignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ node_modules/
88
dist/
99
web-build/
1010
expo-env.d.ts
11-
android
12-
ios/Pods/
13-
ios/build/
14-
ios/.xcode.env.local
15-
ios/DerivedData/
11+
12+
# generated native folders
13+
/ios
14+
/android
1615

1716
# Native
1817
*.orig.*

react-native-expo/App.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import {
55
PermissionsAndroid,
66
Platform,
77
View,
8-
SafeAreaView,
98
FlatList,
109
Button,
1110
} from "react-native";
11+
import {SafeAreaProvider, SafeAreaView} from 'react-native-safe-area-context';
1212
import {
1313
Authenticator,
1414
Ditto,
@@ -168,6 +168,8 @@ const App = () => {
168168

169169
ditto.current.sync.start();
170170

171+
await ditto.current.store.execute('ALTER SYSTEM SET DQL_STRICT_MODE = false');
172+
171173
taskSubscription.current = ditto.current.sync.registerSubscription('SELECT * FROM tasks');
172174

173175
taskObserver.current = ditto.current.store.registerObserver('SELECT * FROM tasks WHERE NOT deleted ORDER BY title ASC', response => {
@@ -189,7 +191,7 @@ const App = () => {
189191
(async () => {
190192
const granted =
191193
Platform.OS === "android" ? await requestPermissions() : true;
192-
194+
193195
setHasPermissions(granted);
194196
initDitto();
195197
})();
@@ -212,7 +214,8 @@ const App = () => {
212214
);
213215

214216
return (
215-
<SafeAreaView style={styles.container}>
217+
<SafeAreaProvider>
218+
<SafeAreaView style={styles.container}>
216219
{!hasPermissions && (
217220
<View style={styles.permissionBanner}>
218221
<Text style={styles.permissionText}>
@@ -247,7 +250,8 @@ const App = () => {
247250
renderItem={renderItem}
248251
keyExtractor={(item) => item.id}
249252
/>
250-
</SafeAreaView>
253+
</SafeAreaView>
254+
</SafeAreaProvider>
251255
);
252256
};
253257

react-native-expo/android/app/build.gradle

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ react {
6464
}
6565

6666
/**
67-
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
67+
* Set this to true in release builds to optimize the app using [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization).
6868
*/
69-
def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInReleaseBuilds') ?: false).toBoolean()
69+
def enableMinifyInReleaseBuilds = (findProperty('android.enableMinifyInReleaseBuilds') ?: false).toBoolean()
7070

7171
/**
7272
* The preferred build flavor of JavaScriptCore (JSC)
@@ -94,6 +94,8 @@ android {
9494
targetSdkVersion rootProject.ext.targetSdkVersion
9595
versionCode 1
9696
versionName "1.0.0"
97+
98+
buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""
9799
}
98100
signingConfigs {
99101
debug {
@@ -111,15 +113,18 @@ android {
111113
// Caution! In production, you need to generate your own keystore file.
112114
// see https://reactnative.dev/docs/signed-apk-android.
113115
signingConfig signingConfigs.debug
114-
shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)
115-
minifyEnabled enableProguardInReleaseBuilds
116+
def enableShrinkResources = findProperty('android.enableShrinkResourcesInReleaseBuilds') ?: 'false'
117+
shrinkResources enableShrinkResources.toBoolean()
118+
minifyEnabled enableMinifyInReleaseBuilds
116119
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
117-
crunchPngs (findProperty('android.enablePngCrunchInReleaseBuilds')?.toBoolean() ?: true)
120+
def enablePngCrunchInRelease = findProperty('android.enablePngCrunchInReleaseBuilds') ?: 'true'
121+
crunchPngs enablePngCrunchInRelease.toBoolean()
118122
}
119123
}
120124
packagingOptions {
121125
jniLibs {
122-
useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
126+
def enableLegacyPackaging = findProperty('expo.useLegacyPackaging') ?: 'false'
127+
useLegacyPackaging enableLegacyPackaging.toBoolean()
123128
}
124129
}
125130
androidResources {

react-native-expo/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<data android:scheme="https"/>
2525
</intent>
2626
</queries>
27-
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme" android:supportsRtl="true">
27+
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme" android:supportsRtl="true" android:enableOnBackInvokedCallback="false">
2828
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
2929
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
3030
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>

react-native-expo/android/app/src/main/java/com/anonymous/reactnativeexpo/MainApplication.kt

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,33 @@ import android.content.res.Configuration
55

66
import com.facebook.react.PackageList
77
import com.facebook.react.ReactApplication
8+
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
89
import com.facebook.react.ReactNativeHost
910
import com.facebook.react.ReactPackage
1011
import com.facebook.react.ReactHost
11-
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
12+
import com.facebook.react.common.ReleaseLevel
13+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint
1214
import com.facebook.react.defaults.DefaultReactNativeHost
13-
import com.facebook.react.soloader.OpenSourceMergedSoMapping
14-
import com.facebook.soloader.SoLoader
1515

1616
import expo.modules.ApplicationLifecycleDispatcher
1717
import expo.modules.ReactNativeHostWrapper
1818

1919
class MainApplication : Application(), ReactApplication {
2020

2121
override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(
22-
this,
23-
object : DefaultReactNativeHost(this) {
24-
override fun getPackages(): List<ReactPackage> {
25-
val packages = PackageList(this).packages
26-
// Packages that cannot be autolinked yet can be added manually here, for example:
27-
// packages.add(MyReactNativePackage())
28-
return packages
29-
}
22+
this,
23+
object : DefaultReactNativeHost(this) {
24+
override fun getPackages(): List<ReactPackage> =
25+
PackageList(this).packages.apply {
26+
// Packages that cannot be autolinked yet can be added manually here, for example:
27+
// add(MyReactNativePackage())
28+
}
3029

3130
override fun getJSMainModuleName(): String = ".expo/.virtual-metro-entry"
3231

3332
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
3433

3534
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
36-
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
3735
}
3836
)
3937

@@ -42,11 +40,12 @@ class MainApplication : Application(), ReactApplication {
4240

4341
override fun onCreate() {
4442
super.onCreate()
45-
SoLoader.init(this, OpenSourceMergedSoMapping)
46-
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
47-
// If you opted-in for the New Architecture, we load the native entry point for this app.
48-
load()
43+
DefaultNewArchitectureEntryPoint.releaseLevel = try {
44+
ReleaseLevel.valueOf(BuildConfig.REACT_NATIVE_RELEASE_LEVEL.uppercase())
45+
} catch (e: IllegalArgumentException) {
46+
ReleaseLevel.STABLE
4947
}
48+
loadReactNative(this)
5049
ApplicationLifecycleDispatcher.onApplicationCreate(this)
5150
}
5251

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
<resources/>
1+
<resources>
2+
<color name="splashscreen_background">#000000</color>
3+
</resources>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<resources xmlns:tools="http://schemas.android.com/tools">
22
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
3+
<item name="android:enforceNavigationBarContrast" tools:targetApi="29">true</item>
34
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
4-
<item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
55
<item name="colorPrimary">@color/colorPrimary</item>
66
<item name="android:statusBarColor">#ffffff</item>
77
</style>
88
<style name="Theme.App.SplashScreen" parent="Theme.SplashScreen">
99
<item name="windowSplashScreenBackground">@color/splashscreen_background</item>
1010
<item name="windowSplashScreenAnimatedIcon">@drawable/splashscreen_logo</item>
1111
<item name="postSplashScreenTheme">@style/AppTheme</item>
12+
<item name="android:windowSplashScreenBehavior">icon_preferred</item>
1213
</style>
1314
</resources>

react-native-expo/android/build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,8 @@ buildscript {
1212
}
1313
}
1414

15-
def reactNativeAndroidDir = new File(
16-
providers.exec {
17-
workingDir(rootDir)
18-
commandLine("node", "--print", "require.resolve('react-native/package.json')")
19-
}.standardOutput.asText.get().trim(),
20-
"../android"
21-
)
22-
2315
allprojects {
2416
repositories {
25-
maven {
26-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
27-
url(reactNativeAndroidDir)
28-
}
29-
3017
google()
3118
mavenCentral()
3219
maven { url 'https://www.jitpack.io' }

react-native-expo/android/gradle.properties

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
1515
# When configured, Gradle will run in incubating parallel mode.
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18-
# org.gradle.parallel=true
18+
org.gradle.parallel=true
1919

2020
# AndroidX package structure to make it clearer which packages are bundled with the
2121
# Android operating system, and which are packaged with your app's APK
@@ -41,6 +41,11 @@ newArchEnabled=true
4141
# If set to false, you will be using JSC instead.
4242
hermesEnabled=true
4343

44+
# Use this property to enable edge-to-edge display support.
45+
# This allows your app to draw behind system bars for an immersive UI.
46+
# Note: Only works with ReactActivity and should not be used with custom Activity.
47+
edgeToEdgeEnabled=true
48+
4449
# Enable GIF support in React Native images (~200 B increase)
4550
expo.gif.enabled=true
4651
# Enable webp support in React Native images (~85 KB increase)
@@ -55,7 +60,9 @@ EX_DEV_CLIENT_NETWORK_INSPECTOR=true
5560
# Use legacy packaging to compress native libraries in the resulting APK.
5661
expo.useLegacyPackaging=false
5762

58-
# Whether the app is configured to use edge-to-edge via the app config or `react-native-edge-to-edge` plugin
59-
expo.edgeToEdgeEnabled=false
63+
# Specifies whether the app is configured to use edge-to-edge via the app config or plugin
64+
# WARNING: This property has been deprecated and will be removed in Expo SDK 55. Use `edgeToEdgeEnabled` or `react.edgeToEdgeEnabled` to determine whether the project is using edge-to-edge.
65+
expo.edgeToEdgeEnabled=true
66+
6067
android.packagingOptions.pickFirsts=lib/x86/libjsi.so,lib/x86/libdittoffi.so,lib/x86/libreact_nativemodule_core.so,lib/x86/libturbomodulejsijni.so,lib/x86/libreactnative.so,lib/x86_64/libjsi.so,lib/x86_64/libdittoffi.so,lib/x86_64/libreact_nativemodule_core.so,lib/x86_64/libturbomodulejsijni.so,lib/x86_64/libreactnative.so,lib/armeabi-v7a/libjsi.so,lib/armeabi-v7a/libdittoffi.so,lib/armeabi-v7a/libreact_nativemodule_core.so,lib/armeabi-v7a/libturbomodulejsijni.so,lib/armeabi-v7a/libreactnative.so,lib/arm64-v8a/libjsi.so,lib/arm64-v8a/libdittoffi.so,lib/arm64-v8a/libreact_nativemodule_core.so,lib/arm64-v8a/libturbomodulejsijni.so,lib/arm64-v8a/libreactnative.so
6168
android.extraMavenRepos=[]
181 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)