diff --git a/.github/workflows/e2e-v2.yml b/.github/workflows/e2e-v2.yml index c18eaabae2..ade224968b 100644 --- a/.github/workflows/e2e-v2.yml +++ b/.github/workflows/e2e-v2.yml @@ -163,7 +163,7 @@ jobs: strategy: fail-fast: false # keeps matrix running if one fails matrix: - rn-version: ['0.65.3', '0.79.1'] + rn-version: ['0.65.3', '0.80.0'] rn-architecture: ['legacy', 'new'] platform: ['android', 'ios'] build-type: ['production'] @@ -171,7 +171,7 @@ jobs: engine: ['hermes', 'jsc'] include: - platform: ios - rn-version: '0.79.1' + rn-version: '0.80.0' xcode-version: '16.2' runs-on: macos-15 - platform: ios @@ -182,7 +182,7 @@ jobs: runs-on: ubuntu-latest exclude: # exclude JSC for new RN versions (keeping the matrix manageable) - - rn-version: '0.79.1' + - rn-version: '0.80.0' engine: 'jsc' # exclude all rn versions lower than 0.70.0 for new architecture - rn-version: '0.65.3' @@ -301,7 +301,7 @@ jobs: strategy: fail-fast: false # keeps matrix running if one fails matrix: - rn-version: ['0.65.3', '0.79.1'] + rn-version: ['0.65.3', '0.80.0'] rn-architecture: ['legacy', 'new'] platform: ['android', 'ios'] build-type: ['production'] @@ -309,7 +309,7 @@ jobs: engine: ['hermes', 'jsc'] include: - platform: ios - rn-version: '0.79.1' + rn-version: '0.80.0' runs-on: macos-15 - platform: ios rn-version: '0.65.3' @@ -323,7 +323,7 @@ jobs: # e2e test only the default combinations - rn-version: '0.65.3' engine: 'hermes' - - rn-version: '0.79.1' + - rn-version: '0.80.0' engine: 'jsc' steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index ff23fffc07..d5408b8e81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ ### Fixes +- Adds support for React Native 0.80 ([#4938](https://github.com/getsentry/sentry-react-native/pull/4938)) - Report slow and frozen frames as app start span data ([#4865](https://github.com/getsentry/sentry-react-native/pull/4865)) - User set by `Sentry.setUser` is prefilled in Feedback Widget ([#4901](https://github.com/getsentry/sentry-react-native/pull/4901)) - User data are considered from all scopes in the following order current, isolation and global. diff --git a/dev-packages/e2e-tests/cli.mjs b/dev-packages/e2e-tests/cli.mjs index c9281549f3..9d8f958b80 100755 --- a/dev-packages/e2e-tests/cli.mjs +++ b/dev-packages/e2e-tests/cli.mjs @@ -68,6 +68,25 @@ const testApp = `${e2eDir}/${testAppName}`; const appId = platform === 'ios' ? 'org.reactjs.native.example.RnDiffApp' : 'com.rndiffapp'; const sentryAuthToken = env.SENTRY_AUTH_TOKEN; +function runCodegenIfNeeded(rnVersion, platform, appDir) { + const versionNumber = parseFloat(rnVersion.replace(/[^\d.]/g, '')); + const shouldRunCodegen = platform === 'android' && versionNumber >= 0.80; + + if (shouldRunCodegen) { + console.log(`Running codegen for React Native ${rnVersion}...`); + try { + execSync('./gradlew generateCodegenArtifactsFromSchema', { + stdio: 'inherit', + cwd: path.join(appDir, 'android'), + env: env + }); + console.log('Gradle codegen task completed successfully'); + } catch (error) { + console.error('Codegen failed:', error.message); + } + } +} + // 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'))) { @@ -198,6 +217,8 @@ if (actions.includes('build')) { appProduct = `${appDir}/ios/DerivedData/Build/Products/${buildType}-iphonesimulator/${appName}.app`; } else if (platform == 'android') { + runCodegenIfNeeded(RNVersion, platform, appDir); + execSync(`./gradlew assemble${buildType} -PreactNativeArchitectures=x86 --no-daemon`, { stdio: 'inherit', cwd: `${appDir}/android`, diff --git a/dev-packages/e2e-tests/patch-scripts/rn.patch.app.js b/dev-packages/e2e-tests/patch-scripts/rn.patch.app.js index ec6b3f5262..3fd9f5f825 100755 --- a/dev-packages/e2e-tests/patch-scripts/rn.patch.app.js +++ b/dev-packages/e2e-tests/patch-scripts/rn.patch.app.js @@ -41,7 +41,8 @@ Sentry.init({ const e2eComponentPatch = ''; const lastImportRex = /^([^]*)(import\s+[^;]*?;$)/m; const patchRex = '@sentry/react-native'; -const headerComponentRex = /= 1 || (rn_version[:major] == 0 && rn_version[:minor] >= 69)) end + +# Check if we need the old Folly flags (for RN < 0.80.0) +def should_use_folly_flags(rn_version) + return (rn_version[:major] == 0 && rn_version[:minor] < 80) +end