Skip to content

Conversation

@yousif-bugsnag
Copy link
Contributor

Goal

Adds the Native App Starts plugin implementation for iOS, along with the associated e2e test setup.

Design

The plugin itself (BugsnagReactNativeAppStartPlugin.mm) follows the same approach as the Android implementation, using span callbacks to track the start and end of view load spans and span conditions to block the current view load span until the JavaScript app start span has ended.

However on iOS some additional changes are required for Cocoa Performance's view load instrumentation to work.

This is because React Native assigns the view directly to the ViewController's view property, which bypasses the UIVIewController lifecycle methods (specifically loadView) that the view load instrumentation hooks into.

These changes are implemented in the test fixture via a custom view controller (BSGViewController) added to BugsnagTestUtils, along with some additional modifications to the test fixture's AppDelegate file to make it compatible with the native view load instrumentation:

  • Overriding createRootViewController to return a custom view controller implementation
  • Overriding setRootView or equivalent to set the view in a way that triggers loadView to be called.

Testing

Covered by CI

@yousif-bugsnag yousif-bugsnag changed the title feat(react-native): native app start plugin for ios Native app starts plugin - iOS Oct 8, 2025
@yousif-bugsnag yousif-bugsnag requested a review from lemnik October 8, 2025 15:26
@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Browser bundle size

NPM build

Package
Before 234.65 kB
After 234.65 kB
± No change

CDN build

Unminified Minfied Minified + gzipped
Before 119.04 kB 45.94 kB 13.25 kB
After 119.04 kB 45.94 kB 13.25 kB
± No change No change No change

Code coverage

Ok File (✨=New File) Lines Branches Functions Statements
🔴 /home/runner/work/bugsnag-js-performance/bugsnag-js-performance/packages/platforms/react-native/lib/span-factory.ts 98.57%
(+0%)
32.2%
(+0%)
75.86%
(+0%)
92%
(-0.8%)

Total:

Lines Branches Functions Statements
84.67%(+0%) 61.91%(+0%) 75.43%(+0%) 81.48%(-0.02%)

Generated against 2839365 on 8 October 2025 at 15:46:22 UTC

@yousif-bugsnag
Copy link
Contributor Author

force-merging due to a known issue with Expo Android tests (fixed in the target branch)

@yousif-bugsnag yousif-bugsnag merged commit 89d7323 into integration/rn-native-app-starts Oct 14, 2025
104 of 109 checks passed
@yousif-bugsnag yousif-bugsnag deleted the PLAT-14865/native-app-start-plugin-ios branch October 14, 2025 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants