Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support React Native 0.77 #2335

Merged
merged 9 commits into from
Feb 18, 2025
12 changes: 4 additions & 8 deletions .buildkite/basic/react-native-android-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ steps:
- "bundle install"
- "node scripts/generate-react-native-fixture.js"
matrix:
- "0.75"
- "0.76"
- "0.77"
retry:
automatic:
- exit_status: "*"
Expand All @@ -50,8 +49,7 @@ steps:
- exit_status: "*"
limit: 1
matrix:
- "0.75"
- "0.76"
- "0.77"

#
# End-to-end tests
Expand Down Expand Up @@ -90,8 +88,7 @@ steps:
concurrency_group: "bitbar"
concurrency_method: eager
matrix:
- "0.75"
- "0.76"
- "0.77"

- label: ":bitbar: :android: RN {{matrix}} Android 12 (New Arch) end-to-end tests"
depends_on: "build-react-native-android-fixture-new-arch"
Expand Down Expand Up @@ -127,6 +124,5 @@ steps:
concurrency_group: "bitbar"
concurrency_method: eager
matrix:
- "0.75"
- "0.76"
- "0.77"

12 changes: 4 additions & 8 deletions .buildkite/basic/react-native-ios-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ steps:
- "bundle install"
- "node scripts/generate-react-native-fixture.js"
matrix:
- "0.75"
- "0.76"
- "0.77"
retry:
automatic:
- exit_status: "*"
Expand All @@ -50,8 +49,7 @@ steps:
- "bundle install"
- "node scripts/generate-react-native-fixture.js"
matrix:
- "0.75"
- "0.76"
- "0.77"
retry:
automatic:
- exit_status: "*"
Expand Down Expand Up @@ -92,8 +90,7 @@ steps:
concurrency_group: "bitbar"
concurrency_method: eager
matrix:
- "0.75"
- "0.76"
- "0.77"

- label: ":bitbar: :mac: RN {{matrix}} iOS (New Arch) end-to-end tests"
depends_on: "build-react-native-ios-fixture-new-arch"
Expand Down Expand Up @@ -128,6 +125,5 @@ steps:
concurrency_group: "bitbar"
concurrency_method: eager
matrix:
- "0.75"
- "0.76"
- "0.77"

8 changes: 8 additions & 0 deletions .buildkite/full/react-native-android-pipeline.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ steps:
- "0.72"
- "0.73"
- "0.74"
- "0.75"
- "0.76"
retry:
automatic:
- exit_status: "*"
Expand Down Expand Up @@ -149,6 +151,8 @@ steps:
- "0.72"
- "0.73"
- "0.74"
Comment on lines 151 to 153
Copy link
Member

Choose a reason for hiding this comment

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

according to the 0.77 release notes (at the very bottom) v0.74 is now unsupported. should we drop these versions from our test matrix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed in Slack - I've now created a separate task to update the test matrix 👍🏾

- "0.75"
- "0.76"

- label: ':android: Build react-native-navigation {{matrix}} test fixture APK (Old Arch)'
key: "build-react-native-navigation-android-fixture-old-arch"
Expand Down Expand Up @@ -372,6 +376,8 @@ steps:
- "0.72"
- "0.73"
- "0.74"
- "0.75"
- "0.76"

# current latest version (v7.40.1) of react-native-navigation's autolinking tool doesn't support RN 0.73+,
# causing a build failure - see https://github.com/wix/react-native-navigation/issues/7821
Expand Down Expand Up @@ -414,6 +420,8 @@ steps:
- "0.72"
- "0.73"
- "0.74"
- "0.75"
- "0.76"

