Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

### Features

- Opt-in: consume sentry-cocoa via Swift Package Manager. Set `SENTRY_USE_SPM=1` before `pod install` to pull `Sentry` from sentry-cocoa's SPM package as a binary xcframework instead of the CocoaPods source build. Requires React Native >= 0.75. Default behavior (CocoaPods) is unchanged. ([#TBD](https://github.com/getsentry/sentry-react-native/pull/TBD))
- Multi-instance `<TimeToInitialDisplay>` / `<TimeToFullDisplay>` coordination ([#6090](https://github.com/getsentry/sentry-react-native/pull/6090))
- New `ready` prop. When a screen has multiple async data sources, mount one `<TimeToFullDisplay ready={...} />` per source — TTID/TTFD is recorded only when every instance reports `ready === true`.
- The existing `record` prop is unchanged BUT it is now deprecated in favor of `ready`.
Expand Down
24 changes: 23 additions & 1 deletion packages/core/RNSentry.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,29 @@
'DEFINES_MODULE' => 'YES'
}

s.dependency 'Sentry', '9.13.0'
# Opt-in to consuming sentry-cocoa via Swift Package Manager.
# When `SENTRY_USE_SPM=1` is set, RNSentry pulls `Sentry` from the
# sentry-cocoa SPM package as a binary xcframework instead of from
# the Sentry CocoaPods source build. Defaults to CocoaPods consumption
# for backward compatibility with the full RN version range we support.
#
# Requires React Native >= 0.75 because the SPM helper
# (`react-native/scripts/cocoapods/spm.rb`) is loaded transitively from
# the Podfile via `react_native_pods.rb`.
if ENV['SENTRY_USE_SPM'] == '1'
unless defined?(SPM) && SPM.respond_to?(:dependency)
raise 'SENTRY_USE_SPM=1 is set but the SPM helper is not loaded. ' \
'This requires React Native >= 0.75 and a Podfile that imports ' \
'react_native_pods.rb.'
end
SPM.dependency(s,
url: 'https://github.com/getsentry/sentry-cocoa',
requirement: { kind: 'exactVersion', version: '9.13.0' },

Check warning on line 70 in packages/core/RNSentry.podspec

View check run for this annotation

@sentry/warden / warden: code-review

SPM path pins version 9.13.0 which is missing `SentrySessionReplayHybridSDK`, causing a linker failure for any app using Session Replay

The `SentrySessionReplayHybridSDK` symbol—actively referenced in `RNSentryReplayBreadcrumbConverter.m`—is absent from the sentry-cocoa 9.13.0 xcframework (getsentry/sentry-cocoa#7911). Any project that sets `SENTRY_USE_SPM=1` and has Session Replay enabled will fail to link, with no code-level warning surfaced at `pod install` time. Consider either raising an explicit error when `SENTRY_USE_SPM=1` is set (pointing users to wait for the fixed release) or documenting the minimum fixed version in the guard so the pin is updated atomically when the cocoa fix ships.
Comment on lines +65 to +70
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SPM path pins version 9.13.0 which is missing SentrySessionReplayHybridSDK, causing a linker failure for any app using Session Replay

The SentrySessionReplayHybridSDK symbol—actively referenced in RNSentryReplayBreadcrumbConverter.m—is absent from the sentry-cocoa 9.13.0 xcframework (getsentry/sentry-cocoa#7911). Any project that sets SENTRY_USE_SPM=1 and has Session Replay enabled will fail to link, with no code-level warning surfaced at pod install time. Consider either raising an explicit error when SENTRY_USE_SPM=1 is set (pointing users to wait for the fixed release) or documenting the minimum fixed version in the guard so the pin is updated atomically when the cocoa fix ships.

Verification

Confirmed SentrySessionReplayHybridSDK is called in packages/core/ios/RNSentryReplayBreadcrumbConverter.m (lines 14, 43, 75, 95, 183). The SPM path pins exactVersion: '9.13.0', which the PR body explicitly identifies as having the packaging bug. The CocoaPods path (source build) is unaffected because it compiles from source. No runtime or pod-install-time guard exists in the new code block to catch this for SPM consumers.

Identified by Warden code-review · MTW-NU4

products: ['Sentry']
)
else
s.dependency 'Sentry', '9.13.0'
end

if defined? install_modules_dependencies
# Default React Native dependencies for 0.71 and above (new and legacy architecture)
Expand Down
Loading