Skip to content

Commit 14ddb2b

Browse files
kamilkedzierskiV3RONBogiKay
authored
feat: bumped React Native and Expo version (#4477)
* chore: bumping version of expo, react-native, android sdk * fix: fixed issues with build * chore: fixed most issues with tests + upgraded react-native-vector-icons * chore: changed wrong version of exposdk in AndroidManifest * fix: fixed issue with icons not showing up on web * fix: flaky TextInput test * fix: library assets not loading * fix: fixed yarn.lock issue * fix: fixed formatting * fix: fixed ts issues * chore: added missing flag * fix: handle RTL when example app running in Expo Go --------- Co-authored-by: Szymon Chmal <[email protected]> Co-authored-by: Bogusz Kaszowski <[email protected]>
1 parent 9162a1f commit 14ddb2b

Some content is hidden

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

47 files changed

+3449
-4230
lines changed

Diff for: babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ['module:metro-react-native-babel-preset'],
2+
presets: ['module:@react-native/babel-preset'],
33
};

Diff for: example/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# XDE
22
#
33
.expo/
4+
/coverage

Diff for: example/android/app/build.gradle

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: "com.android.application"
2+
apply plugin: "org.jetbrains.kotlin.android"
23
apply plugin: "com.facebook.react"
34

45
import com.android.build.OutputFile
@@ -111,6 +112,7 @@ def reactNativeArchitectures() {
111112
android {
112113
ndkVersion rootProject.ext.ndkVersion
113114

115+
buildToolsVersion rootProject.ext.buildToolsVersion
114116
compileSdkVersion rootProject.ext.compileSdkVersion
115117

116118
namespace 'com.callstack.reactnativepaperexample'
@@ -219,12 +221,9 @@ dependencies {
219221
}
220222

221223
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
222-
223-
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
224-
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
225-
exclude group:'com.squareup.okhttp3', module:'okhttp'
226-
}
227-
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
224+
225+
implementation("com.facebook.react:flipper-integration")
226+
228227

229228
if (hermesEnabled.toBoolean()) {
230229
implementation("com.facebook.react:hermes-android")

Diff for: example/android/app/src/debug/java/com/callstack/reactnativepaperexample/ReactNativeFlipper.java

-75
This file was deleted.

Diff for: example/android/app/src/main/AndroidManifest.xml

+26-5
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,56 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.callstack.reactnativepaperexample">
22
<uses-permission android:name="android.permission.INTERNET"/>
33
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
4-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
54
<uses-permission android:name="android.permission.VIBRATE"/>
65
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
6+
77
<queries>
88
<intent>
99
<action android:name="android.intent.action.VIEW"/>
1010
<category android:name="android.intent.category.BROWSABLE"/>
1111
<data android:scheme="https"/>
1212
</intent>
1313
</queries>
14-
<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:usesCleartextTraffic="true">
14+
15+
<application
16+
android:name=".MainApplication"
17+
android:label="@string/app_name"
18+
android:icon="@mipmap/ic_launcher"
19+
android:roundIcon="@mipmap/ic_launcher_round"
20+
android:allowBackup="true"
21+
android:theme="@style/AppTheme"
22+
android:usesCleartextTraffic="true"
23+
>
24+
1525
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
16-
<meta-data android:name="expo.modules.updates.EXPO_RUNTIME_VERSION" android:value="exposdk:48.0.0"/>
26+
<meta-data android:name="expo.modules.updates.EXPO_RUNTIME_VERSION" android:value="exposdk:50.0.19"/>
1727
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
1828
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
1929
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://u.expo.dev/ba8f5139-58fe-48f0-b2f2-2d675b6eb2d4"/>
20-
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:exported="true" android:screenOrientation="unspecified">
30+
31+
<activity
32+
android:name=".MainActivity"
33+
android:label="@string/app_name"
34+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
35+
android:launchMode="singleTask"
36+
android:windowSoftInputMode="adjustResize"
37+
android:theme="@style/Theme.App.SplashScreen"
38+
android:exported="true"
39+
android:screenOrientation="unspecified">
40+
2141
<intent-filter>
2242
<action android:name="android.intent.action.MAIN"/>
2343
<category android:name="android.intent.category.LAUNCHER"/>
2444
</intent-filter>
45+
2546
<intent-filter>
2647
<action android:name="android.intent.action.VIEW"/>
2748
<category android:name="android.intent.category.DEFAULT"/>
2849
<category android:name="android.intent.category.BROWSABLE"/>
2950
<data android:scheme="com.callstack.reactnativepaperexample"/>
3051
<data android:scheme="exp+react-native-paper-example"/>
3152
</intent-filter>
53+
3254
</activity>
33-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>
3455
</application>
3556
</manifest>

Diff for: example/android/app/src/main/java/com/callstack/reactnativepaperexample/MainActivity.java

+22-24
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,26 @@
1111
import expo.modules.ReactActivityDelegateWrapper;
1212

1313
public class MainActivity extends ReactActivity {
14+
/**
15+
* Align the back button behavior with Android S
16+
* where moving root activities to background instead of finishing activities.
17+
* @see <a href="https://developer.android.com/reference/android/app/Activity#onBackPressed()">onBackPressed</a>
18+
*/
19+
@Override
20+
public void invokeDefaultOnBackPressed() {
21+
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {
22+
if (!moveTaskToBack(false)) {
23+
// For non-root activities, use the default implementation to finish them.
24+
super.invokeDefaultOnBackPressed();
25+
}
26+
return;
27+
}
28+
29+
// Use the default back button implementation on Android S
30+
// because it's doing more than {@link Activity#moveTaskToBack} in fact.
31+
super.invokeDefaultOnBackPressed();
32+
}
33+
1434
@Override
1535
protected void onCreate(Bundle savedInstanceState) {
1636
// Set the theme to AppTheme BEFORE onCreate to support
@@ -40,29 +60,7 @@ protected ReactActivityDelegate createReactActivityDelegate() {
4060
this,
4161
getMainComponentName(),
4262
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
43-
DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled
44-
// If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
45-
DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled
46-
));
47-
}
48-
49-
/**
50-
* Align the back button behavior with Android S
51-
* where moving root activities to background instead of finishing activities.
52-
* @see <a href="https://developer.android.com/reference/android/app/Activity#onBackPressed()">onBackPressed</a>
53-
*/
54-
@Override
55-
public void invokeDefaultOnBackPressed() {
56-
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {
57-
if (!moveTaskToBack(false)) {
58-
// For non-root activities, use the default implementation to finish them.
59-
super.invokeDefaultOnBackPressed();
60-
}
61-
return;
62-
}
63-
64-
// Use the default back button implementation on Android S
65-
// because it's doing more than {@link Activity#moveTaskToBack} in fact.
66-
super.invokeDefaultOnBackPressed();
63+
DefaultNewArchitectureEntryPoint.getFabricEnabled()
64+
));
6765
}
6866
}