- label: ":bitbar: :android: react-native-navigation {{matrix}} Android 12 (Old Arch) end-to-end tests"
depends_on: "build-react-native-navigation-android-fixture-old-arch"
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/full/react-native-cli-pipeline.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ steps:
- "bundle install"
- "bundle exec maze-runner features/build-app-tests/build-ios-app.feature"
matrix:
- "0.77"
- "0.76"
- "0.75"
- "0.74"
retry:
automatic:
- exit_status: "*"
Expand Down Expand Up @@ -117,6 +117,6 @@ steps:
concurrency_group: "browserstack-app"
concurrency_method: eager
matrix:
- "0.77"
- "0.76"
- "0.75"
- "0.74"
8 changes: 8 additions & 0 deletions .buildkite/full/react-native-ios-pipeline.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ steps:
- "0.72"
- "0.73"
- "0.74"
- "0.75"
- "0.76"
retry:
automatic:
- exit_status: "*"
Expand All @@ -124,6 +126,8 @@ steps:
- "0.72"
- "0.73"
- "0.74"
- "0.75"
- "0.76"
retry:
automatic:
- exit_status: "*"
Expand Down Expand Up @@ -344,6 +348,8 @@ steps:
- "0.72"
- "0.73"
- "0.74"
- "0.75"
- "0.76"

- label: ":bitbar: :mac: RN {{matrix}} iOS (New Arch) end-to-end tests"
depends_on: "build-react-native-ios-fixture-new-arch-full"
Expand Down Expand Up @@ -382,6 +388,8 @@ steps:
- "0.72"
- "0.73"
- "0.74"
- "0.75"
- "0.76"

# current latest version (v7.40.1) of react-native-navigation's autolinking tool doesn't currently support RN 0.73+,
# causing a build failure - see https://github.com/wix/react-native-navigation/issues/7821
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

## [Unreleased]

This release adds support for React Native 0.77 to `@bugsnag/react-native`

### Added

