Skip to content

Commit 8f1b08a

Browse files
committed
Update to React Native 0.72.0-rc.5
1 parent c80b24a commit 8f1b08a

23 files changed

+1381
-4215
lines changed

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
root: true,
33
extends: [
4-
'@react-native-community',
4+
'@react-native',
55
'plugin:react/recommended',
66
'standard-with-typescript',
77
'standard-react',

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,6 @@ yarn-error.log
6767

6868
# Temporary files created by Metro to check the health of the file watcher
6969
.metro-health-check*
70+
71+
# testing
72+
/coverage

.node-version

-1
This file was deleted.

.watchmanconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}

Gemfile

+2-2
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 '>= 2.6.10'
4+
ruby ">= 2.6.10"
55

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

__tests__/App-test.tsx renamed to __tests__/App.test.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import 'react-native'
66
import React from 'react'
77
import App from '../src/App'
88

9+
// Note: import explicitly to use the types shiped with jest.
10+
import { it } from '@jest/globals'
11+
912
// Note: test renderer must be required after react-native.
1013
import renderer from 'react-test-renderer'
1114

android/app/build.gradle

+3-49
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ apply plugin: "com.android.application"
22
apply plugin: "com.facebook.react"
33
apply plugin: "kotlin-android" // manual
44

5-
import com.android.build.OutputFile
6-
75
/**
86
* This is the configuration block to customize your React Native Android app.
97
* By default you don't need to apply any configuration, just uncomment the lines you need.
@@ -13,9 +11,9 @@ react {
1311
// The root of your project, i.e. where "package.json" lives. Default is '..'
1412
// root = file("../")
1513
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
16-
// reactNativeDir = file("../node_smodules/react-native")
17-
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
18-
// codegenDir = file("../node_smodules/react-native-codegen")
14+
// reactNativeDir = file("../node_modules/react-native")
15+
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
16+
// codegenDir = file("../node_modules/@react-native/codegen")
1917
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
2018
// cliFile = file("../node_modules/react-native/cli.js")
2119

@@ -53,14 +51,6 @@ react {
5351
// hermesFlags = ["-O", "-output-source-map"]
5452
}
5553

56-
/**
57-
* Set this to true to create four separate APKs instead of one,
58-
* one for each native architecture. This is useful if you don't
59-
* use App Bundles (https://developer.android.com/guide/app-bundle/)
60-
* and want to have separate APKs to upload to the Play Store.
61-
*/
62-
def enableSeparateBuildPerCPUArchitecture = true
63-
6454
/**
6555
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
6656
*/
@@ -79,16 +69,6 @@ def enableProguardInReleaseBuilds = false
7969
*/
8070
def jscFlavor = 'org.webkit:android-jsc:+'
8171

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

@@ -103,14 +83,6 @@ android {
10383
versionName "1.0.0-alpha.5"
10484
}
10585

106-
splits {
107-
abi {
108-
reset()
109-
enable enableSeparateBuildPerCPUArchitecture
110-
universalApk false // If true, also generate a universal APK
111-
include (*reactNativeArchitectures())
112-
}
113-
}
11486
signingConfigs {
11587
debug {
11688
storeFile file('debug.keystore')
@@ -139,22 +111,6 @@ android {
139111
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
140112
}
141113
}
142-
143-
// applicationVariants are e.g. debug, release
144-
applicationVariants.all { variant ->
145-
variant.outputs.each { output ->
146-
// For each separate APK per architecture, set a unique version code as described here:
147-
// https://developer.android.com/studio/build/configure-apk-splits.html
148-
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
149-
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
150-
def abi = output.getFilter(OutputFile.ABI)
151-
if (abi != null) { // null for the universal-debug, universal-release variants
152-
output.versionCodeOverride =
153-
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
154-
}
155-
156-
}
157-
}
158114
}
159115

160116
dependencies {
@@ -165,8 +121,6 @@ dependencies {
165121
// The version of react-native is set by the React Native Gradle Plugin
166122
implementation("com.facebook.react:react-android")
167123

168-
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
169-
170124
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
171125
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
172126
exclude group:'com.squareup.okhttp3', module:'okhttp'

android/app/src/main/java/com/enderchat/MainActivity.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ protected ReactActivityDelegate createReactActivityDelegate() {
2828
this,
2929
getMainComponentName(),
3030
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
31-
DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled
32-
// If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
33-
DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled
34-
);
31+
DefaultNewArchitectureEntryPoint.getFabricEnabled());
3532
}
3633

3734
@Override

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
android:insetTop="@dimen/abc_edit_text_inset_top_material"
1717
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
1818
<selector>
19-
<!--
19+
<!--
2020
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
2121
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
2222
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'

android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ buildscript {
1616
mavenCentral()
1717
}
1818
dependencies {
19-
classpath("com.android.tools.build:gradle:7.3.1")
19+
classpath("com.android.tools.build:gradle")
2020
classpath("com.facebook.react:react-native-gradle-plugin")
2121
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.ext.kotlinVersion}") // manual
2222
}

android/gradle.properties

+1-1
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
1.71 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

android/gradlew

+14-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,10 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

