Skip to content
Merged
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
12 changes: 6 additions & 6 deletions .github/workflows/e2e-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ 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']
ios-use-frameworks: ['no', 'static', 'dynamic']
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
Expand All @@ -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'
Expand Down Expand Up @@ -301,15 +301,15 @@ 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']
ios-use-frameworks: ['no'] # test only no framworks
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'
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
21 changes: 21 additions & 0 deletions dev-packages/e2e-tests/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'))) {
Expand Down Expand Up @@ -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`,
Expand Down
3 changes: 2 additions & 1 deletion dev-packages/e2e-tests/patch-scripts/rn.patch.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ Sentry.init({
const e2eComponentPatch = '<EndToEndTestsScreen />';
const lastImportRex = /^([^]*)(import\s+[^;]*?;$)/m;
const patchRex = '@sentry/react-native';
const headerComponentRex = /<ScrollView/gm;
// Support both older RN versions with ScrollView and newer versions with NewAppScreen
const headerComponentRex = /(<ScrollView|<NewAppScreen)/gm;
const exportDefaultRex = /export\s+default\s+App;/m;

const jsPath = path.join(args.app, 'App.js');
Expand Down
11 changes: 9 additions & 2 deletions packages/core/RNSentry.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@ rn_version = get_rn_version(rn_package)
is_hermes_default = is_hermes_default(rn_version)
is_profiling_supported = is_profiling_supported(rn_version)

folly_flags = ' -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1'
folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
# Use different Folly configuration for RN 0.80.0+
if should_use_folly_flags(rn_version)
# For older RN versions, keep the original Folly configuration
folly_flags = ' -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1'
folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
else
# For RN 0.80+, don't use the incompatible Folly flags
folly_compiler_flags = ''
end

is_new_arch_enabled = ENV["RCT_NEW_ARCH_ENABLED"] == "1"
is_using_hermes = (ENV['USE_HERMES'] == nil && is_hermes_default) || ENV['USE_HERMES'] == '1'
Expand Down
5 changes: 5 additions & 0 deletions packages/core/scripts/sentry_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ def is_hermes_default(rn_version)
def is_profiling_supported(rn_version)
return (rn_version[:major] >= 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
Loading