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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 5 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 13 additions & 13 deletions
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

Lines changed: 1 addition & 3 deletions
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

Lines changed: 5 additions & 1 deletion
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

Lines changed: 5 additions & 13 deletions
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.

0 commit comments

Comments
 (0)