Skip to content

Commit f49efc2

Browse files
authored
Merge pull request #167 from powersync-ja/expo-51
[Update] Expo 51
2 parents cbda24e + 72cfd5d commit f49efc2

File tree

27 files changed

+8126
-13237
lines changed

27 files changed

+8126
-13237
lines changed

.changeset/ninety-drinks-provide.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-native-supabase-todolist': minor
3+
---
4+
5+
Updates the React Native Supabase todolist application to Expo 51.

demos/react-native-supabase-todolist/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

demos/react-native-supabase-todolist/android/app/build.gradle

+5-4
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ android {
9090
targetSdkVersion rootProject.ext.targetSdkVersion
9191
versionCode 1
9292
versionName "1.0.0"
93-
94-
buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString())
9593
}
9694
signingConfigs {
9795
debug {
@@ -114,6 +112,11 @@ android {
114112
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
115113
}
116114
}
115+
packagingOptions {
116+
jniLibs {
117+
useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
118+
}
119+
}
117120
}
118121

119122
// Apply static values from `gradle.properties` to the `android.packagingOptions`
@@ -158,8 +161,6 @@ dependencies {
158161
}
159162
}
160163

161-
implementation("com.facebook.react:flipper-integration")
162-
163164
if (hermesEnabled.toBoolean()) {
164165
implementation("com.facebook.react:hermes-android")
165166
} else {

demos/react-native-supabase-todolist/android/app/src/main/AndroidManifest.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
</intent>
1515
</queries>
1616
<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">
17-
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
18-
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="50.0.0"/>
17+
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
1918
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
2019
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
20+
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://u.expo.dev/foo"/>
2121
<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">
2222
<intent-filter>
2323
<action android:name="android.intent.action.MAIN"/>
@@ -29,6 +29,7 @@
2929
<category android:name="android.intent.category.BROWSABLE"/>
3030
<data android:scheme="powersync"/>
3131
<data android:scheme="com.powersync.example"/>
32+
<data android:scheme="exp+powersync-example"/>
3233
</intent-filter>
3334
</activity>
3435
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>

demos/react-native-supabase-todolist/android/app/src/main/java/com/powersync/example/MainApplication.kt

+1-11
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ package com.powersync.example
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
1713
import com.facebook.soloader.SoLoader
1814

1915
import expo.modules.ApplicationLifecycleDispatcher
@@ -40,21 +36,15 @@ class MainApplication : Application(), ReactApplication {
4036
)
4137

4238
override val reactHost: ReactHost
43-
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
39+
get() = ReactNativeHostWrapper.createReactHost(applicationContext, reactNativeHost)
4440

4541
override fun onCreate() {
4642
super.onCreate()
4743
SoLoader.init(this, false)
48-
if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {
49-
ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false
50-
}
5144
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
5245
// If you opted-in for the New Architecture, we load the native entry point for this app.
5346
load()
5447
}
55-
if (BuildConfig.DEBUG) {
56-
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
57-
}
5848
ApplicationLifecycleDispatcher.onApplicationCreate(this)
5949
}
6050

demos/react-native-supabase-todolist/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
<!--