- (react-native-cli) Add support for `AppDelegate.swift` files to insert command [#2319](https://github.com/bugsnag/bugsnag-js/pull/2319)
- (plugin-react-navigation) Add support for React Navigation v7.x [#2335](https://github.com/bugsnag/bugsnag-js/pull/2335)

### Fixed

- (plugin-angular) Added a null check so BugsnagErrorHandler fails silently when misconfigured [#2295](https://github.com/bugsnag/bugsnag-js/pull/2295)
- (react-native) Fix no such module error when importing Bugsnag from Swift [#2335](https://github.com/bugsnag/bugsnag-js/pull/2335)

## [8.2.0] - 2025-01-27

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/plugin-react-navigation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"peerDependencies": {
"@bugsnag/core": "^8.0.0",
"@react-navigation/native": "^5.0 || ^6.0"
"@react-navigation/native": "^5.0 || ^6.0 || ^7.0"
},
"peerDependenciesMeta": {
"@bugsnag/core": {
Expand Down
3 changes: 3 additions & 0 deletions packages/react-native/BugsnagReactNative.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ Pod::Spec.new do |s|
s.resource_bundles = {
"Bugsnag" => ["ios/vendor/bugsnag-cocoa/Bugsnag/resources/PrivacyInfo.xcprivacy"],
}
s.pod_target_xcconfig = {
"DEFINES_MODULE" => "YES"
}

if ENV["RCT_NEW_ARCH_ENABLED"] == "1"
install_modules_dependencies(s)
Expand Down
28 changes: 14 additions & 14 deletions scripts/generate-react-native-fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,19 @@ const PEER_DEPENDENCIES = [
`@bugsnag/plugin-react-native-navigation@${notifierVersion}`
]

const SOURCE_MAP_DEPENDENCIES = [
`@bugsnag/react-native-cli@${notifierVersion}`
]
let reactNavigationVersion = '6.1.18'
let reactNavigationNativeStackVersion = '6.11.0'
let reactNativeScreensVersion = '3.35.0'
let reactNativeSafeAreaContextVersion = '4.14.0'

// RN 0.77 requires react-native-screens 4.6.0, which in turn requires react navigation v7
if (parseFloat(reactNativeVersion) >= 0.77) {
reactNavigationVersion = '7.0.14'
reactNavigationNativeStackVersion = '7.2.0'
reactNativeScreensVersion = '4.6.0'
reactNativeSafeAreaContextVersion = '5.2.0'
}

const reactNavigationVersion = '6.1.18'
const reactNavigationNativeStackVersion = '6.11.0'
const reactNativeScreensVersion = '3.35.0'
const reactNativeSafeAreaContextVersion = '4.14.0'
const REACT_NAVIGATION_PEER_DEPENDENCIES = [
`@react-navigation/native@${reactNavigationVersion}`,
`@react-navigation/native-stack@${reactNavigationNativeStackVersion}`,
Expand Down Expand Up @@ -122,20 +127,15 @@ function installFixtureDependencies () {
PEER_DEPENDENCIES.push(...REACT_NAVIGATION_PEER_DEPENDENCIES)
}

// add source map dependencies
if (process.env.ENABLE_SOURCE_MAPS === 'true' || process.env.ENABLE_SOURCE_MAPS === '1') {
PEER_DEPENDENCIES.push(...SOURCE_MAP_DEPENDENCIES)
}

const fixtureDependencyArgs = PEER_DEPENDENCIES.join(' ')

// install test fixture dependencies
execSync(`npm install --save ${fixtureDependencyArgs} --registry ${process.env.REGISTRY_URL} --legacy-peer-deps`, { cwd: fixtureDir, stdio: 'inherit' })
execSync(`npm install --save --save-exact ${fixtureDependencyArgs} --registry ${process.env.REGISTRY_URL} --legacy-peer-deps`, { cwd: fixtureDir, stdio: 'inherit' })

// install the scenario launcher package
const scenarioLauncherPackage = `${ROOT_DIR}/test/react-native/features/fixtures/scenario-launcher`
execSync(`npm pack ${scenarioLauncherPackage} --pack-destination ${fixtureDir}`, { cwd: ROOT_DIR, stdio: 'inherit' })
execSync('npm install --save bugsnag-react-native-scenarios-*.tgz', { cwd: fixtureDir, stdio: 'inherit' })
execSync(`npm install --save bugsnag-react-native-scenarios-*.tgz --registry ${process.env.REGISTRY_URL}`, { cwd: fixtureDir, stdio: 'inherit' })
}

/** Replace native files generated by react-native cli with pre-configured files */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"peerDependencies": {
"@bugsnag/plugin-react-navigation": "*",
"@bugsnag/plugin-react-native-navigation": "*",
"@react-navigation/native": "^6.1.18",
"@react-navigation/native-stack": "^6.11.0",
"@react-navigation/native": "*",
"@react-navigation/native-stack": "*",
"react": "*",
"react-native": "*",
"react-native-file-access": "*"
Expand Down
12 changes: 12 additions & 0 deletions test/react-native/features/native-stack.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ Scenario: Handled JS error with native stacktrace
# On 0.75+ the Error name is set to the native exception class
And the event "exceptions.0.errorClass" equals the version-dependent string:
| arch | version | value |
| new | 0.77 | java.lang.RuntimeException |
| new | 0.76 | java.lang.RuntimeException |
| new | 0.75 | java.lang.RuntimeException |
| new | default | Error |
| old | 0.77 | java.lang.RuntimeException |
| old | 0.76 | java.lang.RuntimeException |
| old | 0.75 | java.lang.RuntimeException |
| old | default | Error |
Expand Down Expand Up @@ -55,9 +57,11 @@ Scenario: Unhandled JS error with native stacktrace
# On 0.75+ the Error name is set to the native exception class
And the event "exceptions.0.errorClass" equals the version-dependent string:
| arch | version | value |
| new | 0.77 | java.lang.RuntimeException |
| new | 0.76 | java.lang.RuntimeException |
| new | 0.75 | java.lang.RuntimeException |
| new | default | Error |
| old | 0.77 | java.lang.RuntimeException |
| old | 0.76 | java.lang.RuntimeException |
| old | 0.75 | java.lang.RuntimeException |
| old | default | Error |
Expand Down Expand Up @@ -127,27 +131,31 @@ Scenario: Handled JS error with native stacktrace
# On 0.74+ New Arch there is no JS stacktrace - see PLAT-12193
And the event "exceptions.0.stacktrace.20.columnNumber" equals the version-dependent string:
| arch | version | value |
| new | 0.77 | @skip |
| new | 0.76 | @skip |
| new | 0.75 | @skip |
| new | 0.74 | @skip |
| new | default | @not_null |
| old | default | @not_null |
And the event "exceptions.0.stacktrace.20.file" equals the version-dependent string:
| arch | version | value |
| new | 0.77 | @skip |
| new | 0.76 | @skip |
| new | 0.75 | @skip |
| new | 0.74 | @skip |
| new | default | @not_null |
| old | default | @not_null |
And the event "exceptions.0.stacktrace.20.lineNumber" equals the version-dependent string:
| arch | version | value |
| new | 0.77 | @skip |
| new | 0.76 | @skip |
| new | 0.75 | @skip |
| new | 0.74 | @skip |
| new | default | @not_null |
| old | default | @not_null |
And the event "exceptions.0.stacktrace.20.type" equals the version-dependent string:
| arch | version | value |
| new | 0.77 | @skip |
| new | 0.76 | @skip |
| new | 0.75 | @skip |
| new | 0.74 | @skip |
Expand Down Expand Up @@ -179,27 +187,31 @@ Scenario: Unhandled JS error with native stacktrace
# On 0.74+ New Arch there is no JS stacktrace - see PLAT-12193
And the event "exceptions.0.stacktrace.20.columnNumber" equals the version-dependent string:
| arch | version | value |
| new | 0.77 | @skip |
| new | 0.76 | @skip |
| new | 0.75 | @skip |
| new | 0.74 | @skip |
| new | default | @not_null |
| old | default | @not_null |
And the event "exceptions.0.stacktrace.20.file" equals the version-dependent string:
| arch | version | value |
| new | 0.77 | @skip |
| new | 0.76 | @skip |
| new | 0.75 | @skip |
| new | 0.74 | @skip |
| new | default | @not_null |
| old | default | @not_null |
And the event "exceptions.0.stacktrace.20.lineNumber" equals the version-dependent string:
| arch | version | value |
| new | 0.77 | @skip |
| new | 0.76 | @skip |
| new | 0.75 | @skip |
| new | 0.74 | @skip |
| new | default | @not_null |
| old | default | @not_null |
And the event "exceptions.0.stacktrace.20.type" equals the version-dependent string:
| arch | version | value |
| new | 0.77 | @skip |
| new | 0.76 | @skip |
| new | 0.75 | @skip |
| new | 0.74 | @skip |
Expand Down
3 changes: 3 additions & 0 deletions test/react-native/features/unhandled-android.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,23 @@ Scenario: Reporting an Unhandled Native error
And the event "unhandled" is true
And the event "exceptions.0.errorClass" equals the version-dependent string:
| arch | version | value |
| new | 0.77 | Error |
| new | 0.76 | Error |
| new | 0.75 | Error |
| new | 0.74 | Error |
| new | default | java.lang.RuntimeException |
| old | default | java.lang.RuntimeException |
And the event "exceptions.0.type" equals the version-dependent string:
| arch | version | value |
| new | 0.77 | reactnativejs |
| new | 0.76 | reactnativejs |
| new | 0.75 | reactnativejs |
| new | 0.74 | reactnativejs |
| new | default | android |
| old | default | android |
And the event "exceptions.0.message" equals the version-dependent string:
| arch | version | value |
| new | 0.77 | Exception in HostFunction: UnhandledNativeErrorScenario |
| new | 0.76 | Exception in HostFunction: UnhandledNativeErrorScenario |
| new | 0.75 | Exception in HostFunction: UnhandledNativeErrorScenario |
| new | 0.74 | Exception in HostFunction: UnhandledNativeErrorScenario |
Expand Down
Loading