Skip to content

Commit 7fe70bd

Browse files
authored
chore: Expo 52 for RN demos, fixes for react-native-web demo (#560)
1 parent 806d5ca commit 7fe70bd

File tree

225 files changed

+6215
-6955
lines changed

Some content is hidden

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

225 files changed

+6215
-6955
lines changed

.changeset/ninety-onions-worry.md

Lines changed: 5 additions & 0 deletions

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

Lines changed: 12 additions & 9 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
/**
@@ -118,6 +121,9 @@ android {
118121
useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
119122
}
120123
}
124+
androidResources {
125+
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~'
126+
}
121127
}
122128

123129
// Apply static values from `gradle.properties` to the `android.packagingOptions`
@@ -168,6 +174,3 @@ dependencies {
168174
implementation jscFlavor
169175
}
170176
}
171-
172-
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");
173-
applyNativeModulesAppBuildGradle(project)

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
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"/>
1616
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
1717
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
@@ -29,6 +29,5 @@
2929
<data android:scheme="exp+powersync-example"/>
3030
</intent-filter>
3131
</activity>
32-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>
3332
</application>
3433
</manifest>

demos/django-react-native-todolist/android/app/src/main/java/com/anonymous/powersyncexample/MainActivity.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package com.anonymous.powersyncexample
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

demos/django-react-native-todolist/android/app/src/main/java/com/anonymous/powersyncexample/MainApplication.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import com.facebook.react.ReactPackage
1010
import com.facebook.react.ReactHost
1111
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
1212
import com.facebook.react.defaults.DefaultReactNativeHost
13+
import com.facebook.react.soloader.OpenSourceMergedSoMapping
1314
import com.facebook.soloader.SoLoader
1415

1516
import expo.modules.ApplicationLifecycleDispatcher
@@ -21,9 +22,10 @@ class MainApplication : Application(), ReactApplication {
2122
this,
2223
object : DefaultReactNativeHost(this) {
2324
override fun getPackages(): List<ReactPackage> {
25+
val packages = PackageList(this).packages
2426
// Packages that cannot be autolinked yet can be added manually here, for example:
2527
// packages.add(new MyReactNativePackage());
26-
return PackageList(this).packages
28+
return packages
2729
}
2830

2931
override fun getJSMainModuleName(): String = ".expo/.virtual-metro-entry"
@@ -40,7 +42,7 @@ class MainApplication : Application(), ReactApplication {
4042

4143
override fun onCreate() {
4244
super.onCreate()
43-
SoLoader.init(this, false)
45+
SoLoader.init(this, OpenSourceMergedSoMapping)
4446
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
4547
// If you opted-in for the New Architecture, we load the native entry point for this app.
4648
load()
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>

demos/django-react-native-todolist/android/app/src/main/res/values/styles.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
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>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

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

1111
ndkVersion = "26.1.10909125"
1212
}

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ 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
27-
2825
# Enable AAPT2 PNG crunching
2926
android.enablePngCrunchInReleaseBuilds=true
3027

@@ -53,13 +50,13 @@ expo.webp.enabled=true
5350
expo.webp.animated=false
5451

5552
# Enable network inspector
56-
EX_DEV_CLIENT_NETWORK_INSPECTOR=true
53+
EX_DEV_CLIENT_NETWORK_INSPECTOR=false
5754

5855
# Use legacy packaging to compress native libraries in the resulting APK.
5956
expo.useLegacyPackaging=false
6057

6158
android.minSdkVersion=24
62-
android.compileSdkVersion=34
63-
android.targetSdkVersion=34
64-
android.buildToolsVersion=34.0.0
65-
android.extraMavenRepos=[]
59+
android.compileSdkVersion=35
60+
android.targetSdkVersion=35
61+
android.buildToolsVersion=35.0.0
62+
android.extraMavenRepos=[]
Binary file not shown.

demos/django-react-native-todolist/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
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.6-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

demos/django-react-native-todolist/android/gradlew

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

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

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

demos/django-react-native-todolist/android/settings.gradle

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
pluginManagement {
2+
includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile().toString())
3+
}
4+
plugins { id("com.facebook.react.settings") }
5+
6+
extensions.configure(com.facebook.react.ReactSettingsExtension) { ex ->
7+
if (System.getenv('EXPO_USE_COMMUNITY_AUTOLINKING') == '1') {
8+
ex.autolinkLibrariesFromCommand()
9+
} else {
10+
def command = [
11+
'node',
12+
'--no-warnings',
13+
'--eval',
14+
'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))',
15+
'react-native-config',
16+
'--json',
17+
'--platform',
18+
'android'
19+
].toList()
20+
ex.autolinkLibrariesFromCommand(command)
21+
}
22+
}
23+
124
rootProject.name = 'powersync-example'
225

326
dependencyResolutionManagement {
@@ -11,8 +34,5 @@ dependencyResolutionManagement {
1134
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle");
1235
useExpoModules()
1336

14-
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");
15-
applyNativeModulesSettingsGradle(settings)
16-
1737
include ':app'
1838
includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile())

demos/django-react-native-todolist/app.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
"expo-build-properties",
3434
{
3535
"ios": {
36-
"deploymentTarget": "13.4",
36+
"deploymentTarget": "15.1",
3737
"newArchEnabled": false
3838
},
3939
"android": {
4040
"minSdkVersion": 24,
41-
"compileSdkVersion": 34,
42-
"targetSdkVersion": 34,
43-
"buildToolsVersion": "34.0.0",
41+
"compileSdkVersion": 35,
42+
"targetSdkVersion": 35,
43+
"buildToolsVersion": "35.0.0",
4444
"networkInspector": false,
4545
"newArchEnabled": false
4646
}

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

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,31 @@ podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties
77
ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'
88
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
99

10-
platform :ios, podfile_properties['ios.deploymentTarget'] || '13.4'
10+
platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1'
1111
install! 'cocoapods',
1212
:deterministic_uuids => false
1313

1414
prepare_react_native_project!
1515

1616
target 'powersyncexample' do
1717
use_expo_modules!
18-
config = use_native_modules!
18+
19+
if ENV['EXPO_USE_COMMUNITY_AUTOLINKING'] == '1'
20+
config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"];
21+
else
22+
config_command = [
23+
'node',
24+
'--no-warnings',
25+
'--eval',
26+
'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))',
27+
'react-native-config',
28+
'--json',
29+
'--platform',
30+
'ios'
31+
]
32+
end
33+
34+
config = use_native_modules!(config_command)
1935

2036
use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
2137
use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
@@ -47,12 +63,4 @@ target 'powersyncexample' do
4763
end
4864
end
4965
end
50-
51-
post_integrate do |installer|
52-
begin
53-
expo_patch_react_imports!(installer)
54-
rescue => e
55-
Pod::UI.warn e
56-
end
57-
end
5866
end

0 commit comments

Comments
 (0)