Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 23 additions & 32 deletions .github/workflows/e2e-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
auth_token_check:
uses: ./.github/workflows/skip-ci-noauth.yml
secrets: inherit

metrics:
runs-on: ${{ matrix.runs-on }}
needs: [diff_check, auth_token_check]
Expand All @@ -39,7 +38,7 @@ jobs:
platform: ["ios", "android"]
include:
- platform: ios
runs-on: macos-13
runs-on: macos-14
name: iOS
appPlain: performance-tests/test-app-plain.ipa
- platform: android
Expand All @@ -53,7 +52,7 @@ jobs:
- uses: ./.github/actions/disk-cleanup
if: ${{ matrix.platform == 'android' }}

- run: sudo xcode-select -s /Applications/Xcode_14.2.app/Contents/Developer
- run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
if: ${{ matrix.platform == 'ios' }}

- run: npm i -g corepack
Expand All @@ -67,13 +66,17 @@ jobs:
- uses: actions/setup-java@v5
with:
java-version: '17'
distribution: "adopt"
distribution: 'adopt'

- name: Gradle cache
uses: gradle/gradle-build-action@v3

- name: Install Global Dependencies
run: npm i -g react-native-cli @sentry/cli

- name: Install Dependencies
run: yarn install

- name: Build SDK
run: yarn build

Expand All @@ -87,6 +90,7 @@ jobs:
# we removed the lock file of the app due to monorepo changes, we use the package.json instead
# to avoid frequent rebuilds of the app
key: ${{ github.workflow }}-${{ github.job }}-appplain-${{ matrix.platform }}-${{ matrix.rn-architecture }}-${{ hashFiles('performance-tests/TestAppSentry/package.json') }}

- name: Build app plain
if: steps.app-plain-cache.outputs['cache-hit'] != 'true'
working-directory: ./performance-tests/TestAppPlain
Expand Down Expand Up @@ -114,6 +118,7 @@ jobs:
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}

- name: Build app with Sentry
working-directory: ./performance-tests/TestAppSentry
run: |
Expand Down Expand Up @@ -142,7 +147,7 @@ jobs:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
- name: Collect apps metrics
uses: getsentry/action-app-sdk-overhead-metrics@c9eca50e02d180ee07a02952c062b2f3f545f735
uses: getsentry/action-app-sdk-overhead-metrics@5f2d99b8e5a7b833386524924d24320501099a44
with:
name: ${{ matrix.name }} (${{ matrix.rn-architecture }})
config: ./performance-tests/metrics-${{ matrix.platform }}.yml
Expand All @@ -164,7 +169,7 @@ jobs:
strategy:
fail-fast: false # keeps matrix running if one fails
matrix:
rn-version: ['0.65.3', '0.81.0']
rn-version: ['0.71.11', '0.81.0']
rn-architecture: ['legacy', 'new']
platform: ['android', 'ios']
build-type: ['production']
Expand All @@ -176,7 +181,7 @@ jobs:
xcode-version: '16.2'
runs-on: macos-14
- platform: ios
rn-version: '0.65.3'
rn-version: '0.71.11'
xcode-version: '14.2'
runs-on: macos-13
- platform: android
Expand All @@ -185,14 +190,14 @@ jobs:
# exclude JSC for new RN versions (keeping the matrix manageable)
- rn-version: '0.81.0'
engine: 'jsc'
# exclude all rn versions lower than 0.70.0 for new architecture
- rn-version: '0.65.3'
# exclude all rn versions lower than 0.80.0 for new architecture
- rn-version: '0.71.11'
rn-architecture: 'new'
# exlude old rn version for use frameworks builds (to minimalize the matrix)
- rn-version: '0.65.3'
- rn-version: '0.71.11'
platform: 'ios'
ios-use-frameworks: 'static'
- rn-version: '0.65.3'
- rn-version: '0.71.11'
platform: 'ios'
ios-use-frameworks: 'dynamic'
# use frameworks is ios only feature
Expand Down Expand Up @@ -238,7 +243,7 @@ jobs:

- uses: actions/setup-java@v5
with:
java-version: ${{ matrix.rn-version == '0.65.3' && '11' || '17' }}
java-version: '17'
distribution: 'adopt'

- name: Gradle cache
Expand All @@ -258,15 +263,6 @@ jobs:
- name: Setup Plain RN ${{ matrix.rn-version }} App
run: ./dev-packages/e2e-tests/cli.mjs ${{ matrix.platform }} --create

# The old node has to be enabled after creating the test app
# to avoid issues with the old node version
- run: corepack disable
- uses: actions/setup-node@v6
if: ${{ matrix.rn-version == '0.65.3' }}
with:
package-manager-cache: false
node-version: 16

