Skip to content

Commit f58cdd4

Browse files
authored
Upgrate react native to 0.72.1 (#362)
* feat(rn): update react-native to 0.72 * feat(rn): update react-native to 0.72.1 --------- Co-authored-by: jeremydolle <[email protected]>
1 parent ce1e51c commit f58cdd4

File tree

23 files changed

+2332
-3744
lines changed

23 files changed

+2332
-3744
lines changed

template/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = {
33
'jest/globals': true,
44
},
55
root: true,
6-
extends: '@react-native-community',
6+
extends: '@react-native',
77
rules: {
88
'react-hooks/exhaustive-deps': 'off',
99
quotes: ['error', 'single'],

template/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,6 @@ yarn-error.log
6161

6262
# Temporary files created by Metro to check the health of the file watcher
6363
.metro-health-check*
64+
65+
# testing
66+
/coverage

template/.node-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

template/.ruby-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

template/Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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
4+
ruby ">= 2.6.10"
55

6-
gem 'cocoapods', '~> 1.11', '>= 1.11.3'
6+
gem 'cocoapods', '~> 1.12'

template/android/app/build.gradle

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
apply plugin: "com.android.application"
22
apply plugin: "com.facebook.react"
33

4-
import com.android.build.OutputFile
5-
64
/**
75
* This is the configuration block to customize your React Native Android app.
86
* By default you don't need to apply any configuration, just uncomment the lines you need.
@@ -13,8 +11,8 @@ react {
1311
// root = file("../")
1412
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
1513
// 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")
14+
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
15+
// codegenDir = file("../node_modules/@react-native/codegen")
1816
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
1917
// cliFile = file("../node_modules/react-native/cli.js")
2018

@@ -52,14 +50,6 @@ react {
5250
// hermesFlags = ["-O", "-output-source-map"]
5351
}
5452

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-
6353
/**
6454
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
6555
*/
@@ -78,16 +68,6 @@ def enableProguardInReleaseBuilds = false
7868
*/
7969
def jscFlavor = 'org.webkit:android-jsc:+'
8070

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-
9171
android {
9272
ndkVersion rootProject.ext.ndkVersion
9373

@@ -101,15 +81,6 @@ android {
10181
versionCode 1
10282
versionName "1.0"
10383
}
104-
105-
splits {
106-
abi {
107-
reset()
108-
enable enableSeparateBuildPerCPUArchitecture
109-
universalApk false // If true, also generate a universal APK
110-
include (*reactNativeArchitectures())
111-
}
112-
}
11384
signingConfigs {
11485
debug {
11586
storeFile file('debug.keystore')
@@ -130,30 +101,12 @@ android {
130101
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
131102
}
132103
}
133-
134-
// applicationVariants are e.g. debug, release
135-
applicationVariants.all { variant ->
136-
variant.outputs.each { output ->
137-
// For each separate APK per architecture, set a unique version code as described here:
138-
// https://developer.android.com/studio/build/configure-apk-splits.html
139-
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
140-
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
141-
def abi = output.getFilter(OutputFile.ABI)
142-
if (abi != null) { // null for the universal-debug, universal-release variants
143-
output.versionCodeOverride =
144-
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
145-
}
146-
147-
}
148-
}
149104
}
150105

151106
dependencies {
152107
// The version of react-native is set by the React Native Gradle Plugin
153108
implementation("com.facebook.react:react-android")
154109

155-
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
156-
157110
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
158111
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
159112
exclude group:'com.squareup.okhttp3', module:'okhttp'

template/android/app/src/main/java/com/boilerplate/MainActivity.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ protected ReactActivityDelegate createReactActivityDelegate() {
2727
this,
2828
getMainComponentName(),
2929
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
30-
DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled
31-
// If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
32-
DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled
33-
);
30+
DefaultNewArchitectureEntryPoint.getFabricEnabled());
3431
}
3532
}

template/android/app/src/main/res/drawable/rn_edit_text_material.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
2121

2222
<selector>
23-
<!--
23+
<!--
2424
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
2525
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
2626
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'

template/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ buildscript {
1515
mavenCentral()
1616
}
1717
dependencies {
18-
classpath("com.android.tools.build:gradle:7.3.1")
18+
classpath("com.android.tools.build:gradle")
1919
classpath("com.facebook.react:react-native-gradle-plugin")
2020
}
2121
}

template/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ android.useAndroidX=true
2525
android.enableJetifier=true
2626

2727
# Version of flipper SDK to use with React Native
28-
FLIPPER_VERSION=0.125.0
28+
FLIPPER_VERSION=0.182.0
2929

3030
# Use this property to specify which architecture you want to build.
3131
# You can also override it from the CLI using

0 commit comments

Comments
 (0)