Skip to content

feat(ios): Default to consuming sentry-cocoa via SPM#6381

Open
alwx wants to merge 3 commits into
mainfrom
alwx/feature/spm-by-default
Open

feat(ios): Default to consuming sentry-cocoa via SPM#6381
alwx wants to merge 3 commits into
mainfrom
alwx/feature/spm-by-default

Conversation

@alwx

@alwx alwx commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Enhancement

📜 Description

Flip the default consumption path for sentry-cocoa from CocoaPods source build to Swift Package Manager binary xcframework, on React Native >= 0.75. On older RN where the SPM helper isn't available, transparently fall back to the existing CocoaPods source build — no breaking change for the supported RN range.

Override env var still respected:

  • SENTRY_USE_SPM=0 — force CocoaPods.
  • SENTRY_USE_SPM=1 — force SPM (errors if helper missing).

💡 Motivation and Context

💚 How did you test it?

📝 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

On React Native >= 0.75, RNSentry now pulls Sentry as a pre-built binary
xcframework through the SPM helper exposed by `react_native_pods.rb`,
instead of building Sentry from source as a CocoaPod. On older RN versions
the SPM helper is unavailable and RNSentry transparently falls back to the
CocoaPods source build.

Override the choice with `SENTRY_USE_SPM=0` (force CocoaPods) or
`SENTRY_USE_SPM=1` (require SPM; errors if the helper is unavailable).

Sample-application CI gets one extra `sentry-consumption: cocoapods` job
on the production iOS build to keep the fallback path covered. Clang-format
script gets a `DerivedData/**` exclusion so the SPM-fetched xcframework
headers don't appear in the lint scope.

Refs: #5780

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • feat(ios): Default to consuming sentry-cocoa via SPM by alwx in #6381
  • fix(e2e): Remove dead OSSRH snapshots repo from RN 0.71 Gradle plugin by antonis in #6387
  • chore(deps): update JavaScript SDK to v10.63.0 by github-actions in #6388
  • chore(e2e): Update Expo sample to SDK 57 by antonis in #6385
  • chore: Auto-request mobile team review on public API changes by antonis in #6383
  • fix(replay): Forward Session Replay network detail options to native SDKs by antonis in #6373
  • fix(ci): Pin Android E2E emulator to build 15679343 (37.1.5.0) by antonis in #6378
  • feat(core): Expose top-level Sentry.setAttribute / setAttributes by antonis in #6354
  • docs: Add AI Use section to CONTRIBUTING.md by christophaigner in #6374
  • feat(replay): Default networkCaptureBodies to true by alwx in #6372
  • chore(deps): bump getsentry/craft from 2.26.10 to 2.26.13 by dependabot in #6368
  • chore(deps): bump getsentry/github-workflows/danger from 17cc15eb58ea3687cd8f2714a4192dcee4aa09ef to 4013fc6e1aeb1be1f9d3b4d232624f0ec1afa613 by dependabot in #6366
  • chore(deps): bump getsentry/github-workflows/validate-pr from 71588ddf95134f804e82c5970a8098588e2eaecd to 4013fc6e1aeb1be1f9d3b4d232624f0ec1afa613 by dependabot in #6364
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.26.10 to 2.26.13 by dependabot in #6367
  • feat(core): Wire TurboModulePerfLogger on iOS and Android by alwx in #6307
  • chore(deps): bump actions/cache from 4 to 6 by dependabot in #6365
  • chore(deps): update CLI to v3.6.0 by github-actions in #6362
  • chore(deps): bump faraday from 1.10.5 to 1.10.6 in /samples/react-native by dependabot in #6363
  • chore(deps): update JavaScript SDK to v10.62.0 by github-actions in #6361
  • Expo Router ErrorBoundary auto wrapped by alwx in #6347
  • chore(ci): Move sample app iOS build jobs to GitHub Actions runners by itaybre in #6356
  • docs: Add missing 8.14.1 to changelog and SDK versions table by antonis in #6360
  • chore(deps): update Android SDK to v8.46.0 by github-actions in #6357
  • chore(ci): Move testflight and size-analysis iOS jobs to GitHub Actions macos-26 by itaybre in #6355

Plus 1 more


🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Jun 30, 2026

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

Generated by 🚫 dangerJS against 347198e

@alwx

alwx commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c8143aa. Configure here.

@alwx alwx marked this pull request as ready for review July 1, 2026 13:19
@alwx

