Skip to content

Commit 09f796f

Browse files
authored
Merge 1ca6390 into a615e7e
2 parents a615e7e + 1ca6390 commit 09f796f

File tree

28 files changed

+1389
-212
lines changed

28 files changed

+1389
-212
lines changed

.github/workflows/codegen.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ jobs:
2828
cd samples/react-native/ios
2929
node ../node_modules/react-native/scripts/generate-codegen-artifacts.js \
3030
--path .. \
31-
--outputPath codegen
31+
--outputPath codegen \
32+
--targetPlatform ios
3233
steps:
3334
- uses: actions/checkout@v4
3435
- run: corepack enable

.github/workflows/e2e.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,15 @@ jobs:
164164
strategy:
165165
fail-fast: false # keeps matrix running if one fails
166166
matrix:
167-
rn-version: ['0.65.3', '0.73.9']
167+
rn-version: ['0.65.3', '0.75.4']
168168
rn-architecture: ['legacy', 'new']
169169
platform: ['android', 'ios']
170170
build-type: ['production']
171171
ios-use-frameworks: ['no', 'static', 'dynamic']
172172
engine: ['hermes', 'jsc']
173173
include:
174174
- platform: ios
175-
rn-version: '0.73.9'
175+
rn-version: '0.75.4'
176176
runs-on: macos-14 # uses m1 https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
177177
runtime: 'latest'
178178
device: 'iPhone 14'
@@ -185,7 +185,7 @@ jobs:
185185
runs-on: ubuntu-latest
186186
exclude:
187187
# exclude JSC for new RN versions (keeping the matrix manageable)
188-
- rn-version: '0.73.9'
188+
- rn-version: '0.75.4'
189189
engine: 'jsc'
190190
# exclude all rn versions lower than 0.70.0 for new architecture
191191
- rn-version: '0.65.3'
@@ -304,15 +304,15 @@ jobs:
304304
strategy:
305305
fail-fast: false # keeps matrix running if one fails
306306
matrix:
307-
rn-version: ['0.65.3', '0.73.9']
307+
rn-version: ['0.65.3', '0.75.4']
308308
rn-architecture: ['legacy', 'new']
309309
platform: ['android', 'ios']
310310
build-type: ['production']
311311
ios-use-frameworks: ['no'] # test only no framworks
312312
engine: ['hermes', 'jsc']
313313
include:
314314
- platform: ios
315-
rn-version: '0.73.9'
315+
rn-version: '0.75.4'
316316
runs-on: macos-14 # uses m1 https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
317317
runtime: 'latest'
318318
device: 'iPhone 14'
@@ -330,10 +330,10 @@ jobs:
330330
# e2e test only the default combinations
331331
- rn-version: '0.65.3'
332332
engine: 'hermes'
333-
- rn-version: '0.73.9'
333+
- rn-version: '0.75.4'
334334
engine: 'jsc'
335335
# E2E timeout due to a race condition https://github.com/facebook/react-native/issues/42123#issuecomment-1881203719
336-
- rn-version: '0.73.9'
336+
- rn-version: '0.75.4'
337337
platform: 'ios'
338338
rn-architecture: 'new'
339339
env:

