Skip to content

Commit ad68d6c

Browse files
antonisclaude
andauthored
chore(core): Bump sample app to React Native 0.84.1 (#5941)
* chore(core): Bump sample app to React Native 0.84.1 React Native 0.84.1 ships Hermes V1 as the default JS engine. Changes: - react-native 0.80.2 -> 0.84.1, react 19.1.0 -> 19.2.3 - Android SDK 35 -> 36, Gradle 8.14.1 -> 9.0.0 - Simplified MainApplication.kt to use new getDefaultReactHost(context, packageList) pattern replacing the legacy DefaultReactNativeHost/ReactNativeHost boilerplate - Updated @react-native/* and @react-native-community/cli devDependencies Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(core): Patch react-native-build-config for Gradle 9 compatibility Gradle 9 removed jcenter() and deprecated lintOptions. Apply yarn patch to remove the obsolete buildscript block and replace lintOptions with lint. Also includes Xcode project changes from RN 0.84 (RCT_REMOVE_LEGACY_ARCH flag). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(core): Patch react-native-launch-arguments for Gradle 9 compatibility Gradle 9 removed the `destinationDir` property from JavaCompile tasks. Use `destinationDirectory` instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore(core): Bump react-native-reanimated to 4.3.0 for RN 0.84 support Reanimated 3.x uses legacy arch APIs (LayoutAnimationController, UIManagerModuleListener) that were removed in RN 0.84. Reanimated 4.x supports RN 0.81-0.85. Also adds react-native-worklets 0.8.1 as required peer dependency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(core): Replace deprecated rncore.h with FBReactNativeSpec.h rncore.h is deprecated in RN 0.84 and triggers -Werror. Replace with FBReactNativeSpec.h and FBReactNativeSpec_ModuleProvider. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Lint issue * fix(ci): Bump Node to 22 in sample app CI workflows RN 0.84 requires Node >= 22.11. Metro from RN 0.84 uses Array.toReversed() which is not available in Node 18. Bump Node version for the Bundle job in buildandtest.yml and all jobs in sample-application.yml that run Metro bundling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(ios): Fix podspec compiler flags being overridden by install_modules_dependencies `s.compiler_flags` was silently overridden by `install_modules_dependencies()`, so `-DSENTRY_PROFILING_SUPPORTED`, `-DNEW_HERMES_RUNTIME`, and `-DRCT_NEW_ARCH_ENABLED` were never applied. Add flags to `pod_target_xcconfig['OTHER_CFLAGS']` which takes effect correctly. Also set `REACT_NATIVE_NODE_MODULES_DIR` in the sample app's Podfile and pod-install script so the podspec detects the app's RN version instead of the SDK's devDependency version in the monorepo. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * revert: Remove redundant OTHER_CFLAGS from pod_target_xcconfig The compiler flags (SENTRY_PROFILING_SUPPORTED, NEW_HERMES_RUNTIME, etc.) are already applied per-file via s.compiler_flags, which install_modules_dependencies preserves. Adding them to pod_target_xcconfig was redundant. The actual fix for the iOS build was the REACT_NATIVE_NODE_MODULES_DIR env var in the Podfile, which ensures the podspec detects the app's RN version instead of the SDK's devDependency version in the monorepo. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor(core): Remove yarn patches in favor of version bumps and dep removal - Remove react-native-build-config dependency entirely. It was unmaintained (uses jcenter, Gradle 1.3) and only used to read one Android BuildConfig field. Use react-native-launch-arguments for both platforms instead. - Bump react-native-launch-arguments to 4.1.1 which has the Gradle 9 fix (destinationDirectory) built-in. - Remove both yarn patch files and resolutions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(ci): Remove legacy arch from sample app CI matrix RN 0.84 and Reanimated 4 require the New Architecture. Legacy arch builds fail with: "Reanimated requires the New Architecture to be enabled". Also remove dynamic-frameworks variant since it was previously excluded for new arch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(core): Fix tsconfig resolution and Detox R8 error for RN 0.84 - Use bare specifier in tsconfig extends (`@react-native/typescript-config` instead of `@react-native/typescript-config/tsconfig.json`). Node 22 strictly enforces the package's `exports` field, and ts-jest couldn't resolve the direct file path. - Add proguard `-dontwarn` for `NotThreadSafeBridgeIdleDebugListener` which Detox references but was removed in RN 0.84. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(core): Restore react-native-build-config and update Node constraints - Re-add react-native-build-config with yarn patch for Gradle 9 compat. The Android BuildConfig.SENTRY_DISABLE_NATIVE_START is a build-time flag that can't be replaced by runtime launch arguments. - Restore original platform-specific shouldUseAutoStart() logic. - Update engines.node to >=22.11.0 and volta node to 22.22.2 to match RN 0.84 requirements. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 553198a commit ad68d6c

File tree

16 files changed

+809
-391
lines changed

16 files changed

+809
-391
lines changed

.github/workflows/buildandtest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ jobs:
246246
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
247247
with:
248248
package-manager-cache: false
249-
node-version: 18
249+
node-version: 22
250250
cache: 'yarn'
251251
cache-dependency-path: yarn.lock
252252
- name: Install Dependencies

.github/workflows/sample-application.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,9 @@ jobs:
5757
strategy:
5858
fail-fast: false
5959
matrix:
60-
rn-architecture: ['legacy', 'new']
61-
ios-use-frameworks: ['no-frameworks', 'dynamic-frameworks']
60+
rn-architecture: ['new']
61+
ios-use-frameworks: ['no-frameworks']
6262
build-type: ['dev', 'production']
63-
exclude:
64-
- rn-architecture: 'new'
65-
ios-use-frameworks: 'dynamic-frameworks'
6663
steps:
6764
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
6865

@@ -72,7 +69,7 @@ jobs:
7269
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
7370
with:
7471
package-manager-cache: false
75-
node-version: 18
72+
node-version: 22
7673
cache: 'yarn'
7774
cache-dependency-path: yarn.lock
7875

@@ -152,7 +149,7 @@ jobs:
152149
strategy:
153150
fail-fast: false
154151
matrix:
155-
rn-architecture: ['legacy', 'new']
152+
rn-architecture: ['new']
156153
build-type: ['dev', 'production']
157154
steps:
158155
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
@@ -163,7 +160,7 @@ jobs:
163160
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
164161
with:
165162
package-manager-cache: false
166-
node-version: 18
163+
node-version: 22
167164
cache: 'yarn'
168165
cache-dependency-path: yarn.lock
169166

@@ -238,7 +235,7 @@ jobs:
238235
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
239236
with:
240237
package-manager-cache: false
241-
node-version: 18
238+
node-version: 22
242239
cache: 'yarn'
243240
cache-dependency-path: yarn.lock
244241

@@ -325,7 +322,7 @@ jobs:
325322
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
326323
with:
327324
package-manager-cache: false
328-
node-version: 18
325+
node-version: 22
329326
cache: 'yarn'
330327
cache-dependency-path: yarn.lock
331328

@@ -407,7 +404,7 @@ jobs:
407404
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
408405
with:
409406
package-manager-cache: false
410-
node-version: 18
407+
node-version: 22
411408
cache: 'yarn'
412409
cache-dependency-path: yarn.lock
413410

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
diff --git a/android/build.gradle b/android/build.gradle
2+
index 8eb2638fe8f4eddfe5daaa3d54ba39cf4e11e6f8..f7d77d75f57004438998cded63ce694d0753dcf4 100644
3+
--- a/android/build.gradle
4+
+++ b/android/build.gradle
5+
@@ -1,13 +1,3 @@
6+
-buildscript {
7+
- repositories {
8+
- jcenter()
9+
- }
10+
-
11+
- dependencies {
12+
- classpath 'com.android.tools.build:gradle:1.3.0'
13+
- }
14+
-}
15+
-
16+
apply plugin: 'com.android.library'
17+
18+
android {
19+
@@ -19,7 +9,7 @@ android {
20+
versionCode 1
21+
versionName "1.0"
22+
}
23+
- lintOptions {
24+
+ lint {
25+
abortOnError false
26+
}
27+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
"@appium/base-driver@npm:10.2.2/path-to-regexp": "^8.4.0",
117117
"router@npm:2.2.0/path-to-regexp": "^8.4.0",
118118
"yaml": "^2.8.3",
119+
"react-native-build-config@^0.3.2": "patch:react-native-build-config@npm%3A0.3.2#./.yarn/patches/react-native-build-config-npm-0.3.2-0e671629bd.patch",
119120
"minimatch@npm:5.1.9/brace-expansion": "^2.0.3",
120121
"minimatch@npm:8.0.7/brace-expansion": "^2.0.3",
121122
"minimatch@npm:9.0.9/brace-expansion": "^2.0.3",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ android {
190190
signingConfig signingConfigs.debug
191191
minifyEnabled enableProguardInReleaseBuilds
192192
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
193+
testProguardFiles "proguard-rules.pro"
193194
proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro"
194195
}
195196
}

samples/react-native/android/app/proguard-rules.pro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212
# Detox Release tests were failing on missing kotlin.Result
1313
# It should be covered by node_modules/detox/android/detox/proguard-rules-app.pro but it seems missing
1414
-keep class kotlin.** { *; }
15+
16+
# Detox references bridge classes removed in RN 0.84
17+
-dontwarn com.facebook.react.bridge.NotThreadSafeBridgeIdleDebugListener

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

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,23 @@ import android.app.Application
44
import com.facebook.react.PackageList
55
import com.facebook.react.ReactApplication
66
import com.facebook.react.ReactHost
7-
import com.facebook.react.ReactNativeHost
8-
import com.facebook.react.ReactPackage
9-
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
7+
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
108
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11-
import com.facebook.react.defaults.DefaultReactNativeHost
12-
import com.facebook.react.soloader.OpenSourceMergedSoMapping
13-
import com.facebook.soloader.SoLoader
149
import io.sentry.react.RNSentrySDK
1510

1611
class MainApplication :
1712
Application(),
1813
ReactApplication {
19-
override val reactNativeHost: ReactNativeHost =
20-
object : DefaultReactNativeHost(this) {
21-
override fun getPackages(): List<ReactPackage> =
14+
override val reactHost: ReactHost by lazy {
15+
getDefaultReactHost(
16+
context = applicationContext,
17+
packageList =
2218
PackageList(this).packages.apply {
2319
add(SamplePackage())
2420
add(TurboSamplePackage())
25-
}
26-
27-
override fun getJSMainModuleName(): String = "index"
28-
29-
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
30-
31-
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
32-
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
33-
}
34-
35-
override val reactHost: ReactHost
36-
get() = getDefaultReactHost(applicationContext, reactNativeHost)
21+
},
22+
)
23+
}
3724

3825
override fun onCreate() {
3926
super.onCreate()
@@ -46,11 +33,7 @@ class MainApplication :
4633
throw RuntimeException("This was intentional test crash before JS started.")
4734
}
4835

49-
SoLoader.init(this, OpenSourceMergedSoMapping)
50-
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
51-
// If you opted-in for the New Architecture, we load the native entry point for this app.
52-
load()
53-
}
36+
loadReactNative(this)
5437
}
5538

5639
private fun shouldCrashOnStart(): Boolean {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929

3030
#include <DefaultComponentsRegistry.h>
3131
#include <DefaultTurboModuleManagerDelegate.h>
32+
#include <FBReactNativeSpec.h>
3233
#include <NativeSampleModule.h>
3334
#include <autolinking.h>
3435
#include <fbjni/fbjni.h>
3536
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
36-
#include <rncore.h>
3737

3838
#ifdef REACT_NATIVE_APP_CODEGEN_HEADER
3939
# include REACT_NATIVE_APP_CODEGEN_HEADER
@@ -91,7 +91,7 @@ javaModuleProvider(const std::string &name, const JavaTurboModule::InitParams &p
9191
// if (module != nullptr) {
9292
// return module;
9393
// }
94-
// return rncore_ModuleProvider(name, params);
94+
// return FBReactNativeSpec_ModuleProvider(name, params);
9595

9696
// We link app local modules if available
9797
#ifdef REACT_NATIVE_APP_MODULE_PROVIDER
@@ -102,7 +102,7 @@ javaModuleProvider(const std::string &name, const JavaTurboModule::InitParams &p
102102
#endif
103103

104104
// We first try to look up core modules
105-
if (auto module = rncore_ModuleProvider(name, params)) {
105+
if (auto module = FBReactNativeSpec_ModuleProvider(name, params)) {
106106
return module;
107107
}
108108

samples/react-native/android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22
buildscript {
33
ext {
4-
buildToolsVersion = "35.0.0"
4+
buildToolsVersion = "36.0.0"
55
minSdkVersion = 24
6-
compileSdkVersion = 35
7-
targetSdkVersion = 35
6+
compileSdkVersion = 36
7+
targetSdkVersion = 36
88
ndkVersion = "27.1.12297006"
99
kotlinVersion = "2.0.21"
1010
}

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.14.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)