Skip to content

Commit 9063607

Browse files
authored
Merge branch 'main' into feat/playground-open-url-expo
2 parents c4514ee + ad68d6c commit 9063607

17 files changed

Lines changed: 974 additions & 391 deletions

File tree

.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: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
name: Size Analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'packages/**'
9+
- 'samples/react-native/**'
10+
- '.github/workflows/size-analysis.yml'
11+
pull_request:
12+
paths:
13+
- 'packages/**'
14+
- 'samples/react-native/**'
15+
- '.github/workflows/size-analysis.yml'
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
19+
cancel-in-progress: true
20+
21+
env:
22+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
23+
SENTRY_ORG: sentry-sdks
24+
SENTRY_PROJECT: sentry-react-native
25+
REACT_NATIVE_SAMPLE_PATH: samples/react-native
26+
RN_SENTRY_POD_NAME: RNSentry
27+
28+
jobs:
29+
android:
30+
name: Android Size Analysis
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 30
33+
34+
steps:
35+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
36+
37+
- name: Enable Corepack (NPM)
38+
run: npm i -g corepack
39+
40+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
41+
with:
42+
package-manager-cache: false
43+
node-version: 18
44+
cache: 'yarn'
45+
cache-dependency-path: yarn.lock
46+
47+
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
48+
with:
49+
java-version: '17'
50+
distribution: 'adopt'
51+
52+
- name: Gradle cache
53+
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3.5.0
54+
55+
- name: Install SDK Dependencies
56+
run: yarn install
57+
58+
- name: Build SDK
59+
run: yarn build
60+
61+
- name: Build Android App Bundle (Release)
62+
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/android
63+
env:
64+
SENTRY_DISABLE_AUTO_UPLOAD: 'true'
65+
RN_ARCHITECTURE: 'new'
66+
run: |
67+
perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
68+
./gradlew :app:bundleRelease -PreactNativeArchitectures=arm64-v8a
69+
70+
- name: Install Sentry CLI
71+
if: env.SENTRY_AUTH_TOKEN != ''
72+
run: curl -sL https://sentry.io/get-cli/ | sh
73+
74+
- name: Upload Android Bundle to Sentry Size Analysis
75+
if: env.SENTRY_AUTH_TOKEN != ''
76+
run: |
77+
sentry-cli build upload \
78+
"${{ env.REACT_NATIVE_SAMPLE_PATH }}/android/app/build/outputs/bundle/release/app-release.aab" \
79+
--org "${{ env.SENTRY_ORG }}" \
80+
--project "${{ env.SENTRY_PROJECT }}" \
81+
--build-configuration "Release"
82+
83+
ios:
84+
name: iOS Size Analysis
85+
runs-on: ["ghcr.io/cirruslabs/macos-tahoe-xcode:26.2.0", "runner_group_id:10"]
86+
timeout-minutes: 45
87+
88+
steps:
89+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
90+
91+
- name: Enable Corepack
92+
run: corepack enable
93+
94+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
95+
with:
96+
package-manager-cache: false
97+
node-version: 18
98+
cache: 'yarn'
99+
cache-dependency-path: yarn.lock
100+
101+
- uses: ruby/setup-ruby@v1
102+
with:
103+
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
104+
ruby-version: '3.3.0'
105+
bundler-cache: true
106+
cache-version: 1
107+
108+
- name: Setup Global Xcode Tools
109+
run: which xcbeautify || brew install xcbeautify
110+
111+
- name: Install SDK Dependencies
112+
run: yarn install
113+
114+
- name: Build SDK
115+
run: yarn build
116+
117+
- name: Install App Pods
118+
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
119+
run: |
120+
export ENABLE_PROD=1
121+
export ENABLE_NEW_ARCH=1
122+
./scripts/pod-install.sh
123+
124+
- name: Build iOS XCArchive
125+
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios
126+
env:
127+
SENTRY_DISABLE_AUTO_UPLOAD: 'true'
128+
# Fix for Xcode 26+ with MetalToolchain
129+
TOOLCHAINS: com.apple.dt.toolchain.XcodeDefault
130+
run: |
131+
mkdir -p "DerivedData"
132+
derivedData="$(cd "DerivedData" ; pwd -P)"
133+
set -o pipefail && xcodebuild \
134+
-workspace sentryreactnativesample.xcworkspace \
135+
-configuration Release \
136+
-scheme sentryreactnativesample \
137+
-sdk iphoneos \
138+
-destination 'generic/platform=iOS' \
139+
-archivePath "$derivedData/sentryreactnativesample.xcarchive" \
140+
ONLY_ACTIVE_ARCH=NO \
141+
CODE_SIGNING_ALLOWED=NO \
142+
archive \
143+
| tee xcodebuild-size-analysis.log \
144+
| xcbeautify --quieter --is-ci --disable-colored-output
145+
146+
- name: Install Sentry CLI
147+
if: env.SENTRY_AUTH_TOKEN != ''
148+
run: curl -sL https://sentry.io/get-cli/ | sh
149+
150+
- name: Upload iOS XCArchive to Sentry Size Analysis
151+
if: env.SENTRY_AUTH_TOKEN != ''
152+
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios
153+
run: |
154+
sentry-cli build upload \
155+
"DerivedData/sentryreactnativesample.xcarchive" \
156+
--org "${{ env.SENTRY_ORG }}" \
157+
--project "${{ env.SENTRY_PROJECT }}" \
158+
--build-configuration "Release"
159+
160+
- name: Upload logs
161+
if: ${{ always() }}
162+
uses: actions/upload-artifact@v7
163+
with:
164+
name: size-analysis-ios-logs
165+
path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios/xcodebuild-size-analysis.log
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
}

0 commit comments

Comments
 (0)