Skip to content

Commit 1760b07

Browse files
committed
- Update test app to Expo 52 and RN 0.76
- Fix compatibility issues - Remove Flipper
1 parent 64a8190 commit 1760b07

Some content is hidden

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

63 files changed

+3353
-3737
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@
5050
"devDependencies": {
5151
"@changesets/cli": "^2.26.2",
5252
"prettier": "^3.3.3",
53-
"react": "18.2.0",
54-
"react-native": "0.74.5",
53+
"react": "18.3.1",
54+
"react-native": "0.76.2",
5555
"react-native-builder-bob": "^0.30.1",
56-
"typescript": "^4.8.4"
56+
"typescript": "^5.3.3"
5757
},
5858
"peerDependencies": {
5959
"react": "*",

tests/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ yarn-error.*
3333

3434
# typescript
3535
*.tsbuildinfo
36+
37+
# Expo
38+
.expo
39+
dist/
40+
web-build/

tests/android/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ build/
1010
local.properties
1111
*.iml
1212
*.hprof
13+
.cxx/
1314

1415
# Bundle artifacts
1516
*.jsbundle

tests/android/app/build.gradle

+13-13
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ react {
2020
bundleCommand = "export:embed"
2121

2222
/* Folders */
23-
// The root of your project, i.e. where "package.json" lives. Default is '..'
24-
// root = file("../")
25-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
26-
// reactNativeDir = file("../node_modules/react-native")
27-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
28-
// codegenDir = file("../node_modules/@react-native/codegen")
23+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
24+
// root = file("../../")
25+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
26+
// reactNativeDir = file("../../node_modules/react-native")
27+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
28+
// codegenDir = file("../../node_modules/@react-native/codegen")
2929

3030
/* Variants */
3131
// The list of variants to that are debuggable. For those we're going to
@@ -57,6 +57,9 @@ react {
5757
//
5858
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
5959
// hermesFlags = ["-O", "-output-source-map"]
60+
61+
/* Autolinking */
62+
autolinkLibrariesWithApp()
6063
}
6164

6265
/**
@@ -90,8 +93,6 @@ android {
9093
targetSdkVersion rootProject.ext.targetSdkVersion
9194
versionCode 1
9295
versionName "1.0.0"
93-
94-
buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString())
9596
}
9697
signingConfigs {
9798
debug {
@@ -112,13 +113,17 @@ android {
112113
shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)
113114
minifyEnabled enableProguardInReleaseBuilds
114115
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
116+
crunchPngs (findProperty('android.enablePngCrunchInReleaseBuilds')?.toBoolean() ?: true)
115117
}
116118
}
117119
packagingOptions {
118120
jniLibs {
119121
useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
120122
}
121123
}
124+
androidResources {
125+
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~'
126+
}
122127
}
123128

124129
// Apply static values from `gradle.properties` to the `android.packagingOptions`
@@ -163,14 +168,9 @@ dependencies {
163168
}
164169
}
165170

166-
implementation("com.facebook.react:flipper-integration")
167-
168171
if (hermesEnabled.toBoolean()) {
169172
implementation("com.facebook.react:hermes-android")
170173
} else {
171174
implementation jscFlavor
172175
}
173176
}
174-
175-
apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
176-
applyNativeModulesAppBuildGradle(project)

tests/android/app/src/main/AndroidManifest.xml

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
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">
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:supportsRtl="true">
1515
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
16-
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="50.0.0"/>
1716
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
1817
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
1918
<activity android:name=".MainActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:exported="true" android:screenOrientation="portrait">
@@ -28,6 +27,5 @@
2827
<data android:scheme="com.reactnativequicksqlite.tests"/>
2928
</intent-filter>
3029
</activity>
31-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>
3230
</application>
3331
</manifest>

tests/android/app/src/main/java/com/reactnativequicksqlite/tests/MainActivity.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package com.reactnativequicksqlite.tests
2+
import expo.modules.splashscreen.SplashScreenManager
23

34
import android.os.Build
45
import android.os.Bundle
@@ -15,7 +16,10 @@ class MainActivity : ReactActivity() {
1516
// Set the theme to AppTheme BEFORE onCreate to support
1617
// coloring the background, status bar, and navigation bar.
1718
// This is required for expo-splash-screen.
18-
setTheme(R.style.AppTheme);
19+
// setTheme(R.style.AppTheme);
20+
// @generated begin expo-splashscreen - expo prebuild (DO NOT MODIFY) sync-f3ff59a738c56c9a6119210cb55f0b613eb8b6af
21+
SplashScreenManager.registerOnActivity(this)
22+
// @generated end expo-splashscreen
1923
super.onCreate(null)
2024
}
2125

tests/android/app/src/main/java/com/reactnativequicksqlite/tests/MainApplication.kt

+5-13
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@ package com.reactnativequicksqlite.tests
22

33
import android.app.Application
44
import android.content.res.Configuration
5-
import androidx.annotation.NonNull
65

76
import com.facebook.react.PackageList
87
import com.facebook.react.ReactApplication
98
import com.facebook.react.ReactNativeHost
109
import com.facebook.react.ReactPackage
1110
import com.facebook.react.ReactHost
12-
import com.facebook.react.config.ReactFeatureFlags
1311
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
14-
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1512
import com.facebook.react.defaults.DefaultReactNativeHost
16-
import com.facebook.react.flipper.ReactNativeFlipper
13+
import com.facebook.react.soloader.OpenSourceMergedSoMapping
1714
import com.facebook.soloader.SoLoader
1815

1916
import expo.modules.ApplicationLifecycleDispatcher
@@ -25,9 +22,10 @@ class MainApplication : Application(), ReactApplication {
2522
this,
2623
object : DefaultReactNativeHost(this) {
2724
override fun getPackages(): List<ReactPackage> {
25+
val packages = PackageList(this).packages
2826
// Packages that cannot be autolinked yet can be added manually here, for example:
2927
// packages.add(new MyReactNativePackage());
30-
return PackageList(this).packages
28+
return packages
3129
}
3230

3331
override fun getJSMainModuleName(): String = ".expo/.virtual-metro-entry"
@@ -40,21 +38,15 @@ class MainApplication : Application(), ReactApplication {
4038
)
4139

4240
override val reactHost: ReactHost
43-
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
41+
get() = ReactNativeHostWrapper.createReactHost(applicationContext, reactNativeHost)
4442

4543
override fun onCreate() {
4644
super.onCreate()
47-
SoLoader.init(this, false)
48-
if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {
49-
ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false
50-
}
45+
SoLoader.init(this, OpenSourceMergedSoMapping)
5146
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
5247
// If you opted-in for the New Architecture, we load the native entry point for this app.
5348
load()
5449
}
55-
if (BuildConfig.DEBUG) {
56-
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
57-
}
5850
ApplicationLifecycleDispatcher.onApplicationCreate(this)
5951
}
6052

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
22
<item android:drawable="@color/splashscreen_background"/>
3+
<item>
4+
<bitmap android:gravity="center" android:src="@drawable/splashscreen_logo"/>
5+
</item>
36
</layer-list>

tests/android/app/src/main/res/drawable/rn_edit_text_material.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
1818
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
1919
android:insetTop="@dimen/abc_edit_text_inset_top_material"
20-
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
20+
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"
21+
>
2122

2223
<selector>
2324
<!--
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

tests/android/app/src/main/res/values/styles.xml

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
<item name="android:editTextStyle">@style/ResetEditText</item>
55
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
66
<item name="colorPrimary">@color/colorPrimary</item>
7-
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
7+
<item name="android:statusBarColor">#ffffff</item>
88
</style>
99
<style name="ResetEditText" parent="@android:style/Widget.EditText">
1010
<item name="android:padding">0dp</item>
1111
<item name="android:textColorHint">#c8c8c8</item>
1212
<item name="android:textColor">@android:color/black</item>
1313
</style>
14-
<style name="Theme.App.SplashScreen" parent="AppTheme">
15-
<item name="android:windowBackground">@drawable/splashscreen</item>
14+
<style name="Theme.App.SplashScreen" parent="Theme.SplashScreen">
15+
<item name="windowSplashScreenBackground">@color/splashscreen_background</item>
16+
<item name="windowSplashScreenAnimatedIcon">@drawable/splashscreen_logo</item>
17+
<item name="postSplashScreenTheme">@style/AppTheme</item>
1618
</style>
1719
</resources>

tests/android/build.gradle

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0'
6-
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')
7-
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')
5+
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '35.0.0'
6+
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '24')
7+
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '35')
88
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
9-
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.8.10'
9+
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.24'
1010

11-
ndkVersion = "25.1.8937393"
11+
ndkVersion = "26.1.10909125"
1212
}
1313
repositories {
1414
google()
@@ -17,6 +17,7 @@ buildscript {
1717
dependencies {
1818
classpath('com.android.tools.build:gradle')
1919
classpath('com.facebook.react:react-native-gradle-plugin')
20+
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
2021
}
2122
}
2223

tests/android/gradle.properties

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
2222
# https://developer.android.com/topic/libraries/support-library/androidx-rn
2323
android.useAndroidX=true
2424

25-
# Automatically convert third-party libraries to use AndroidX
26-
android.enableJetifier=true
25+
# Enable AAPT2 PNG crunching
26+
android.enablePngCrunchInReleaseBuilds=true
2727

2828
# Use this property to specify which architecture you want to build.
2929
# You can also override it from the CLI using
@@ -54,3 +54,5 @@ EX_DEV_CLIENT_NETWORK_INSPECTOR=true
5454

5555
# Use legacy packaging to compress native libraries in the resulting APK.
5656
expo.useLegacyPackaging=false
57+
58+
android.extraMavenRepos=[]
-19.7 KB
Binary file not shown.

tests/android/gradle/wrapper/gradle-wrapper.properties

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

tests/android/gradlew

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

tests/android/gradlew.bat

+13-10
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################
@@ -26,6 +28,7 @@ if "%OS%"=="Windows_NT" setlocal
2628

2729
set DIRNAME=%~dp0
2830
if "%DIRNAME%"=="" set DIRNAME=.
31+
@rem This is normally unused
2932
set APP_BASE_NAME=%~n0
3033
set APP_HOME=%DIRNAME%
3134

@@ -42,11 +45,11 @@ set JAVA_EXE=java.exe
4245
%JAVA_EXE% -version >NUL 2>&1
4346
if %ERRORLEVEL% equ 0 goto execute
4447

45-
echo.
46-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47-
echo.
48-
echo Please set the JAVA_HOME variable in your environment to match the
49-
echo location of your Java installation.
48+
echo. 1>&2
49+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50+
echo. 1>&2
51+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52+
echo location of your Java installation. 1>&2
5053

5154
goto fail
5255

@@ -56,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5659

5760
if exist "%JAVA_EXE%" goto execute
5861

59-
echo.
60-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61-
echo.
62-
echo Please set the JAVA_HOME variable in your environment to match the
63-
echo location of your Java installation.
62+
echo. 1>&2
63+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64+
echo. 1>&2
65+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66+
echo location of your Java installation. 1>&2
6467

6568
goto fail
6669

0 commit comments

Comments
 (0)