feat(ios): opt-in consumption of sentry-cocoa via Swift Package Manager#6182
Merged
Conversation
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
Contributor
|
10 tasks
Adds a new opt-in path in RNSentry.podspec: when `SENTRY_USE_SPM=1` is set in the environment before `pod install`, RNSentry pulls `Sentry` from the sentry-cocoa SPM package (as a binary xcframework) instead of from the Sentry CocoaPods source build. Default behavior is unchanged. Existing users on any React Native version keep their current CocoaPods-based consumption with no action required. The opt-in path requires React Native >= 0.75 because it uses the `SPMManager` singleton defined in `react-native/scripts/cocoapods/spm.rb`, which is loaded transitively from the Podfile via `react_native_pods.rb`. This is the first step of the broader SPM migration tracked at #5780. It unblocks experimentation with binary-framework consumption of sentry-cocoa while keeping CocoaPods as the production default. Two known caveats for users opting in today: 1. The Sentry xcframework in sentry-cocoa 9.13.0 and earlier is missing the `SentrySessionReplayHybridSDK` symbol due to a packaging bug (getsentry/sentry-cocoa#7911). Apps that use Session Replay will fail to link until that fix ships in a sentry-cocoa release. Apps not using Session Replay are unaffected. 2. `SentrySwizzle.h` must be imported via framework-style (`<Sentry/...>`) rather than quote-style when the xcframework is the consumption path — already handled by #6175 (in this same release). Verified locally: - Default `pod install` (no env var) — `** BUILD SUCCEEDED **` on the RN sample, identical to the pre-change state. - `SENTRY_USE_SPM=1 pod install` — Sentry no longer in Podfile.lock, `XCRemoteSwiftPackageReference "sentry-cocoa"` injected into the Xcode project, [SPM] log lines confirm the helper ran correctly. Refs: #5780, #6170
404d962 to
58a4f9d
Compare
Contributor
Author
|
since we've updated |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 15f788d. Configure here.
📲 Install BuildsAndroid
|
antonis
approved these changes
May 26, 2026
Contributor
antonis
left a comment
There was a problem hiding this comment.
LGTM but let's wait for GitHub to get back to normal to verify that the CI is 🟢
Contributor
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5569641+dirty | 3839.22 ms | 1231.30 ms | -2607.91 ms |
| 7ac3378+dirty | 1213.37 ms | 1218.15 ms | 4.78 ms |
| 9210ae6+dirty | 3815.93 ms | 1214.14 ms | -2601.79 ms |
| a3265b6+dirty | 3826.31 ms | 1207.87 ms | -2618.44 ms |
| 4953e94+dirty | 1212.06 ms | 1214.83 ms | 2.77 ms |
| d2eadf8+dirty | 3842.42 ms | 1228.91 ms | -2613.50 ms |
| 4e0ba9c+dirty | 3839.22 ms | 1221.06 ms | -2618.16 ms |
| ef27341+dirty | 3856.13 ms | 1231.42 ms | -2624.71 ms |
| c151573+dirty | 3841.06 ms | 1232.13 ms | -2608.93 ms |
| 5748023+dirty | 3840.49 ms | 1227.43 ms | -2613.05 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5569641+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 7ac3378+dirty | 3.38 MiB | 4.76 MiB | 1.38 MiB |
| 9210ae6+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| a3265b6+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| 4953e94+dirty | 3.38 MiB | 4.73 MiB | 1.35 MiB |
| d2eadf8+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 4e0ba9c+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| ef27341+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| c151573+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| 5748023+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
4 tasks
Contributor
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5569641+dirty | 3824.35 ms | 1210.78 ms | -2613.57 ms |
| 7ac3378+dirty | 1202.35 ms | 1198.31 ms | -4.04 ms |
| 9210ae6+dirty | 3834.11 ms | 1216.64 ms | -2617.47 ms |
| a3265b6+dirty | 3844.26 ms | 1235.60 ms | -2608.66 ms |
| 4953e94+dirty | 1217.41 ms | 1223.53 ms | 6.12 ms |
| d2eadf8+dirty | 3841.53 ms | 1216.15 ms | -2625.39 ms |
| 4e0ba9c+dirty | 3856.39 ms | 1234.44 ms | -2621.95 ms |
| ef27341+dirty | 3835.20 ms | 1212.23 ms | -2622.97 ms |
| c151573+dirty | 3835.64 ms | 1216.10 ms | -2619.53 ms |
| 5748023+dirty | 3844.74 ms | 1225.49 ms | -2619.26 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5569641+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 7ac3378+dirty | 3.38 MiB | 4.76 MiB | 1.38 MiB |
| 9210ae6+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| a3265b6+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| 4953e94+dirty | 3.38 MiB | 4.73 MiB | 1.35 MiB |
| d2eadf8+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 4e0ba9c+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| ef27341+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| c151573+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| 5748023+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds a new opt-in path in RNSentry.podspec: when
SENTRY_USE_SPM=1is set in the environment beforepod install, RNSentry pullsSentryfrom the sentry-cocoa SPM package (as a binary xcframework) instead of from the Sentry CocoaPods source build.This is the first step of the broader SPM migration tracked at #5780. It unblocks experimentation with binary-framework consumption of sentry-cocoa while keeping CocoaPods as the production default.
BUT those things need to be done before we will be able to migrate:
SentrySessionReplayHybridSDKsymbol due to a packaging bug (fix(replay): correct file type for SentrySessionReplayHybridSDK.m in pbxproj sentry-cocoa#7911). Apps that use Session Replay will fail to link until that fix ships in a sentry-cocoa release. Apps not using Session Replay are unaffected.SentrySwizzle.hmust be imported via framework-style (<Sentry/...>) rather than quote-style when the xcframework is the consumption path — already handled by #6181Verified locally:
pod install(no env var) —** BUILD SUCCEEDED **on the RN sample, identical to the pre-change state.SENTRY_USE_SPM=1 pod install— Sentry no longer in Podfile.lock,XCRemoteSwiftPackageReference "sentry-cocoa"injected into the Xcode project, [SPM] log lines confirm the helper ran correctly.Refs: #5780, #6170
📢 Type of change
📜 Description
💡 Motivation and Context
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled🔮 Next steps