.github/workflows/sample-application.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ jobs:
103103
[[ "${{ matrix.platform }}" == "ios" ]] && cd react-native/ios
104104
[[ "${{ matrix.platform }}" == "macos" ]] && cd react-native-macos/macos
105105
106-
export NO_FLIPPER=1 # Flipper is causing build issues on iOS, so we disable it
107106
[[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0
108107
[[ "${{ matrix.rn-architecture }}" == "new" ]] && ENABLE_NEW_ARCH=1 || ENABLE_NEW_ARCH=0
109108
[[ "${{ matrix.ios-use-frameworks }}" == "dynamic-frameworks" ]] && export USE_FRAMEWORKS=dynamic
@@ -119,6 +118,11 @@ jobs:
119118
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
120119
perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
121120
echo 'New Architecture enabled'
121+
elif [[ ${{ matrix.rn-architecture }} == 'legacy' ]]; then
122+
perl -i -pe's/newArchEnabled=true/newArchEnabled=false/g' gradle.properties
123+
echo 'Legacy Architecture enabled'
124+
else
125+
echo 'No changes for architecture: ${{ matrix.rn-architecture }}'
122126
fi
123127
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
124128
echo "Building $CONFIG"

.github/workflows/testflight.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252

5353
- name: Pod Install
5454
working-directory: samples/react-native/ios
55-
run: NO_FLIPPER=1 PRODUCTION=1 bundle exec pod install
55+
run: PRODUCTION=1 bundle exec pod install
5656

5757
- name: Run Fastlane
5858
working-directory: samples/react-native

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Dependencies
6+
7+
- Upgrade sample and E2E tests to RN 0.75 ([#4155](https://github.com/getsentry/sentry-react-native/pull/4155))
8+
39
## 6.0.0-rc.1
410

511
### Fixes

dev-packages/e2e-tests/cli.mjs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ if (!env.USE_FRAMEWORKS || env.USE_FRAMEWORKS === 'no') {
5050
delete env.USE_FRAMEWORKS;
5151
}
5252

53-
if (platform == 'ios') {
54-
// Flipper is causing build issues on iOS, so we disable it
55-
env.NO_FLIPPER = 1;
56-
}
57-
5853
const e2eDir = path.resolve(__dirname);
5954
const e2eTestPackageName = JSON.parse(fs.readFileSync(`${e2eDir}/package.json`, 'utf8')).name;
6055
const patchScriptsDir = path.resolve(e2eDir, 'patch-scripts');

dev-packages/e2e-tests/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"appium-xcuitest-driver": "5.13.0",
2222
"babel-jest": "^29.7.0",
2323
"jest": "^29.7.0",
24-
"react": "18.2.0",
25-
"react-native": "0.73.9",
24+
"react": "18.3.1",
25+
"react-native": "0.75.4",
2626
"typescript": "4.9.5",
2727
"webdriverio": "^8.27.0"
2828
},

samples/react-native/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ yarn-error.log
5656
*.jsbundle
5757

5858
# Ruby / CocoaPods
59-
/ios/Pods/
59+
**/Pods/
6060
/vendor/bundle/
6161

6262
# Temporary files created by Metro to check the health of the file watcher

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ react {
102102
//
103103
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
104104
// hermesFlags = ["-O", "-output-source-map"]
105+
106+
/* Autolinking */
107+
autolinkLibrariesWithApp()
105108
}
106109

107110
/**
@@ -196,7 +199,6 @@ android {
196199
dependencies {
197200
// The version of react-native is set by the React Native Gradle Plugin
198201
implementation("com.facebook.react:react-android")
199-
implementation("com.facebook.react:flipper-integration")
200202

201203
if (hermesEnabled.toBoolean()) {
202204
implementation("com.facebook.react:hermes-android")
@@ -205,8 +207,6 @@ dependencies {
205207
}
206208
}
207209

208-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
209-
210210
if (newArchEnabled.toBoolean()) {
211211
android {
212212
externalNativeBuild {

samples/react-native/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
android:icon="@mipmap/ic_launcher"
99
android:roundIcon="@mipmap/ic_launcher_round"
1010
android:allowBackup="false"
11-
android:theme="@style/AppTheme">
11+
android:theme="@style/AppTheme"
12+
android:supportsRtl="true">
1213
<activity
1314
android:name=".MainActivity"
1415
android:label="@string/app_name"

samples/react-native/android/app/src/main/java/io/sentry/reactnative/sample/MainApplication.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import com.facebook.react.ReactPackage
99
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
1010
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1111
import com.facebook.react.defaults.DefaultReactNativeHost
12-
import com.facebook.react.flipper.ReactNativeFlipper
1312
import com.facebook.soloader.SoLoader
1413
import io.sentry.Hint
1514
import io.sentry.SentryEvent
@@ -34,7 +33,7 @@ class MainApplication() : Application(), ReactApplication {
3433
}
3534

3635
override val reactHost: ReactHost
37-
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
36+
get() = getDefaultReactHost(applicationContext, reactNativeHost)
3837

3938
override fun onCreate() {
4039
super.onCreate()
@@ -46,7 +45,6 @@ class MainApplication() : Application(), ReactApplication {
4645
// If you opted-in for the New Architecture, we load the native entry point for this app.
4746
load()
4847
}
49-
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
5048
}
5149

5250
private fun initializeSentry() {

samples/react-native/android/app/src/main/jni/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,3 @@ project(appmodules)
2929

3030
# This file includes all the necessary to let you build your application with the New Architecture.
3131
include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)
32-
33-
# App needs to add and link against tm (TurboModules) folder
34-
add_subdirectory(${REACT_ANDROID_DIR}/../../../tm/ tm_build)
35-
target_link_libraries(${CMAKE_PROJECT_NAME} tm)

samples/react-native/android/app/src/main/jni/OnLoad.cpp

Lines changed: 52 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,66 +27,91 @@
2727
// }
2828
// }
2929

30-
#include <AppSpecs.h>
3130
#include <DefaultComponentsRegistry.h>
3231
#include <DefaultTurboModuleManagerDelegate.h>
32+
#include <autolinking.h>
3333
#include <fbjni/fbjni.h>
3434
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
35-
#include <rncli.h>
36-
#include <NativeSampleModule.h>
35+
#include <rncore.h>
3736

38-
namespace facebook {
39-
namespace react {
37+
#ifdef REACT_NATIVE_APP_CODEGEN_HEADER
38+
#include REACT_NATIVE_APP_CODEGEN_HEADER
39+
#endif
40+
#ifdef REACT_NATIVE_APP_COMPONENT_DESCRIPTORS_HEADER
41+
#include REACT_NATIVE_APP_COMPONENT_DESCRIPTORS_HEADER
42+
#endif
43+
44+
namespace facebook::react {
4045

4146
void registerComponents(
42-
std::shared_ptr<ComponentDescriptorProviderRegistry const> registry) {
47+
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
4348
// Custom Fabric Components go here. You can register custom
4449
// components coming from your App or from 3rd party libraries here.
4550
//
4651
// providerRegistry->add(concreteComponentDescriptorProvider<
47-
// AocViewerComponentDescriptor>());
52+
// MyComponentDescriptor>());
53+
54+
// We link app local components if available
55+
#ifdef REACT_NATIVE_APP_COMPONENT_REGISTRATION
56+
REACT_NATIVE_APP_COMPONENT_REGISTRATION(registry);
57+
#endif
4858

49-
// By default we just use the components autolinked by RN CLI
50-
rncli_registerProviders(registry);
59+
// And we fallback to the components autolinked
60+
autolinking_registerProviders(registry);
5161
}
5262

5363
std::shared_ptr<TurboModule> cxxModuleProvider(
54-
const std::string &name,
55-
const std::shared_ptr<CallInvoker> &jsInvoker) {
56-
// Not implemented yet: provide pure-C++ NativeModules here.
57-
if (name == "NativeSampleModule")
58-
{
59-
return std::make_shared<facebook::react::NativeSampleModule>(jsInvoker);
60-
}
61-
return nullptr;
64+
const std::string& name,
65+
const std::shared_ptr<CallInvoker>& jsInvoker) {
66+
// Here you can provide your CXX Turbo Modules coming from
67+
// either your application or from external libraries. The approach to follow
68+
// is similar to the following (for a module called `NativeCxxModuleExample`):
69+
//
70+
// if (name == NativeCxxModuleExample::kModuleName) {
71+
// return std::make_shared<NativeCxxModuleExample>(jsInvoker);
72+
// }
73+
74+
// And we fallback to the CXX module providers autolinked
75+
return autolinking_cxxModuleProvider(name, jsInvoker);
6276
}
6377

6478
std::shared_ptr<TurboModule> javaModuleProvider(
65-
const std::string &name,
66-
const JavaTurboModule::InitParams &params) {
79+
const std::string& name,
80+
const JavaTurboModule::InitParams& params) {
6781
// Here you can provide your own module provider for TurboModules coming from
6882
// either your application or from external libraries. The approach to follow
6983
// is similar to the following (for a library called `samplelibrary`):
7084
//
71-
// auto module = samplelibrary_ModuleProvider(moduleName, params);
85+
// auto module = samplelibrary_ModuleProvider(name, params);
7286
// if (module != nullptr) {
7387
// return module;
7488
// }
75-
// return rncore_ModuleProvider(moduleName, params);
89+
// return rncore_ModuleProvider(name, params);
7690

77-
auto module = AppSpecs_ModuleProvider(name, params);
91+
// We link app local modules if available
92+
#ifdef REACT_NATIVE_APP_MODULE_PROVIDER
93+
auto module = REACT_NATIVE_APP_MODULE_PROVIDER(name, params);
7894
if (module != nullptr) {
7995
return module;
8096
}
97+
#endif
8198

82-
// By default we just use the module providers autolinked by RN CLI
83-
return rncli_ModuleProvider(name, params);
99+
// We first try to look up core modules
100+
if (auto module = rncore_ModuleProvider(name, params)) {
101+
return module;
102+
}
103+
104+
// And we fallback to the module providers autolinked
105+
if (auto module = autolinking_ModuleProvider(name, params)) {
106+
return module;
107+
}
108+
109+
return nullptr;
84110
}
85111

86-
} // namespace react
87-
} // namespace facebook
112+
} // namespace facebook::react
88113

89-
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
114+
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
90115
return facebook::jni::initialize(vm, [] {
91116
facebook::react::DefaultTurboModuleManagerDelegate::cxxModuleProvider =
92117
&facebook::react::cxxModuleProvider;
@@ -97,10 +122,3 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
97122
&facebook::react::registerComponents;
98123
});
99124
}
100-
101-
extern "C"
102-
JNIEXPORT void JNICALL
103-
Java_io_sentry_reactnative_sample_SamplePackage_crash(JNIEnv *env, jobject thiz) {
104-
char *ptr = 0;
105-
*ptr += 1;
106-
}

samples/react-native/android/app/src/release/java/io/sentry/reactnative/sample/ReactNativeFlipper.java

Lines changed: 0 additions & 18 deletions
This file was deleted.

samples/react-native/android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
buildscript {
33
ext {
44
buildToolsVersion = "34.0.0"
5-
minSdkVersion = 21
5+
minSdkVersion = 23
66
compileSdkVersion = 34
77
targetSdkVersion = 34
8-
ndkVersion = "25.1.8937393"
9-
kotlinVersion = "1.8.0"
8+
ndkVersion = "26.1.10909125"
9+
kotlinVersion = "1.9.24"
1010
}
1111
repositories {
1212
google()

samples/react-native/android/gradle.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ org.gradle.logging.level=lifecycle
2222
# Android operating system, and which are packaged with your app's APK
2323
# https://developer.android.com/topic/libraries/support-library/androidx-rn
2424
android.useAndroidX=true
25-
# Automatically convert third-party libraries to use AndroidX
26-
android.enableJetifier=true
2725

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

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

Lines changed: 1 addition & 1 deletion
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.3-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)