8888
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
8989
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -143,12 +143,16 @@ fi
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147+
# shellcheck disable=SC3045
146148
MAX_FD=$( ulimit -H -n ) ||
147149
warn "Could not query maximum file descriptor limit"
148150
esac
149151
case $MAX_FD in #(
150152
'' | soft) :;; #(
151153
*)
154+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155+
# shellcheck disable=SC3045
152156
ulimit -n "$MAX_FD" ||
153157
warn "Could not set maximum file descriptor limit to $MAX_FD"
154158
esac
@@ -205,6 +209,12 @@ set -- \
205209
org.gradle.wrapper.GradleWrapperMain \
206210
"$@"
207211

212+
# Stop when "xargs" is not available.
213+
if ! command -v xargs >/dev/null 2>&1
214+
then
215+
die "xargs is not available"
216+
fi
217+
208218
# Use "xargs" to parse quoted args.
209219
#
210220
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

android/gradlew.bat

+12-23
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@rem limitations under the License.
1515
@rem
1616

17-
@if "%DEBUG%" == "" @echo off
17+
@if "%DEBUG%"=="" @echo off
1818
@rem ##########################################################################
1919
@rem
2020
@rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
2525
if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
28-
if "%DIRNAME%" == "" set DIRNAME=.
28+
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4041

4142
set JAVA_EXE=java.exe
4243
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto init
44+
if %ERRORLEVEL% equ 0 goto execute
4445

4546
echo.
4647
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +55,7 @@ goto fail
5455
set JAVA_HOME=%JAVA_HOME:"=%
5556
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5657

57-
if exist "%JAVA_EXE%" goto init
58+
if exist "%JAVA_EXE%" goto execute
5859

5960
echo.
6061
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,38 +65,26 @@ echo location of your Java installation.
6465

6566
goto fail
6667

67-
:init
68-
@rem Get command-line arguments, handling Windows variants
69-
70-
if not "%OS%" == "Windows_NT" goto win9xME_args
71-
72-
:win9xME_args
73-
@rem Slurp the command line arguments.
74-
set CMD_LINE_ARGS=
75-
set _SKIP=2
76-
77-
:win9xME_args_slurp
78-
if "x%~1" == "x" goto execute
79-
80-
set CMD_LINE_ARGS=%*
81-
8268
:execute
8369
@rem Setup the command line
8470

8571
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
8672

73+
8774
@rem Execute Gradle
88-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
75+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
8976

9077
:end
9178
@rem End local scope for the variables with windows NT shell
92-
if "%ERRORLEVEL%"=="0" goto mainEnd
79+
if %ERRORLEVEL% equ 0 goto mainEnd
9380

9481
:fail
9582
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
9683
rem the _cmd.exe /c_ return code!
97-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
98-
exit /b 1
84+
set EXIT_CODE=%ERRORLEVEL%
85+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
86+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87+
exit /b %EXIT_CODE%
9988

10089
:mainEnd
10190
if "%OS%"=="Windows_NT" endlocal

android/settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
rootProject.name = 'EnderChat'
22
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
33
include ':app'
4-
includeBuild('../node_modules/react-native-gradle-plugin')
4+
includeBuild('../node_modules/@react-native/gradle-plugin')

app.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "EnderChat",
33
"displayName": "EnderChat"
4-
}
4+
}

ios/EnderChat/AppDelegate.mm

-10
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,4 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
2323
#endif
2424
}
2525

26-
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
27-
///
28-
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
29-
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
30-
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
31-
- (BOOL)concurrentRootEnabled
32-
{
33-
return true;
34-
}
35-
3626
@end

ios/Podfile

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
require_relative '../node_modules/react-native/scripts/react_native_pods'
2-
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
1+
# Resolve react_native_pods.rb with node to allow for hoisting
2+
require Pod::Executable.execute_command('node', ['-p',
3+
'require.resolve(
4+
"react-native/scripts/react_native_pods.rb",
5+
{paths: [process.argv[1]]},
6+
)', __dir__]).strip
37

48
platform :ios, min_ios_version_supported
59
prepare_react_native_project!
@@ -30,8 +34,6 @@ target 'EnderChat' do
3034
use_react_native!(
3135
:path => config[:reactNativePath],
3236
# Hermes is now enabled by default. Disable by setting this flag to false.
33-
# Upcoming versions of React Native may rely on get_default_flags(), but
34-
# we make it explicit here to aid in the React Native upgrade process.
3537
:hermes_enabled => flags[:hermes_enabled],
3638
:fabric_enabled => flags[:fabric_enabled],
3739
# Enables Flipper.
@@ -49,10 +51,10 @@ target 'EnderChat' do
4951
end
5052

5153
post_install do |installer|
54+
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
5255
react_native_post_install(
5356
installer,
54-
# Set `mac_catalyst_enabled` to `true` in order to apply patches
55-
# necessary for Mac Catalyst builds
57+
config[:reactNativePath],
5658
:mac_catalyst_enabled => false
5759
)
5860
__apply_Xcode_12_5_M1_post_install_workaround(installer)

0 commit comments

Comments
 (0)