Skip to content

Commit 901af80

Browse files
author
crow
committed
Migrate from react-native 0.71.1 to 0.73.4
1 parent c6c2334 commit 901af80

31 files changed

+18402
-10335
lines changed

example/.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native-community',
3+
extends: '@react-native',
44
};

example/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,6 @@ buck-out/
5757

5858
# CocoaPods
5959
/ios/Pods/
60+
61+
# testing
62+
/coverage

example/.node-version

-1
This file was deleted.

example/.ruby-version

-1
This file was deleted.

example/Gemfile

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
source 'https://rubygems.org'
22

33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4-
ruby File.read(File.join(__dir__, '.ruby-version')).strip
5-
6-
gem 'cocoapods', '~> 1.11', '>= 1.11.3'
4+
ruby ">= 2.6.10"
5+
6+
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7+
# bound in the template on Cocoapods with next React Native release.
8+
gem 'cocoapods', '>= 1.13', '< 1.15'
9+
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'

example/android/app/build.gradle

+7-55
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
apply plugin: "com.android.application"
2+
apply plugin: "org.jetbrains.kotlin.android"
23
apply plugin: "com.facebook.react"
34

4-
import com.android.build.OutputFile
5-
65
/**
76
* This is the configuration block to customize your React Native Android app.
87
* By default you don't need to apply any configuration, just uncomment the lines you need.
@@ -13,8 +12,9 @@ react {
1312
// root = file("../")
1413
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
1514
// reactNativeDir = file("../node_modules/react-native")
16-
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
17-
// codegenDir = file("../node_modules/react-native-codegen")
15+
16+
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
17+
// codegenDir = file("../node_modules/@react-native/codegen")
1818
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
1919
// cliFile = file("../node_modules/react-native/cli.js")
2020

@@ -52,14 +52,6 @@ react {
5252
// hermesFlags = ["-O", "-output-source-map"]
5353
}
5454

55-
/**
56-
* Set this to true to create four separate APKs instead of one,
57-
* one for each native architecture. This is useful if you don't
58-
* use App Bundles (https://developer.android.com/guide/app-bundle/)
59-
* and want to have separate APKs to upload to the Play Store.
60-
*/
61-
def enableSeparateBuildPerCPUArchitecture = false
62-
6355
/**
6456
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
6557
*/
@@ -78,20 +70,11 @@ def enableProguardInReleaseBuilds = false
7870
*/
7971
def jscFlavor = 'org.webkit:android-jsc:+'
8072

81-
/**
82-
* Private function to get the list of Native Architectures you want to build.
83-
* This reads the value from reactNativeArchitectures in your gradle.properties
84-
* file and works together with the --active-arch-only flag of react-native run-android.
85-
*/
86-
def reactNativeArchitectures() {
87-
def value = project.getProperties().get("reactNativeArchitectures")
88-
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
89-
}
90-
9173
android {
9274
ndkVersion rootProject.ext.ndkVersion
9375

94-
compileSdkVersion rootProject.ext.compileSdkVersion
76+
buildToolsVersion rootProject.ext.buildToolsVersion
77+
compileSdk rootProject.ext.compileSdkVersion
9578

9679
namespace "com.urbanairship.sample"
9780
defaultConfig {
@@ -102,51 +85,20 @@ android {
10285
versionName "1.0"
10386
}
10487

105-
splits {
106-
abi {
107-
reset()
108-
enable enableSeparateBuildPerCPUArchitecture
109-
universalApk false // If true, also generate a universal APK
110-
include (*reactNativeArchitectures())
111-
}
112-
}
11388
buildTypes {
11489
debug {}
11590
release {
11691
minifyEnabled enableProguardInReleaseBuilds
11792
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
11893
}
11994
}
120-
121-
// applicationVariants are e.g. debug, release
122-
applicationVariants.all { variant ->
123-
variant.outputs.each { output ->
124-
// For each separate APK per architecture, set a unique version code as described here:
125-
// https://developer.android.com/studio/build/configure-apk-splits.html
126-
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
127-
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
128-
def abi = output.getFilter(OutputFile.ABI)
129-
if (abi != null) { // null for the universal-debug, universal-release variants
130-
output.versionCodeOverride =
131-
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
132-
}
133-
134-
}
135-
}
13695
}
13796

13897
dependencies {
13998
// The version of react-native is set by the React Native Gradle Plugin
14099
implementation("com.facebook.react:react-android")
100+
implementation("com.facebook.react:flipper-integration")
141101

142-
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
143-
144-
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
145-
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
146-
exclude group:'com.squareup.okhttp3', module:'okhttp'
147-
}
148-
149-
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
150102
if (hermesEnabled.toBoolean()) {
151103
implementation("com.facebook.react:hermes-android")
152104
} else {

example/android/app/src/debug/AndroidManifest.xml

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
44

5-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6-
75
<application
86
android:usesCleartextTraffic="true"
97
tools:targetApi="28"
10-
tools:ignore="GoogleAppIndexingWarning">
11-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
12-
</application>
8+
tools:ignore="GoogleAppIndexingWarning"/>
139
</manifest>

example/android/app/src/debug/java/com/urbanairship/sample/ReactNativeFlipper.java

-75
This file was deleted.

example/android/app/src/main/java/com/urbanairship/sample/MainActivity.java

-35
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.urbanairship.sample
2+
3+
import com.facebook.react.ReactActivity
4+
import com.facebook.react.ReactActivityDelegate
5+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6+
import com.facebook.react.defaults.DefaultReactActivityDelegate
7+
8+
class MainActivity : ReactActivity() {
9+
/**
10+
* Returns the name of the main component registered from JavaScript. This is used to schedule
11+
* rendering of the component.
12+
*/
13+
override fun getMainComponentName(): String = "AirshipExample"
14+
/**
15+
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
16+
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
17+
*/
18+
override fun createReactActivityDelegate(): ReactActivityDelegate =
19+
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
20+
}

example/android/app/src/main/java/com/urbanairship/sample/MainApplication.java

-63
This file was deleted.

0 commit comments

Comments
 (0)