Skip to content

feat(expo): Add RNSentrySDK APIs support to @sentry/react-native/expo plugin #4633

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

Open
wants to merge 31 commits into
base: capture-app-start-errors
Choose a base branch
from

Conversation

antonis
Copy link
Collaborator

@antonis antonis commented Mar 7, 2025

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

Based on feat: Capture app start errors before JS

📜 Description

Adds RNSentrySDK APIs support to @sentry/react-native/expo plugin by importing sentry and adding injecting RNSentrySDK.init/start in the Android MainApplication (Kotlin or Java) or AppDelegate (Objective-C or Swift).

This feature is opt-out to enable it set useNativeInit to true in your @sentry/react-native/expo plugin configuration.

"plugins": [
  [
    "@sentry/react-native/expo",
    {
      "useNativeInit": true
    }
  ],

💡 Motivation and Context

Fixes #4625

💚 How did you test it?

CI, Manual

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

Copy link
Contributor

github-actions bot commented Mar 7, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against b2a89f2

Copy link
Contributor

github-actions bot commented Mar 7, 2025

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1238.22 ms 1234.79 ms -3.43 ms
Size 2.63 MiB 3.78 MiB 1.15 MiB

Baseline results on branch: capture-app-start-errors

Startup times

Revision Plain With Sentry Diff
482b3fb+dirty 1212.04 ms 1221.96 ms 9.92 ms

App size

Revision Plain With Sentry Diff
482b3fb+dirty 2.63 MiB 3.78 MiB 1.15 MiB

Copy link
Contributor

github-actions bot commented Mar 7, 2025

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1230.47 ms 1235.00 ms 4.53 ms
Size 3.19 MiB 4.35 MiB 1.17 MiB

Baseline results on branch: capture-app-start-errors

Startup times

Revision Plain With Sentry Diff
482b3fb+dirty 1226.96 ms 1226.39 ms -0.57 ms

App size

Revision Plain With Sentry Diff
482b3fb+dirty 3.19 MiB 4.35 MiB 1.17 MiB

Copy link
Contributor

github-actions bot commented Mar 7, 2025

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 422.57 ms 447.05 ms 24.48 ms
Size 17.75 MiB 20.15 MiB 2.40 MiB

Baseline results on branch: capture-app-start-errors

Startup times

Revision Plain With Sentry Diff
482b3fb 444.98 ms 464.39 ms 19.41 ms

App size

Revision Plain With Sentry Diff
482b3fb 17.75 MiB 20.15 MiB 2.40 MiB

Copy link
Contributor

github-actions bot commented Mar 7, 2025

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 416.48 ms 432.80 ms 16.32 ms
Size 7.15 MiB 8.42 MiB 1.27 MiB

Baseline results on branch: capture-app-start-errors

Startup times

Revision Plain With Sentry Diff
482b3fb+dirty 439.70 ms 450.42 ms 10.72 ms

App size

Revision Plain With Sentry Diff
482b3fb+dirty 7.15 MiB 8.42 MiB 1.27 MiB

@antonis antonis linked an issue Mar 7, 2025 that may be closed by this pull request
@antonis antonis marked this pull request as ready for review March 7, 2025 16:22
Copy link
Collaborator

@lucas-zimerman lucas-zimerman left a comment

Choose a reason for hiding this comment

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

Overall the PR looks good and thank you for the tests!
I still think we could fine tune a bit more the android part and after it we could get ready for merge

@antonis antonis requested a review from lucas-zimerman April 4, 2025 09:45
@antonis
Copy link
Collaborator Author

antonis commented Apr 4, 2025

Note: The Build & Test / Type Check Typescript 3.8 (pull_request) failure should be fixed when we merge #4673 from main

@antonis antonis requested a review from krystofwoldrich April 15, 2025 10:00
@antonis antonis requested a review from krystofwoldrich April 16, 2025 08:34
Copy link
Collaborator

@lucas-zimerman lucas-zimerman left a comment

Choose a reason for hiding this comment

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

I have re-checked the PR and overall, I only found a nit on a string. After fixing it and if @krystofwoldrich doesn't find anything else, LGTM!

Co-authored-by: LucasZF <[email protected]>
Co-authored-by: Krystof Woldrich <[email protected]>
@krystofwoldrich
Copy link
Contributor

I'm currently updating the base branch with the latest main since there was quite a lot of development that was not synced to the feature branch.

@antonis
Copy link
Collaborator Author

antonis commented Jun 11, 2025

I'm currently updating the base branch with the latest main since there was quite a lot of development that was not synced to the feature branch.

Thank you for the heads up @krystofwoldrich 🙇
I'll update this branch after that along with the review feedback.

@krystofwoldrich krystofwoldrich force-pushed the capture-app-start-errors branch 3 times, most recently from 2363742 to 588ba6d Compare June 12, 2025 15:26
Copy link
Contributor

@krystofwoldrich krystofwoldrich left a comment

Choose a reason for hiding this comment

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

Thank you for the fixes. 🚀 It looks great!

@@ -10,6 +10,7 @@

### Features

- Add RNSentrySDK APIs support to @sentry/react-native/expo plugin ([#4633](https://github.com/getsentry/sentry-react-native/pull/4633))
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit. It would be nice to include an example code snippet and a small summary of what will the flag do.

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.

Add RNSentrySDK APIs support to @sentry/react-native/expo plugin
3 participants