sentry-cocoa icon indicating copy to clipboard operation
sentry-cocoa copied to clipboard

Expose `HybridSDK` from `Sentry` framework

Open denrase opened this issue 1 year ago • 4 comments

:scroll: Description

We want to support SPM in our sentry flutter framework. In order to do this, we need the SentryHybridSDK classes, which we expose though Cocoapods, to also be available in our SPM package.

This PR adds an explicit module with the hybrid headers, except "SentryEnvelope.h".

:bulb: Motivation and Context

Unblocks https://github.com/getsentry/sentry-dart/pull/2280

:green_heart: How did you test it?

:pencil: Checklist

You have to check all boxes before merging:

  • [x] I reviewed the submitted code.
  • [ ] I added tests to verify the changes.
  • [ ] No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • [ ] I updated the docs if needed.
  • [ ] Review from the native team if needed.
  • [x] No breaking change or entry added to the changelog.
  • [x] No breaking change for hybrid SDKs or communicated to hybrid SDKs.

denrase avatar Oct 15 '24 10:10 denrase

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 a4bca184fe361f89315f7fdd2b16a31413e17ba4

github-actions[bot] avatar Oct 15 '24 11:10 github-actions[bot]

Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 1229.77 ms 1255.90 ms 26.13 ms
Size 22.30 KiB 730.75 KiB 708.45 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
879fb28ba31f00157b8728013941870f4f0f4f6c 1243.18 ms 1255.98 ms 12.80 ms
98752f38221b7244ce958ab08fc00908ba3de694 1226.18 ms 1251.38 ms 25.20 ms
e0904ef6b8b510e9739820aa29379b074b26e237 1231.85 ms 1252.38 ms 20.53 ms
3f6c30b04dc2377110490170c382b92ae85ee9a6 1252.98 ms 1266.22 ms 13.24 ms
26530fec80489397091f307088e6a03644cf5efd 1233.98 ms 1250.06 ms 16.08 ms
742d4b693cfd3cf2b7b1d62930d16daaf505d367 1196.56 ms 1216.54 ms 19.98 ms
8b1c6a90b399ed69ca52a3b97802c5667ee8153c 1216.92 ms 1230.90 ms 13.98 ms
643853e695fb398478c6af8c0c060b8fde9b3744 1225.75 ms 1247.00 ms 21.25 ms
8e76be4558a9e15fe63841bbb98faec7d921f24e 1272.67 ms 1286.38 ms 13.71 ms
dacf894bd3ce125f76ea565dbc543db3da8bf94d 1223.96 ms 1250.41 ms 26.45 ms

App size

Revision Plain With Sentry Diff
879fb28ba31f00157b8728013941870f4f0f4f6c 22.84 KiB 402.88 KiB 380.03 KiB
98752f38221b7244ce958ab08fc00908ba3de694 20.76 KiB 435.09 KiB 414.33 KiB
e0904ef6b8b510e9739820aa29379b074b26e237 21.58 KiB 614.64 KiB 593.06 KiB
3f6c30b04dc2377110490170c382b92ae85ee9a6 22.85 KiB 408.88 KiB 386.03 KiB
26530fec80489397091f307088e6a03644cf5efd 21.58 KiB 714.93 KiB 693.35 KiB
742d4b693cfd3cf2b7b1d62930d16daaf505d367 21.58 KiB 546.20 KiB 524.62 KiB
8b1c6a90b399ed69ca52a3b97802c5667ee8153c 21.58 KiB 706.97 KiB 685.38 KiB
643853e695fb398478c6af8c0c060b8fde9b3744 21.58 KiB 655.73 KiB 634.15 KiB
8e76be4558a9e15fe63841bbb98faec7d921f24e 20.76 KiB 427.66 KiB 406.89 KiB
dacf894bd3ce125f76ea565dbc543db3da8bf94d 20.76 KiB 426.34 KiB 405.58 KiB

Previous results on branch: feat/hybrid-sdk-private-modulemap

Startup times

Revision Plain With Sentry Diff
3dc0c00e86a8aea6d3407511a5098e4e5042dcbb 1235.20 ms 1250.67 ms 15.47 ms
6b9410696a320fcf8e72c3adc1de8fb334b5c5ae 1232.12 ms 1253.14 ms 21.02 ms
440380a6298b1ce30a2a39891ba2e7e649076744 1233.94 ms 1251.60 ms 17.66 ms
5ddaad1d40a60a83a6bae2e3482d1c0d5d7a9535 1234.75 ms 1252.96 ms 18.21 ms
25f6d46a5ec5ce42fb0eac65c357b6a16b5d4681 1238.86 ms 1258.98 ms 20.12 ms

App size

Revision Plain With Sentry Diff
3dc0c00e86a8aea6d3407511a5098e4e5042dcbb 21.90 KiB 726.90 KiB 705.00 KiB
6b9410696a320fcf8e72c3adc1de8fb334b5c5ae 21.90 KiB 726.89 KiB 704.99 KiB
440380a6298b1ce30a2a39891ba2e7e649076744 21.90 KiB 708.33 KiB 686.43 KiB
5ddaad1d40a60a83a6bae2e3482d1c0d5d7a9535 21.90 KiB 730.10 KiB 708.20 KiB
25f6d46a5ec5ce42fb0eac65c357b6a16b5d4681 22.30 KiB 730.10 KiB 707.80 KiB

github-actions[bot] avatar Oct 15 '24 11:10 github-actions[bot]

@philipphofmann Maybe it's enough to mark the headers in question as package private, wdyt?

denrase avatar Oct 15 '24 11:10 denrase

We will need a test workflow of sample using PrivateSentrySDKOnly from Swift, so we make sure to not break it.

brustolin avatar Oct 15 '24 12:10 brustolin

Closed in favor of https://github.com/getsentry/sentry-cocoa/pull/4486

denrase avatar Oct 29 '24 16:10 denrase

@brustolin @philipphofmann Turns our we do need the explicit module after all to import the needed files in Flutter when integrating through SPM. Therefore i reopened this PR.

denrase avatar Nov 06 '24 13:11 denrase

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.575%. Comparing base (d9f518a) to head (a4bca18). Report is 7 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4440       +/-   ##
=============================================
+ Coverage   91.566%   91.575%   +0.008%     
=============================================
  Files          615       615               
  Lines        69701     69689       -12     
  Branches     24967     24957       -10     
=============================================
- Hits         63823     63818        -5     
+ Misses        5787      5779        -8     
- Partials        91        92        +1     
Files with missing lines Coverage Δ
...tions/SessionReplay/SentrySessionReplayTests.swift 98.870% <100.000%> (ø)

... and 9 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d9f518a...a4bca18. Read the comment docs.

codecov[bot] avatar Nov 11 '24 11:11 codecov[bot]