-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mobile: Upgrade to React Native 0.74.1 #10401
Merged
Merged
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
188b8f0
Non-working partial upgrade (rn-alarm-notification needs upgrading too)
personalizedrefrigerator 12022b1
Fix iOS build
personalizedrefrigerator 0491cae
Compatibility with newer Gradle versions
personalizedrefrigerator 4b94fcc
Fix Android build: Migrate from `@react-native-community/clipboard` to
personalizedrefrigerator dae3791
Add setup-java action
personalizedrefrigerator c4f38b6
Upgrade react-native-image-resizer to fix build
personalizedrefrigerator 9cc83bc
Move CI to Java 20
personalizedrefrigerator 218bf6b
Update RN patch for React Native 0.73.8
personalizedrefrigerator 012d150
Link xcprivacy file
personalizedrefrigerator 25071d0
Remove duplicate .xcprivacy file
personalizedrefrigerator cf3b41c
Merge remote-tracking branch 'refs/remotes/origin/pr/rn-73' into pr/r…
personalizedrefrigerator 1ebdc5e
Update .xcprivacy file for APIs used by dependencies
personalizedrefrigerator 8438066
Merge remote-tracking branch 'upstream/dev' into pr/rn-73
personalizedrefrigerator d6ea780
WIP: React Native 0.74.1
personalizedrefrigerator b6fd1d1
Upgrade react-native-safe-area-context
personalizedrefrigerator 044b083
Update RN patch for RN 0.74
personalizedrefrigerator 5082600
Fix native modules not loading
personalizedrefrigerator a0ea39d
Changes made by pod install, running in XCode
personalizedrefrigerator 7a2e250
Merge remote-tracking branch 'refs/remotes/origin/pr/rn-73' into pr/r…
personalizedrefrigerator b88b1a5
Merge remote-tracking branch 'refs/remotes/origin/pr/rn-73' into pr/r…
personalizedrefrigerator 73ab64c
Merge branch 'dev' into pr/rn-73
personalizedrefrigerator 5222f98
Merge remote-tracking branch 'upstream/dev' into pr/rn-73
personalizedrefrigerator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
source 'https://rubygems.org' | ||
|
||
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version | ||
ruby '>= 2.6.10' | ||
gem 'cocoapods', '>= 1.11.3' | ||
ruby ">= 2.6.10" | ||
|
||
# Cocoapods 1.15 introduced a bug which breaks the build. We will remove the upper | ||
# bound in the template on Cocoapods with next React Native release. | ||
gem 'cocoapods', '>= 1.13', '< 1.15' | ||
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
apply plugin: "com.android.application" | ||
apply plugin: "org.jetbrains.kotlin.android" | ||
apply plugin: "com.facebook.react" | ||
|
||
import com.android.build.OutputFile | ||
import org.apache.tools.ant.taskdefs.condition.Os | ||
|
||
/* This is the configuration block to customize your React Native Android app. | ||
/** | ||
* This is the configuration block to customize your React Native Android app. | ||
* By default you don't need to apply any configuration, just uncomment the lines you need. | ||
*/ | ||
|
||
react { | ||
/* Folders */ | ||
// The root of your project, i.e. where "package.json" lives. Default is '..' | ||
// root = file("../") | ||
// The folder where the react-native NPM package is. Default is ../node_modules/react-native | ||
// reactNativeDir = file("../node_modules/react-native") | ||
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen | ||
// codegenDir = file("../node_modules/react-native-codegen") | ||
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen | ||
// codegenDir = file("../node_modules/@react-native/codegen") | ||
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js | ||
// cliFile = file("../node_modules/react-native/cli.js") | ||
|
||
/* Variants */ | ||
// The list of variants to that are debuggable. For those we're going to | ||
// skip the bundling of the JS bundle and the assets. By default is just 'debug'. | ||
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. | ||
// debuggableVariants = ["liteDebug", "prodDebug"] | ||
|
||
/* Bundling */ | ||
// A list containing the node command and its flags. Default is just 'node'. | ||
// nodeExecutableAndArgs = ["node"] | ||
|
@@ -42,6 +42,7 @@ react { | |
// A list of extra flags to pass to the 'bundle' commands. | ||
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle | ||
// extraPackagerArgs = [] | ||
|
||
/* Hermes Commands */ | ||
// The hermes compiler command to run. By default it is 'hermesc' | ||
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" | ||
|
@@ -50,14 +51,6 @@ react { | |
// hermesFlags = ["-O", "-output-source-map"] | ||
} | ||
|
||
/** | ||
* Set this to true to create four separate APKs instead of one, | ||
* one for each native architecture. This is useful if you don't | ||
* use App Bundles (https://developer.android.com/guide/app-bundle/) | ||
* and want to have separate APKs to upload to the Play Store. | ||
*/ | ||
def enableSeparateBuildPerCPUArchitecture = false | ||
|
||
/** | ||
* Set this to true to Run Proguard on Release builds to minify the Java bytecode. | ||
*/ | ||
|
@@ -74,36 +67,12 @@ def enableProguardInReleaseBuilds = false | |
* give correct results when using with locales other than en-US. Note that | ||
* this variant is about 6MiB larger per architecture than default. | ||
*/ | ||
|
||
// We need the intl variant to support natural sorting of notes. | ||
// https://github.com/laurent22/joplin/pull/4272 | ||
def jscFlavor = 'org.webkit:android-jsc-intl:+' | ||
|
||
/** | ||
* Private function to get the list of Native Architectures you want to build. | ||
* This reads the value from reactNativeArchitectures in your gradle.properties | ||
* file and works together with the --active-arch-only flag of react-native run-android. | ||
*/ | ||
def reactNativeArchitectures() { | ||
def value = project.getProperties().get("reactNativeArchitectures") | ||
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] | ||
} | ||
Comment on lines
-87
to
-90
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code was removed upstream. See android/app/build.gradle in the upgrade diff. |
||
def jscFlavor = 'org.webkit:android-jsc:+' | ||
|
||
android { | ||
ndkVersion rootProject.ext.ndkVersion | ||
|
||
compileSdkVersion rootProject.ext.compileSdkVersion | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
|
||
// dexOptions { | ||
// // To fix "GC overhead limit exceeded" | ||
// // https://stackoverflow.com/q/32133013/561309 | ||
// javaMaxHeapSize "4g" | ||
// } | ||
buildToolsVersion rootProject.ext.buildToolsVersion | ||
compileSdk rootProject.ext.compileSdkVersion | ||
|
||
namespace "net.cozic.joplin" | ||
defaultConfig { | ||
|
@@ -120,17 +89,7 @@ android { | |
missingDimensionStrategy 'react-native-camera', 'general' | ||
|
||
// Needed to fix: The number of method references in a .dex file cannot exceed 64K | ||
multiDexEnabled true | ||
} | ||
|
||
splits { | ||
abi { | ||
reset() | ||
enable enableSeparateBuildPerCPUArchitecture | ||
universalApk false // If true, also generate a universal APK | ||
// include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" | ||
include (*reactNativeArchitectures()) | ||
} | ||
multiDexEnabled true | ||
} | ||
signingConfigs { | ||
debug { | ||
|
@@ -147,7 +106,7 @@ android { | |
keyPassword JOPLIN_RELEASE_KEY_PASSWORD | ||
} | ||
} | ||
} | ||
} | ||
buildTypes { | ||
debug { | ||
signingConfig signingConfigs.debug | ||
|
@@ -160,32 +119,6 @@ android { | |
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" | ||
} | ||
} | ||
|
||
// applicationVariants are e.g. debug, release | ||
applicationVariants.all { variant -> | ||
variant.outputs.each { output -> | ||
// For each separate APK per architecture, set a unique version code as described here: | ||
// https://developer.android.com/studio/build/configure-apk-splits.html | ||
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. | ||
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] | ||
def abi = output.getFilter(OutputFile.ABI) | ||
if (abi != null) { // null for the universal-debug, universal-release variants | ||
output.versionCodeOverride = | ||
defaultConfig.versionCode * 1000 + versionCodes.get(abi) | ||
} | ||
|
||
} | ||
} | ||
|
||
// To fix this error: | ||
// | ||
// > Execution failed for task ':app:lintVitalRelease' | ||
// | ||
// https://stackoverflow.com/a/62603296/561309 | ||
// lintOptions { | ||
// disable 'InvalidPackage' | ||
// checkReleaseBuilds false | ||
// } | ||
} | ||
|
||
dependencies { | ||
|
@@ -195,27 +128,14 @@ dependencies { | |
exclude group: 'com.google.android.gms', module: 'play-services-vision' | ||
} | ||
|
||
// implementation fileTree(dir: "libs", include: ["*.jar"]) | ||
|
||
// The version of react-native is set by the React Native Gradle Plugin | ||
implementation("com.facebook.react:react-android") | ||
|
||
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0") | ||
|
||
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") | ||
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { | ||
exclude group:'com.squareup.okhttp3', module:'okhttp' | ||
} | ||
|
||
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") | ||
if (hermesEnabled.toBoolean()) { | ||
implementation("com.facebook.react:hermes-android") | ||
} else { | ||
implementation jscFlavor | ||
} | ||
|
||
// Needed to fix: The number of method references in a .dex file cannot exceed 64K | ||
// implementation 'com.android.support:multidex:2.0.1' | ||
} | ||
|
||
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 0 additions & 75 deletions
75
packages/app-mobile/android/app/src/debug/java/net/cozic/joplin/ReactNativeFlipper.java
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
packages/app-mobile/android/app/src/main/java/net/cozic/joplin/MainActivity.java
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
packages/app-mobile/android/app/src/main/java/net/cozic/joplin/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package net.cozic.joplin | ||
|
||
import com.facebook.react.ReactActivity | ||
import com.facebook.react.ReactActivityDelegate | ||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled | ||
import com.facebook.react.defaults.DefaultReactActivityDelegate | ||
|
||
class MainActivity : ReactActivity() { | ||
|
||
/** | ||
* Returns the name of the main component registered from JavaScript. This is used to schedule | ||
* rendering of the component. | ||
*/ | ||
override fun getMainComponentName(): String = "Joplin" | ||
|
||
/** | ||
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] | ||
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled] | ||
*/ | ||
override fun createReactActivityDelegate(): ReactActivityDelegate = | ||
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We no longer use JSC. Hermes should support Intl natively.