- uses: ruby/setup-ruby@v1
if: ${{ matrix.platform == 'ios' }}
with:
Expand Down Expand Up @@ -304,30 +300,25 @@ jobs:
strategy:
fail-fast: false # keeps matrix running if one fails
matrix:
rn-version: ['0.65.3', '0.81.0']
rn-version: ['0.71.11', '0.81.0']
rn-architecture: ['legacy', 'new']
platform: ['android', 'ios']
build-type: ['production']
ios-use-frameworks: ['no'] # test only no framworks
engine: ['hermes', 'jsc']
ios-use-frameworks: ['no'] # test only no frameworks
engine: ['hermes']
include:
- platform: ios
rn-version: '0.81.0'
runs-on: macos-14
- platform: ios
rn-version: '0.65.3'
rn-version: '0.71.11'
runs-on: macos-14
- platform: android
runs-on: ubuntu-latest
exclude:
# exclude all rn versions lower than 0.70.0 for new architecture
- rn-version: '0.65.3'
# exclude all rn versions lower than 0.80.0 for new architecture
- rn-version: '0.71.11'
rn-architecture: 'new'
# e2e test only the default combinations
- rn-version: '0.65.3'
engine: 'hermes'
- rn-version: '0.81.0'
engine: 'jsc'

steps:
- uses: actions/checkout@v5
Expand Down
34 changes: 27 additions & 7 deletions dev-packages/e2e-tests/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const appSourceRepo = 'https://github.com/react-native-community/rn-diff-purge.g
const appRepoDir = `${e2eDir}/react-native-versions/${RNVersion}`;
const appName = 'RnDiffApp';
const appDir = `${appRepoDir}/${appName}`;
const testAppName = `${appName}.${platform == 'ios' ? 'app' : 'apk'}`;
const testAppName = `${appName}.${platform === 'ios' ? 'app' : 'apk'}`;
const testApp = `${e2eDir}/${testAppName}`;
const appId = platform === 'ios' ? 'org.reactjs.native.example.RnDiffApp' : 'com.rndiffapp';
const sentryAuthToken = env.SENTRY_AUTH_TOKEN;
Expand All @@ -84,9 +84,26 @@ function runCodegenIfNeeded(rnVersion, platform, appDir) {
} catch (error) {
console.error('Codegen failed:', error.message);
}
} else {
console.log(`Skipping codegen for React Native ${rnVersion}`);
}
}

function patchBoostIfNeeded(rnVersion, patchScriptsDir) {
const versionNumber = parseFloat(rnVersion.replace(/[^\d.]/g, ''));
const shouldPatchBoost = platform === 'ios' && versionNumber <= 0.80;

if (!shouldPatchBoost) {
console.log(`Skipping boost patch for React Native ${rnVersion}`);
return;
}
execSync(`${patchScriptsDir}/rn.patch.boost.js --podspec node_modules/react-native/third-party-podspecs/boost.podspec`, {
stdio: 'inherit',
cwd: appDir,
env: env,
});
}

// Build and publish the SDK - we only need to do this once in CI.
// Locally, we may want to get updates from the latest build so do it on every app build.
if (actions.includes('create') || (env.CI === undefined && actions.includes('build'))) {
Expand Down Expand Up @@ -152,8 +169,11 @@ if (actions.includes('create')) {
env: env,
});

// Patch boost
patchBoostIfNeeded(RNVersion, patchScriptsDir);