Diff for: example/android/app/src/main/java/com/callstack/reactnativepaperexample/MainApplication.java

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.facebook.react.ReactPackage;
1111
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
1212
import com.facebook.react.defaults.DefaultReactNativeHost;
13+
import com.facebook.react.flipper.ReactNativeFlipper;
1314
import com.facebook.soloader.SoLoader;
1415

1516
import expo.modules.ApplicationLifecycleDispatcher;

Diff for: example/android/app/src/main/res/values/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
<string name="app_name">React Native Paper Example</string>
33
<string name="expo_splash_screen_resize_mode" translatable="false">cover</string>
44
<string name="expo_splash_screen_status_bar_translucent" translatable="false">false</string>
5-
<string name="expo_runtime_version">exposdk:48.0.0</string>
5+
<string name="expo_runtime_version">exposdk:50.0.19</string>
66
</resources>

Diff for: example/android/app/src/release/java/com/callstack/reactnativepaperexample/ReactNativeFlipper.java

-20
This file was deleted.

Diff for: example/android/build.gradle

+12-9
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,28 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '33.0.0'
5+
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0'
66
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '21')
7-
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '33')
8-
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '33')
9-
if (findProperty('android.kotlinVersion')) {
10-
kotlinVersion = findProperty('android.kotlinVersion')
11-
}
7+
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')
8+
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
9+
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.8.0'
10+
1211
frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'
1312

14-
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
15-
ndkVersion = "23.1.7779620"
13+
// We use NDK 25 which has both M1 support and is the side-by-side NDK version from AGP.
14+
ndkVersion = "25.1.8937393"
1615
}
1716
repositories {
1817
google()
1918
mavenCentral()
2019
}
2120
dependencies {
22-
classpath('com.android.tools.build:gradle:7.4.1')
21+
classpath('com.android.tools.build:gradle')
2322
classpath('com.facebook.react:react-native-gradle-plugin')
23+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
2424
}
2525
}
26+
apply plugin: "com.facebook.react.rootproject"
2627

2728
allprojects {
2829
repositories {
@@ -40,3 +41,5 @@ allprojects {
4041
maven { url 'https://www.jitpack.io' }
4142
}
4243
}
44+
45+

Diff for: example/android/gradle.properties

-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ android.useAndroidX=true
2525
# Automatically convert third-party libraries to use AndroidX
2626
android.enableJetifier=true
2727

28-
# Version of flipper SDK to use with React Native
29-
FLIPPER_VERSION=0.125.0
30-
3128
# Use this property to specify which architecture you want to build.
3229
# You can also override it from the CLI using
3330
# ./gradlew <task> -PreactNativeArchitectures=x86_64
+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)