Skip to content

Commit e44fe2d

Browse files
chore: update scripts/update-rn.sh to v0.72.0 (#3146)
Co-authored-by: GitHub <[email protected]>
1 parent 0677344 commit e44fe2d

File tree

20 files changed

+2219
-2732
lines changed

20 files changed

+2219
-2732
lines changed

.github/workflows/e2e.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ jobs:
148148
strategy:
149149
fail-fast: false # keeps matrix running if one fails
150150
matrix:
151-
rn-version: ['0.65.3', '0.71.3']
151+
rn-version: ['0.65.3', '0.72.0']
152152
rn-architecture: ['legacy', 'new']
153153
platform: ['android', 'ios']
154154
build-type: ['dev', 'production']
@@ -344,7 +344,7 @@ jobs:
344344
strategy:
345345
fail-fast: false # keeps matrix running if one fails
346346
matrix:
347-
rn-version: ['0.65.3', '0.71.3']
347+
rn-version: ['0.65.3', '0.72.0']
348348
rn-architecture: ['legacy', 'new']
349349
platform: ['android', 'ios']
350350
build-type: ['production']

.github/workflows/sample-application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
path: |
5656
node_modules
5757
sample-new-architecture/node_modules
58-
key: ${{ github.workflow }}-${{ github.job }}-npm-${{ hashFiles('yarn.lock', 'sample-new-architecture/node_modules/yarn.lock') }}
58+
key: ${{ github.workflow }}-${{ github.job }}-npm-${{ hashFiles('yarn.lock', 'sample-new-architecture/yarn.lock') }}
5959

6060
- name: Install SDK Dependencies
6161
if: ${{ steps.deps-cache.outputs['cache-hit'] != 'true' }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"jest-environment-jsdom": "^29.4.1",
8181
"prettier": "^2.0.5",
8282
"react": "18.2.0",
83-
"react-native": "0.71.7",
83+
"react-native": "0.72.0",
8484
"replace-in-file": "^6.0.0",
8585
"rimraf": "^4.1.1",
8686
"ts-jest": "^29.0.5",

sample-new-architecture/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native-community',
3+
extends: '@react-native',
44
parser: '@typescript-eslint/parser',
55
plugins: ['@typescript-eslint'],
66
overrides: [

sample-new-architecture/__tests__/App-test.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
* @format
33
*/
44

5-
import 'react-native';
65
import React from 'react';
76

7+
// Note: import explicitly to use the types shipped with jest.
8+
import { it } from '@jest/globals';
9+
810
// Note: test renderer must be required after react-native.
911
import renderer from 'react-test-renderer';
1012

sample-new-architecture/android/app/build.gradle

Lines changed: 2 additions & 48 deletions
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: "io.sentry.android.gradle"
44

5-
import com.android.build.OutputFile
6-
75
sentry {
86
// Disables or enables the automatic configuration of Native Symbols
97
// for Sentry. This executes sentry-cli automatically so
@@ -24,8 +22,8 @@ react {
2422
// root = file("../")
2523
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
2624
// 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")
25+
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
26+
// codegenDir = file("../node_modules/@react-native/codegen")
2927
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
3028
// cliFile = file("../node_modules/react-native/cli.js")
3129
/* Variants */
@@ -71,14 +69,6 @@ project.ext.sentryCli = [
7169

7270
apply from: "../../../sentry.gradle"
7371

74-
/**
75-
* Set this to true to create four separate APKs instead of one,
76-
* one for each native architecture. This is useful if you don't
77-
* use App Bundles (https://developer.android.com/guide/app-bundle/)
78-
* and want to have separate APKs to upload to the Play Store.
79-
*/
80-
def enableSeparateBuildPerCPUArchitecture = false
81-
8272
/**
8373
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
8474
*/
@@ -97,14 +87,6 @@ def enableProguardInReleaseBuilds = true
9787
*/
9888
def jscFlavor = 'org.webkit:android-jsc:+'
9989

100-
/**
101-
* Architectures to build native code for.
102-
*/
103-
def reactNativeArchitectures() {
104-
def value = project.getProperties().get("reactNativeArchitectures")
105-
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
106-
}
107-
10890
android {
10991
ndkVersion rootProject.ext.ndkVersion
11092

@@ -119,14 +101,6 @@ android {
119101
versionName "1.0"
120102
}
121103

122-
splits {
123-
abi {
124-
reset()
125-
enable enableSeparateBuildPerCPUArchitecture
126-
universalApk false // If true, also generate a universal APK
127-
include (*reactNativeArchitectures())
128-
}
129-
}
130104
signingConfigs {
131105
debug {
132106
storeFile file('debug.keystore')
@@ -147,32 +121,12 @@ android {
147121
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
148122
}
149123
}
150-
151-
// applicationVariants are e.g. debug, release
152-
applicationVariants.all { variant ->
153-
variant.outputs.each { output ->
154-
// For each separate APK per architecture, set a unique version code as described here:
155-
// https://developer.android.com/studio/build/configure-apk-splits.html
156-
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
157-
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
158-
def abi = output.getFilter(OutputFile.ABI)
159-
if (abi != null) { // null for the universal-debug, universal-release variants
160-
output.versionCodeOverride =
161-
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
162-
}
163-
164-
}
165-
}
166-
167-
168124
}
169125

170126
dependencies {
171127
// The version of react-native is set by the React Native Gradle Plugin
172128
implementation("com.facebook.react:react-android")
173129

174-
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
175-
176130
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
177131
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
178132
exclude group:'com.squareup.okhttp3', module:'okhttp'

sample-new-architecture/android/app/src/main/java/com/samplenewarchitecture/MainActivity.java

Lines changed: 1 addition & 4 deletions
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

sample-new-architecture/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ 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")
20-
classpath("io.sentry:sentry-android-gradle-plugin:3.4.2")
20+
classpath("io.sentry:sentry-android-gradle-plugin:3.11.1")
2121
}
2222
}

sample-new-architecture/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.164.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
Lines changed: 2 additions & 1 deletion
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

sample-new-architecture/android/gradlew

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright © 2015-2021 the original authors.
4+
# Copyright © 2015-2021 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -32,10 +32,10 @@
3232
# Busybox and similar reduced shells will NOT work, because this script
3333
# requires all of these POSIX shell features:
3434
# * functions;
35-
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36-
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37-
# * compound commands having a testable exit status, especially «case»;
38-
# * various built-in commands including «command», «set», and «ulimit».
35+
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36+
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37+
# * compound commands having a testable exit status, especially «case»;
38+
# * various built-in commands including «command», «set», and «ulimit».
3939
#
4040
# Important for patching:
4141
#
@@ -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.

sample-new-architecture/android/gradlew.bat

Lines changed: 9 additions & 6 deletions
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 execute
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.
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
7576

7677
:end
7778
@rem End local scope for the variables with windows NT shell
78-
if "%ERRORLEVEL%"=="0" goto mainEnd
79+
if %ERRORLEVEL% equ 0 goto mainEnd
7980

8081
:fail
8182
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
8283
rem the _cmd.exe /c_ return code!
83-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84-
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%
8588

8689
:mainEnd
8790
if "%OS%"=="Windows_NT" endlocal
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
rootProject.name = 'sampleNewArchitecture'
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')

sample-new-architecture/ios/Podfile

Lines changed: 8 additions & 4 deletions
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!
@@ -55,10 +59,10 @@ target 'sampleNewArchitecture' do
5559
end
5660

5761
post_install do |installer|
62+
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
5863
react_native_post_install(
5964
installer,
60-
# Set `mac_catalyst_enabled` to `true` in order to apply patches
61-
# necessary for Mac Catalyst builds
65+
config[:reactNativePath],
6266
:mac_catalyst_enabled => false
6367
)
6468
__apply_Xcode_12_5_M1_post_install_workaround(installer)

sample-new-architecture/ios/sampleNewArchitecture.xcodeproj/project.pbxproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,11 +615,16 @@
615615
);
616616
MTL_ENABLE_DEBUG_INFO = YES;
617617
ONLY_ACTIVE_ARCH = YES;
618+
OTHER_CFLAGS = (
619+
"$(inherited)",
620+
"-DRN_FABRIC_ENABLED",
621+
);
618622
OTHER_CPLUSPLUSFLAGS = (
619623
"$(OTHER_CFLAGS)",
620624
"-DFOLLY_NO_CONFIG",
621625
"-DFOLLY_MOBILE=1",
622626
"-DFOLLY_USE_LIBCPP=1",
627+
"-DRN_FABRIC_ENABLED",
623628
);
624629
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
625630
SDKROOT = iphoneos;
@@ -680,11 +685,16 @@
680685
"\"$(inherited)\"",
681686
);
682687
MTL_ENABLE_DEBUG_INFO = NO;
688+
OTHER_CFLAGS = (
689+
"$(inherited)",
690+
"-DRN_FABRIC_ENABLED",
691+
);
683692
OTHER_CPLUSPLUSFLAGS = (
684693
"$(OTHER_CFLAGS)",
685694
"-DFOLLY_NO_CONFIG",
686695
"-DFOLLY_MOBILE=1",
687696
"-DFOLLY_USE_LIBCPP=1",
697+
"-DRN_FABRIC_ENABLED",
688698
);
689699
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
690700
SDKROOT = iphoneos;

0 commit comments

Comments
 (0)