// Set up platform-specific app configuration
if (platform == 'ios') {
if (platform === 'ios') {
execSync('ruby --version', { stdio: 'inherit', cwd: `${appDir}`, env: env });

execSync(`${patchScriptsDir}/rn.patch.podfile.js --pod-file Podfile --engine ${RNEngine}`, {
Expand All @@ -174,7 +194,7 @@ if (actions.includes('create')) {
`${patchScriptsDir}/rn.patch.xcode.js --project ios/${appName}.xcodeproj/project.pbxproj --rn-version ${RNVersion}`,
{ stdio: 'inherit', cwd: appDir, env: env },
);
} else if (platform == 'android') {
} else if (platform === 'android') {
execSync(
`${patchScriptsDir}//rn.patch.gradle.properties.js --gradle-properties android/gradle.properties --engine ${RNEngine}`,
{ stdio: 'inherit', cwd: appDir, env: env },
Expand All @@ -200,7 +220,7 @@ if (actions.includes('build')) {
console.log(`Building ${platform}: ${buildType}`);
var appProduct;

if (platform == 'ios') {
if (platform === 'ios') {
// Build iOS test app
execSync(
`set -o pipefail && xcodebuild \
Expand All @@ -216,7 +236,7 @@ if (actions.includes('build')) {
);

appProduct = `${appDir}/ios/DerivedData/Build/Products/${buildType}-iphonesimulator/${appName}.app`;
} else if (platform == 'android') {
} else if (platform === 'android') {
runCodegenIfNeeded(RNVersion, platform, appDir);

execSync(`./gradlew assemble${buildType} -PreactNativeArchitectures=x86 --no-daemon`, {
Expand All @@ -234,15 +254,15 @@ if (actions.includes('build')) {

if (actions.includes('test')) {
// Run e2e tests
if (platform == 'ios') {
if (platform === 'ios') {
try {
execSync('xcrun simctl list devices | grep -q "(Booted)"');
} catch (error) {
throw new Error('No simulator is currently booted. Please boot a simulator before running this script.');
}

execFileSync('xcrun', ['simctl', 'install', 'booted', testApp]);
} else if (platform == 'android') {
} else if (platform === 'android') {
try {
execSync('adb devices | grep -q "emulator"');
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/e2e-tests/maestro/feedback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jsEngine: graaljs
platform: iOS

- runFlow:
file: feedback/happyFlow-android.yml
file: feedback/happyFlow-ios.yml
when:
platform: Android

Expand Down
28 changes: 28 additions & 0 deletions dev-packages/e2e-tests/patch-scripts/rn.patch.boost.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env node

const fs = require('fs');
const { argv } = require('process');

const parseArgs = require('minimist');
const { debug } = require('@sentry/core');
debug.enable();

const args = parseArgs(argv.slice(2));
if (!args.podspec) {
throw new Error('Missing --podspec');
}

// The reason behind this patch is that the boost podspec is pointing to an archive with the wrong hashsum.
// The official workaround is to patch the URL as described here:
// https://github.com/facebook/react-native/issues/42180

debug.log('Patching Boost podspec: ', args.podspec);

let content = fs.readFileSync(args.podspec, 'utf8');
content = content.replace(
"https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2",
"https://archives.boost.io/release/1.76.0/source/boost_1_76_0.tar.bz2"
);
fs.writeFileSync(args.podspec, content);

debug.log('Patched Boost podspec successfully!');
2 changes: 1 addition & 1 deletion packages/core/RNSentry.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Pod::Spec.new do |s|
s.homepage = "https://github.com/getsentry/sentry-react-native"
s.source = { :git => 'https://github.com/getsentry/sentry-react-native.git', :tag => "#{s.version}"}

s.ios.deployment_target = "11.0"
s.ios.deployment_target = "12.0"
s.osx.deployment_target = "10.13"
s.tvos.deployment_target = "11.0"
s.visionos.deployment_target = "1.0" if s.respond_to?(:visionos)
Expand Down
16 changes: 9 additions & 7 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,19 @@
"@sentry/types": "10.22.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/core": "^7.26.7",
"@expo/metro-config": "~0.20.0",
"@mswjs/interceptors": "^0.25.15",
"@react-native/babel-preset": "0.77.1",
"@react-native/babel-preset": "0.80.0",
"@sentry-internal/eslint-config-sdk": "10.22.0",
"@sentry-internal/eslint-plugin-sdk": "10.22.0",
"@sentry-internal/typescript": "10.22.0",
"@sentry/wizard": "6.6.0",
"@testing-library/react-native": "^12.7.2",
"@testing-library/react-native": "^13.2.2",
"@types/jest": "^29.5.13",
"@types/node": "^20.9.3",
"@types/react": "^18.2.64",
"@types/react": "^19.1.0",
"@types/react-test-renderer": "^19.1.0",
"@types/uglify-js": "^3.17.2",
"@types/uuid": "^9.0.4",
"@types/xmlhttprequest": "^1.8.2",
Expand All @@ -102,14 +103,15 @@
"eslint-plugin-react-native": "^3.8.1",
"expo": "^53.0.0",
"expo-module-scripts": "3.1.0",
"jest": "^29.6.2",
"jest": "^29.6.3",
"jest-environment-jsdom": "^29.6.2",
"jest-extended": "^4.0.2",
"madge": "^6.1.0",
"metro": "0.83.1",
"prettier": "^2.0.5",
"react": "18.3.1",
"react-native": "0.77.1",
"react": "19.1.0",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update from React 18.3.1 to 19.1.0 is a major version upgrade that introduces breaking changes. Ensure that all React 19 breaking changes have been reviewed and that the codebase is compatible. Specifically, React 19 has changes to refs, context, and hooks behavior that may require code updates beyond just dependency version bumps.

Did we get this right? 👍 / 👎 to inform future reviews.

"react-native": "0.80.1",
"react-test-renderer": "19.1.0",
"rimraf": "^4.1.1",
"ts-jest": "^29.3.1",
"typescript": "4.9.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { HostComponent, ViewProps } from 'react-native';
// The default export exists in the file but eslint doesn't see it
// eslint-disable-next-line import/default
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import { codegenNativeComponent } from 'react-native';

// If changed to type NativeProps = ViewProps, react native codegen will fail finding the NativeProps type
// eslint-disable-next-line @typescript-eslint/no-empty-interface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { HostComponent, ViewProps } from 'react-native';
// The default export exists in the file but eslint doesn't see it
// eslint-disable-next-line import/default
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import { codegenNativeComponent } from 'react-native';

// If changed to type NativeProps = ViewProps, react native codegen will fail finding the NativeProps type
// eslint-disable-next-line @typescript-eslint/no-empty-interface
Expand Down
Loading
Loading