demos/react-native-supabase-todolist/android/build.gradle

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@ buildscript {
66
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')
77
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')
88
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
9-
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.8.10'
9+
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.23'
1010

11-
ndkVersion = "25.1.8937393"
11+
ndkVersion = "26.1.10909125"
1212
}
1313
repositories {
1414
google()
1515
mavenCentral()
1616
}
1717
dependencies {
18-
classpath('com.android.tools.build:gradle:8.2.2')
18+
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

demos/react-native-supabase-todolist/android/gradle.properties

+6
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,9 @@ expo.webp.animated=false
5151

5252
# Enable network inspector
5353
EX_DEV_CLIENT_NETWORK_INSPECTOR=true
54+
55+
# Use legacy packaging to compress native libraries in the resulting APK.
56+
expo.useLegacyPackaging=false
57+
58+
android.minSdkVersion=23
59+
android.extraMavenRepos=[]
Binary file not shown.

demos/react-native-supabase-todolist/android/gradlew.bat

+11-10
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
2828
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

@@ -42,11 +43,11 @@ set JAVA_EXE=java.exe
4243
%JAVA_EXE% -version >NUL 2>&1
4344
if %ERRORLEVEL% equ 0 goto execute
4445

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.
46+
echo. 1>&2
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48+
echo. 1>&2
49+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50+
echo location of your Java installation. 1>&2
5051

5152
goto fail
5253

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

5758
if exist "%JAVA_EXE%" goto execute
5859

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.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6465

6566
goto fail
6667

demos/react-native-supabase-todolist/app.config.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@ const config: ExpoConfig = {
5858
'expo-build-properties',
5959
{
6060
ios: {
61-
deploymentTarget: '13.4'
61+
deploymentTarget: '13.4',
62+
// TODO: New architecture is currently not yet supported by @journeyapps/react-native-quick-sqlite
63+
newArchEnabled: false
64+
},
65+
android: {
66+
minSdkVersion: 23,
67+
// TODO: New architecture is currently not yet supported by @journeyapps/react-native-quick-sqlite
68+
newArchEnabled: false
6269
}
6370
}
6471
],

demos/react-native-supabase-todolist/babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ module.exports = function (api) {
22
api.cache(true);
33
return {
44
presets: ['babel-preset-expo'],
5-
plugins: ['@babel/plugin-transform-async-generator-functions']
5+
plugins: ['@babel/plugin-transform-async-generator-functions', 'react-native-reanimated/plugin']
66
};
77
};

demos/react-native-supabase-todolist/ios/Podfile

+5-27
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,6 @@ install! 'cocoapods',
1313

1414
prepare_react_native_project!
1515

16-
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
17-
# because `react-native-flipper` depends on (FlipperKit,...), which will be excluded. To fix this,
18-
# you can also exclude `react-native-flipper` in `react-native.config.js`
19-
#
20-
# ```js
21-
# module.exports = {
22-
# dependencies: {
23-
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
24-
# }
25-
# }
26-
# ```
27-
flipper_config = FlipperConfiguration.disabled
28-
if ENV['NO_FLIPPER'] == '1' then
29-
# Explicitly disabled through environment variables
30-
flipper_config = FlipperConfiguration.disabled
31-
elsif podfile_properties.key?('ios.flipper') then
32-
# Configure Flipper in Podfile.properties.json
33-
if podfile_properties['ios.flipper'] == 'true' then
34-
flipper_config = FlipperConfiguration.enabled(["Debug", "Release"])
35-
elsif podfile_properties['ios.flipper'] != 'false' then
36-
flipper_config = FlipperConfiguration.enabled(["Debug", "Release"], { 'Flipper' => podfile_properties['ios.flipper'] })
37-
end
38-
end
39-
4016
target 'powersyncexample' do
4117
use_expo_modules!
4218
config = use_native_modules!
@@ -49,15 +25,17 @@ target 'powersyncexample' do
4925
:hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
5026
# An absolute path to your application root.
5127
:app_path => "#{Pod::Config.instance.installation_root}/..",
52-
# Note that if you have use_frameworks! enabled, Flipper will not work if enabled
53-
:flipper_configuration => flipper_config
28+
# Temporarily disable privacy file aggregation by default, until React
29+
# Native 0.74.2 is released with fixes.
30+
:privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] == 'true',
5431
)
5532

5633
post_install do |installer|
5734
react_native_post_install(
5835
installer,
5936
config[:reactNativePath],
60-
:mac_catalyst_enabled => false
37+
:mac_catalyst_enabled => false,
38+
:ccache_enabled => podfile_properties['apple.ccacheEnabled'] == 'true',
6139
)
6240

6341
# This is necessary for Xcode 14, because it signs resource bundles by default

0 commit comments

Comments
 (0)