Skip to content

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

Draft
alwx wants to merge 1 commit into
mainfrom
alwx/feature/spm-by-default
Draft

feat(ios): Default to consuming sentry-cocoa via SPM#6381
alwx wants to merge 1 commit 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

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(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
  • feat(core): Use native btoa for envelope base64 encoding by alwx in #6351

🤖 This preview updates automatically when you update the PR.

@github-actions

Copy link
Copy Markdown
Contributor
Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- Default to consuming sentry-cocoa via SPM ([#6381](https://github.com/getsentry/sentry-react-native/pull/6381))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against c8143aa

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.

1 participant