feat(expo): Add RNSentrySDK APIs support to @sentry/react-native/expo plugin
:loudspeaker: Type of change
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
Based on feat: Capture app start errors before JS
:scroll: 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
}
],
:bulb: Motivation and Context
Fixes https://github.com/getsentry/sentry-react-native/issues/4625
:green_heart: How did you test it?
CI, Manual
:pencil: Checklist
- [x] I added tests to verify changes
- [x] No new PII added or SDK only sends newly added PII if
sendDefaultPIIis enabled - [x] I updated the docs if needed.
- [x] I updated the wizard if needed.
- [x] All tests passing
- [x] No breaking changes
:crystal_ball: Next steps
| Messages | |
|---|---|
| :book: | Do not forget to update Sentry-docs with your feature once the pull request gets approved. |
Generated by :no_entry_sign: dangerJS against 3885d704ccd9c6382b7ff19e4f07a778769ed8c1
iOS (legacy) Performance metrics :rocket:
| Plain | With Sentry | Diff | |
|---|---|---|---|
| Startup time | 1209.39 ms | 1214.90 ms | 5.51 ms |
| Size | 2.63 MiB | 3.78 MiB | 1.15 MiB |
iOS (new) Performance metrics :rocket:
| Plain | With Sentry | Diff | |
|---|---|---|---|
| Startup time | 1234.24 ms | 1237.90 ms | 3.65 ms |
| Size | 3.19 MiB | 4.35 MiB | 1.17 MiB |
Android (legacy) Performance metrics :rocket:
| Plain | With Sentry | Diff | |
|---|---|---|---|
| Startup time | 441.12 ms | 451.55 ms | 10.43 ms |
| Size | 17.75 MiB | 20.15 MiB | 2.40 MiB |
Android (new) Performance metrics :rocket:
| Plain | With Sentry | Diff | |
|---|---|---|---|
| Startup time | 351.04 ms | 404.94 ms | 53.90 ms |
| Size | 7.15 MiB | 8.42 MiB | 1.27 MiB |
Note: The Build & Test / Type Check Typescript 3.8 (pull_request) failure should be fixed when we merge https://github.com/getsentry/sentry-react-native/pull/4673 from main
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.
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.
@sentry review