alwx commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

It would probably be nice to include it to the next release but no stress

@antonis antonis added the ready-to-merge Triggers the full CI test suite label Jul 1, 2026
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
@sentry

sentry Bot commented Jul 1, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.16.0 (94) Release

⚙️ sentry-react-native Build Distribution Settings

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 430.81 ms 456.06 ms 25.25 ms
Size 49.74 MiB 55.09 MiB 5.34 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
4e0ba9c+dirty 421.39 ms 455.80 ms 34.41 ms
3ce5254+dirty 373.90 ms 427.84 ms 53.94 ms
3d377b5+dirty 425.38 ms 440.67 ms 15.30 ms
9474ead+dirty 432.18 ms 481.92 ms 49.73 ms
7887847+dirty 420.47 ms 460.55 ms 40.08 ms
5a21b51+dirty 505.16 ms 539.20 ms 34.04 ms
4966363+dirty 415.67 ms 448.60 ms 32.93 ms
23598c3+dirty 371.92 ms 420.65 ms 48.74 ms
1a2e7e0+dirty 451.98 ms 501.50 ms 49.52 ms
f170ec3+dirty 505.96 ms 551.88 ms 45.92 ms

App size

Revision Plain With Sentry Diff
4e0ba9c+dirty 48.30 MiB 53.49 MiB 5.19 MiB
3ce5254+dirty 43.94 MiB 48.98 MiB 5.04 MiB
3d377b5+dirty 43.94 MiB 49.00 MiB 5.06 MiB
9474ead+dirty 48.30 MiB 53.61 MiB 5.30 MiB
7887847+dirty 49.74 MiB 54.81 MiB 5.07 MiB
5a21b51+dirty 48.30 MiB 53.49 MiB 5.19 MiB
4966363+dirty 48.30 MiB 53.54 MiB 5.24 MiB
23598c3+dirty 43.94 MiB 49.02 MiB 5.08 MiB
1a2e7e0+dirty 49.74 MiB 54.82 MiB 5.07 MiB
f170ec3+dirty 48.30 MiB 53.57 MiB 5.26 MiB

@antonis antonis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall LGTM other than the failed checks and the changelog suggestions to highlight that this might be a breaking change for some users. Maybe we can even add a warning at the top (e.g. like iOS does here).

@antonis

antonis commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Overall LGTM other than the failed checks and the changelog suggestions to highlight that this might be a breaking change for some users. Maybe we can even add a warning at the top (e.g. like iOS does here).

We can probably also add a link to the new doc that is part of #6174

… hatch

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@alwx alwx requested a review from antonis July 1, 2026 15:13
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 492.84 ms 522.94 ms 30.09 ms
Size 49.74 MiB 55.09 MiB 5.34 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
eb93136+dirty 416.18 ms 467.32 ms 51.14 ms
5a010b7+dirty 425.62 ms 469.38 ms 43.76 ms
0b1b5e3+dirty 416.42 ms 470.58 ms 54.16 ms
4e0ba9c+dirty 452.84 ms 473.36 ms 20.52 ms
c151573+dirty 530.34 ms 559.43 ms 29.09 ms
a0d8cf8+dirty 411.71 ms 467.57 ms 55.87 ms
5a23c47+dirty 423.85 ms 466.47 ms 42.62 ms
20fbd51+dirty 487.89 ms 535.60 ms 47.71 ms
0d9949d+dirty 403.57 ms 437.00 ms 33.43 ms
a50b33d+dirty 500.81 ms 532.11 ms 31.30 ms

App size

Revision Plain With Sentry Diff
eb93136+dirty 48.30 MiB 53.58 MiB 5.28 MiB
5a010b7+dirty 48.30 MiB 53.58 MiB 5.28 MiB
0b1b5e3+dirty 48.30 MiB 53.60 MiB 5.29 MiB
4e0ba9c+dirty 48.30 MiB 53.49 MiB 5.19 MiB
c151573+dirty 48.30 MiB 53.54 MiB 5.24 MiB
a0d8cf8+dirty 48.30 MiB 53.49 MiB 5.19 MiB
5a23c47+dirty 49.74 MiB 54.82 MiB 5.07 MiB
20fbd51+dirty 49.74 MiB 54.81 MiB 5.07 MiB
0d9949d+dirty 43.75 MiB 48.13 MiB 4.37 MiB
a50b33d+dirty 43.75 MiB 48.08 MiB 4.33 MiB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants