Skip to content

Commit 554914f

Browse files
committed
Bump min version for rn-s-todolist.
1 parent 701f122 commit 554914f

Some content is hidden

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

52 files changed

+71
-145
lines changed

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

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,6 @@ apply plugin: "com.facebook.react"
44

55
def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()
66

7-
static def versionToNumber(major, minor, patch) {
8-
return patch * 100 + minor * 10000 + major * 1000000
9-
}
10-
11-
def getRNVersion() {
12-
def version = providers.exec {
13-
workingDir(projectDir)
14-
commandLine("node", "-e", "console.log(require('react-native/package.json').version);")
15-
}.standardOutput.asText.get().trim()
16-
17-
def coreVersion = version.split("-")[0]
18-
def (major, minor, patch) = coreVersion.tokenize('.').collect { it.toInteger() }
19-
20-
return versionToNumber(
21-
major,
22-
minor,
23-
patch
24-
)
25-
}
26-
def rnVersion = getRNVersion()
27-
287
/**
298
* This is the configuration block to customize your React Native Android app.
309
* By default you don't need to apply any configuration, just uncomment the lines you need.
@@ -41,12 +20,12 @@ react {
4120
bundleCommand = "export:embed"
4221

4322
/* Folders */
44-
// The root of your project, i.e. where "package.json" lives. Default is '..'
45-
// root = file("../")
46-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
47-
// reactNativeDir = file("../node_modules/react-native")
48-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
49-
// 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")
5029

5130
/* Variants */
5231
// The list of variants to that are debuggable. For those we're going to
@@ -79,10 +58,8 @@ react {
7958
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
8059
// hermesFlags = ["-O", "-output-source-map"]
8160

82-
if (rnVersion >= versionToNumber(0, 75, 0)) {
83-
/* Autolinking */
84-
autolinkLibrariesWithApp()
85-
}
61+
/* Autolinking */
62+
autolinkLibrariesWithApp()
8663
}
8764

8865
/**
@@ -144,6 +121,9 @@ android {
144121
useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
145122
}
146123
}
124+
androidResources {
125+
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~'
126+
}
147127
}
148128

149129
// Apply static values from `gradle.properties` to the `android.packagingOptions`
@@ -194,8 +174,3 @@ dependencies {
194174
implementation jscFlavor
195175
}
196176
}
197-
198-
if (rnVersion < versionToNumber(0, 75, 0)) {
199-
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");
200-
applyNativeModulesAppBuildGradle(project)
201-
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
<data android:scheme="https"/>
1414
</intent>
1515
</queries>
16-
<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">
16+
<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" android:fullBackupContent="@xml/secure_store_backup_rules" android:dataExtractionRules="@xml/secure_store_data_extraction_rules">
1717
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
1818
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
1919
<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/"/>
20+
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://u.expo.dev/b5a3e5ad-eb77-4296-a34e-9556dd7d6e05"/>
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"/>
@@ -32,6 +32,5 @@
3232
<data android:scheme="exp+powersync-example"/>
3333
</intent-filter>
3434
</activity>
35-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>
3635
</application>
3736
</manifest>

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package com.powersync.example
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/react-native-supabase-todolist/android/app/src/main/java/com/powersync/example/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()
Binary file not shown.
5.96 KB
Binary file not shown.
3.43 KB
Binary file not shown.
8.6 KB

0 commit comments

Comments
 (0)