Skip to content

Commit 11f67eb

Browse files
chore(rn-sample): Upgrade to React Native 0.79.2 (#4806)
* chore(rn-sample): Upgrade to React Native 0.79.2 * downgrade rn to 0.78.2 to fix types issue * fix clang format * revert RN bump in core package * patch react native webview to work with rn 0.79 * add missing plugin file * avoid install failure on post install failure * fix ios * fix patch * fix patch 2 * remove patch, disable webview --------- Co-authored-by: Antonis Lilis <[email protected]>
1 parent 7f6695a commit 11f67eb

File tree

15 files changed

+2471
-1337
lines changed

15 files changed

+2471
-1337
lines changed

packages/core/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
},
7676
"devDependencies": {
7777
"@babel/core": "^7.25.2",
78-
"@expo/metro-config": "0.19.5",
78+
"@expo/metro-config": "~0.20.0",
7979
"@mswjs/interceptors": "^0.25.15",
8080
"@react-native/babel-preset": "0.77.1",
8181
"@sentry-internal/eslint-config-sdk": "8.54.0",
@@ -98,7 +98,7 @@
9898
"eslint": "^7.6.0",
9999
"eslint-plugin-react": "^7.20.6",
100100
"eslint-plugin-react-native": "^3.8.1",
101-
"expo": "^52.0.0",
101+
"expo": "^53.0.0",
102102
"expo-module-scripts": "3.1.0",
103103
"jest": "^29.6.2",
104104
"jest-environment-jsdom": "^29.6.2",

samples/react-native/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ local.properties
3333
.cxx/
3434
*.keystore
3535
!debug.keystore
36+
.kotlin/
3637

3738
# node.js
3839
#

samples/react-native/Gemfile

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
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 "3.3.0"
4+
# ruby "3.4.0"
55

66
gem 'cocoapods', '1.15.2'
77
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
88
gem 'fastlane', '2.220.0'
99
gem 'xcodeproj', '< 1.26.0'
10+
11+
# Ruby 3.4.0 has removed some libraries from the standard library.
12+
gem 'bigdecimal'
13+
gem 'logger'
14+
gem 'benchmark'
15+
gem 'mutex_m'

samples/react-native/Gemfile.lock

+9-5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ GEM
3535
aws-eventstream (~> 1, >= 1.0.2)
3636
babosa (1.0.4)
3737
base64 (0.2.0)
38+
benchmark (0.4.0)
39+
bigdecimal (3.1.9)
3840
claide (1.1.0)
3941
cocoapods (1.15.2)
4042
addressable (~> 2.8)
@@ -158,8 +160,7 @@ GEM
158160
xcodeproj (>= 1.13.0, < 2.0.0)
159161
xcpretty (~> 0.3.0)
160162
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
161-
ffi (1.17.0-arm64-darwin)
162-
ffi (1.17.0-x86_64-darwin)
163+
ffi (1.17.0)
163164
fourflusher (2.3.1)
164165
fuzzy_match (2.0.4)
165166
gh_inspector (1.1.3)
@@ -209,12 +210,14 @@ GEM
209210
json (2.7.3)
210211
jwt (2.9.3)
211212
base64
213+
logger (1.7.0)
212214
mini_magick (4.13.2)
213215
mini_mime (1.1.5)
214216
minitest (5.25.1)
215217
molinillo (0.8.0)
216218
multi_json (1.15.0)
217219
multipart-post (2.4.1)
220+
mutex_m (0.3.0)
218221
nanaimo (0.3.0)
219222
nap (1.1.0)
220223
naturally (2.2.1)
@@ -279,12 +282,13 @@ PLATFORMS
279282

280283
DEPENDENCIES
281284
activesupport (>= 6.1.7.5, < 7.1.0)
285+
benchmark
286+
bigdecimal
282287
cocoapods (= 1.15.2)
283288
fastlane (= 2.220.0)
289+
logger
290+
mutex_m
284291
xcodeproj (< 1.26.0)
285292

286-
RUBY VERSION
287-
ruby 3.3.0p0
288-
289293
BUNDLED WITH
290294
2.4.20

samples/react-native/android/app/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ def enableProguardInReleaseBuilds = true
116116
* The preferred build flavor of JavaScriptCore.
117117
*
118118
* For example, to use the international variant, you can use:
119-
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
119+
* `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
120120
*
121121
* The international variant includes ICU i18n library and necessary data
122122
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
123-
* give correct results when using with locales other than en-US. Note that
123+
* give correct results when using with locales other than en-US. Note that
124124
* this variant is about 6MiB larger per architecture than default.
125125
*/
126-
def jscFlavor = 'org.webkit:android-jsc:+'
126+
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
127127

128128
android {
129129
ndkVersion rootProject.ext.ndkVersion

samples/react-native/android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
buildToolsVersion = "35.0.0"
55
minSdkVersion = 24
66
compileSdkVersion = 35
7-
targetSdkVersion = 34
7+
targetSdkVersion = 35
88
ndkVersion = "27.1.12297006"
99
kotlinVersion = "2.0.21"
1010
}
Binary file not shown.

samples/react-native/android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

samples/react-native/android/gradlew

+56-55
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -69,26 +71,25 @@ app_path=$0
6971

7072
# Need this for daisy-chained symlinks.
7173
while
72-
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
73-
[ -h "$app_path" ]
74+
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
75+
[ -h "$app_path" ]
7476
do
75-
ls=$( ls -ld "$app_path" )
76-
link=${ls#*' -> '}
77-
case $link in #(
78-
/*) app_path=$link ;; #(
79-
*) app_path=$APP_HOME$link ;;
80-
esac
77+
ls=$( ls -ld "$app_path" )
78+
link=${ls#*' -> '}
79+
case $link in #(
80+
/*) app_path=$link ;; #(
81+
*) app_path=$APP_HOME$link ;;
82+
esac
8183
done
8284

8385
# This is normally unused
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
88-
' "$PWD" ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
8990

9091
# Use the maximum available, or set MAX_FD != -1 to use that value.
91-
MAX_FD=maximum
92+
MAX_FD=maximum
9293

9394
warn () {
9495
echo "$*"
@@ -107,58 +108,58 @@ msys=false
107108
darwin=false
108109
nonstop=false
109110
case "$( uname )" in #(
110-
CYGWIN* ) cygwin=true ;; #(
111-
Darwin* ) darwin=true ;; #(
112-
MSYS* | MINGW* ) msys=true ;; #(
113-
NONSTOP* ) nonstop=true ;;
111+
CYGWIN* ) cygwin=true ;; #(
112+
Darwin* ) darwin=true ;; #(
113+
MSYS* | MINGW* ) msys=true ;; #(
114+
NONSTOP* ) nonstop=true ;;
114115
esac
115116

116-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117118

118119

119120
# Determine the Java command to use to start the JVM.
120121
if [ -n "$JAVA_HOME" ] ; then
121-
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
122-
# IBM's JDK on AIX uses strange locations for the executables
122+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
123+
# IBM's JDK on AIX uses strange locations for the executables
123124
JAVACMD=$JAVA_HOME/jre/sh/java
124-
else
125-
JAVACMD=$JAVA_HOME/bin/java
126-
fi
127-
if [ ! -x "$JAVACMD" ] ; then
125+
else
126+
JAVACMD=$JAVA_HOME/bin/java
127+
fi
128+
if [ ! -x "$JAVACMD" ] ; then
128129
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
129130
130131
Please set the JAVA_HOME variable in your environment to match the
131-
location of your Java installation."
132-
fi
132+
location of your Java installation."
133+
fi
133134
else
134-
JAVACMD=java
135-
if ! command -v java >/dev/null 2>&1
136-
then
135+
JAVACMD=java
136+
if ! command -v java >/dev/null 2>&1
137+
then
137138
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
138139
139140
Please set the JAVA_HOME variable in your environment to match the
140-
location of your Java installation."
141+
location of your Java installation."
142+
fi
141143
fi
142-
fi
143144

144145
# Increase the maximum file descriptors if we can.
145146
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
146-
case $MAX_FD in #(
147-
max*)
148-
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
149-
# shellcheck disable=SC2039,SC3045
150-
MAX_FD=$( ulimit -H -n ) ||
151-
warn "Could not query maximum file descriptor limit"
152-
esac
153-
case $MAX_FD in #(
154-
'' | soft) :;; #(
155-
*)
156-
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
157-
# shellcheck disable=SC2039,SC3045
158-
ulimit -n "$MAX_FD" ||
159-
warn "Could not set maximum file descriptor limit to $MAX_FD"
160-
esac
161-
fi
147+
case $MAX_FD in #(
148+
max*)
149+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
150+
# shellcheck disable=SC2039,SC3045
151+
MAX_FD=$( ulimit -H -n ) ||
152+
warn "Could not query maximum file descriptor limit"
153+
esac
154+
case $MAX_FD in #(
155+
'' | soft) :;; #(
156+
*)
157+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
158+
# shellcheck disable=SC2039,SC3045
159+
ulimit -n "$MAX_FD" ||
160+
warn "Could not set maximum file descriptor limit to $MAX_FD"
161+
esac
162+
fi
162163

163164
# Collect all arguments for the java command, stacking in reverse order:
164165
# * args from the command line
@@ -170,17 +171,17 @@ esac
170171

171172
# For Cygwin or MSYS, switch paths to Windows format before running java
172173
if "$cygwin" || "$msys" ; then
173-
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
174-
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
174+
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
175+
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
175176

176-
JAVACMD=$( cygpath --unix "$JAVACMD" )
177+
JAVACMD=$( cygpath --unix "$JAVACMD" )
177178

178-
# Now convert the arguments - kludge to limit ourselves to /bin/sh
179-
for arg do
180-
if
181-
case $arg in #(
182-
-*) false ;; # don't mess with options #(
183-
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
179+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
180+
for arg do
181+
if
182+
case $arg in #(
183+
-*) false ;; # don't mess with options #(
184+
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
184185
[ -e "$t" ] ;; #(
185186
*) false ;;
186187
esac
@@ -204,7 +205,7 @@ fi
204205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
205206

206207
# Collect all arguments for the java command:
207-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208209
# and any embedded shellness will be escaped.
209210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
210211
# treated as '${Hostname}' itself on the command line.

samples/react-native/ios/sentryreactnativesample.xcodeproj/project.pbxproj

+11-9
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
);
280280
runOnlyForDeploymentPostprocessing = 0;
281281
shellPath = /bin/sh;
282-
shellScript = "set -e\n\nLOCAL_NODE_BINARY=${NODE_BINARY:-node}\n\nWITH_ENVIRONMENT=`$LOCAL_NODE_BINARY --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/xcode/with-environment.sh'\"`\nREACT_NATIVE_XCODE=`\"$LOCAL_NODE_BINARY\" --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\"`\nSENTRY_XCODE=`\"$LOCAL_NODE_BINARY\" --print \"require('path').dirname(require.resolve('@sentry/react-native/package.json')) + '/scripts/sentry-xcode.sh'\"`\nBUNDLE_REACT_NATIVE=\"/bin/sh $SENTRY_XCODE $REACT_NATIVE_XCODE\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT '$BUNDLE_REACT_NATIVE'\"\n";
282+
shellScript = "set -e\n\n# REACT_NATIVE_PATH first used in RN 0.74.0 Template https://github.com/facebook/react-native/commit/289e78388a87408e215a25108cb02511a05f5c80\nLOCAL_REACT_NATIVE_PATH=\"${REACT_NATIVE_PATH:-\"../node_modules/react-native\"}\"\nWITH_ENVIRONMENT=\"${LOCAL_REACT_NATIVE_PATH}/scripts/xcode/with-environment.sh\"\n\nif [ -f \"$WITH_ENVIRONMENT\" ]; then\n # load envs if loader file exists (since rn 0.68)\n . \"$WITH_ENVIRONMENT\"\nfi\n\nLOCAL_NODE_BINARY=${NODE_BINARY:-node}\nREACT_NATIVE_XCODE=`\"$LOCAL_NODE_BINARY\" --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\"`\nSENTRY_XCODE=`\"$LOCAL_NODE_BINARY\" --print \"require('path').dirname(require.resolve('@sentry/react-native/package.json')) + '/scripts/sentry-xcode.sh'\"`\nBUNDLE_REACT_NATIVE=\"/bin/sh $SENTRY_XCODE $REACT_NATIVE_XCODE\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT '$BUNDLE_REACT_NATIVE'\"\n";
283283
};
284284
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
285285
isa = PBXShellScriptBuildPhase;
@@ -566,7 +566,8 @@
566566
isa = XCBuildConfiguration;
567567
buildSettings = {
568568
ALWAYS_SEARCH_USER_PATHS = NO;
569-
CC = "";
569+
CC = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang.sh";
570+
CCACHE_BINARY = /opt/homebrew/bin/ccache;
570571
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
571572
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
572573
CLANG_CXX_LIBRARY = "libc++";
@@ -594,7 +595,7 @@
594595
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
595596
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
596597
COPY_PHASE_STRIP = NO;
597-
CXX = "";
598+
CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
598599
ENABLE_STRICT_OBJC_MSGSEND = YES;
599600
ENABLE_TESTABILITY = YES;
600601
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
@@ -625,8 +626,8 @@
625626
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
626627
);
627628
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
628-
LD = "";
629-
LDPLUSPLUS = "";
629+
LD = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang.sh";
630+
LDPLUSPLUS = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
630631
LD_RUNPATH_SEARCH_PATHS = (
631632
/usr/lib/swift,
632633
"$(inherited)",
@@ -662,7 +663,8 @@
662663
isa = XCBuildConfiguration;
663664
buildSettings = {
664665
ALWAYS_SEARCH_USER_PATHS = NO;
665-
CC = "";
666+
CC = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang.sh";
667+
CCACHE_BINARY = /opt/homebrew/bin/ccache;
666668
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
667669
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
668670
CLANG_CXX_LIBRARY = "libc++";
@@ -690,7 +692,7 @@
690692
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
691693
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
692694
COPY_PHASE_STRIP = YES;
693-
CXX = "";
695+
CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
694696
ENABLE_NS_ASSERTIONS = NO;
695697
ENABLE_STRICT_OBJC_MSGSEND = YES;
696698
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
@@ -714,8 +716,8 @@
714716
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
715717
);
716718
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
717-
LD = "";
718-
LDPLUSPLUS = "";
719+
LD = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang.sh";
720+
LDPLUSPLUS = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
719721
LD_RUNPATH_SEARCH_PATHS = (
720722
/usr/lib/swift,
721723
"$(inherited)",
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
#import <RCTAppDelegate.h>
1+
#import <RCTDefaultReactNativeFactoryDelegate.h>
2+
#import <RCTReactNativeFactory.h>
23
#import <UIKit/UIKit.h>
34

4-
@interface AppDelegate : RCTAppDelegate
5+
@interface AppDelegate : RCTDefaultReactNativeFactoryDelegate <UIApplicationDelegate>
6+
7+
@property (nonatomic, strong, nonnull) UIWindow *window;
8+
@property (nonatomic, strong, nonnull) RCTReactNativeFactory *reactNativeFactory;
59

610
@end

0 commit comments

Comments
 (0)