SPM Support
:scroll: Description
Migration: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors#how-to-add-swift-package-manager-support-to-an-existing-flutter-plugin
Enable SPM: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors#how-to-turn-on-swift-package-manager
- [x] Setup iOS project for SPM
- [x] Setup macOS project for SPM
- [ ] Update plugin to import Hybrid SDK for Pods & SPM
:bulb: Motivation and Context
Closes #2250
:green_heart: How did you test it?
:pencil: Checklist
- [ ] I reviewed submitted code
- [ ] I added tests to verify changes
- [ ] No new PII added or SDK only sends newly added PII if
sendDefaultPiiis enabled - [ ] I updated the docs if needed
- [ ] All tests passing
- [ ] No breaking changes
:crystal_ball: Next steps
- [ ] BLOCKED: We need to expose the coco HybridSDK through SPM. For now only CocoaPods is supported.
- [ ] Blocked by https://github.com/getsentry/sentry-cocoa/pull/4384
| 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 124590fb31975559abfbed1af42ad8d80001c8bc
Android Performance metrics :rocket:
| Plain | With Sentry | Diff | |
|---|---|---|---|
| Startup time | 447.22 ms | 533.02 ms | 85.80 ms |
| Size | 6.46 MiB | 7.48 MiB | 1.03 MiB |
Baseline results on branch: main
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8ced2dc3a0ab7c8f70f4a0f0449ce528b924b96f | 295.58 ms | 336.49 ms | 40.91 ms |
| 9f0564597080b17641f12febbf727661f7d1389f | 349.43 ms | 437.24 ms | 87.81 ms |
| 3adbea907f8c71f0046e66eed0d4206d1d2a8043 | 395.16 ms | 447.88 ms | 52.71 ms |
| f7351674022193f3069898079fbdbef0656a686e | 404.38 ms | 412.57 ms | 8.19 ms |
| 6a5a65d1390ef72425d385815fbfb4c1b03ced8d | 410.26 ms | 503.91 ms | 93.65 ms |
| 33d0587b190ef0de4ccf9e1e0f2623ffaa76cd2a | 308.79 ms | 370.86 ms | 62.07 ms |
| 6d317ea0c2dcfba0d8300bc7693d2dc292486d01 | 303.46 ms | 356.06 ms | 52.60 ms |
| 256df44bb670822fc3087877f775a3d82bb476b0 | 447.58 ms | 485.84 ms | 38.25 ms |
| ed605cc8cb29d2ad5e88f0e5f50e5214560a7240 | 317.48 ms | 374.24 ms | 56.76 ms |
| 3d305b96e5469a711cd2c67191b28bbcd997ca41 | 403.55 ms | 469.76 ms | 66.20 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8ced2dc3a0ab7c8f70f4a0f0449ce528b924b96f | 6.06 MiB | 7.03 MiB | 990.29 KiB |
| 9f0564597080b17641f12febbf727661f7d1389f | 6.27 MiB | 7.20 MiB | 958.60 KiB |
| 3adbea907f8c71f0046e66eed0d4206d1d2a8043 | 6.52 MiB | 7.61 MiB | 1.09 MiB |
| f7351674022193f3069898079fbdbef0656a686e | 6.46 MiB | 7.48 MiB | 1.01 MiB |
| 6a5a65d1390ef72425d385815fbfb4c1b03ced8d | 6.35 MiB | 7.41 MiB | 1.05 MiB |
| 33d0587b190ef0de4ccf9e1e0f2623ffaa76cd2a | 6.16 MiB | 7.14 MiB | 1007.47 KiB |
| 6d317ea0c2dcfba0d8300bc7693d2dc292486d01 | 5.94 MiB | 6.92 MiB | 1001.74 KiB |
| 256df44bb670822fc3087877f775a3d82bb476b0 | 6.52 MiB | 7.59 MiB | 1.06 MiB |
| ed605cc8cb29d2ad5e88f0e5f50e5214560a7240 | 6.06 MiB | 7.03 MiB | 993.53 KiB |
| 3d305b96e5469a711cd2c67191b28bbcd997ca41 | 6.35 MiB | 7.35 MiB | 1021.16 KiB |
Previous results on branch: feat/spm
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5f38dda43d6089d75ecfa04ec72dd6d921adb849 | 432.24 ms | 529.78 ms | 97.54 ms |
| 8adbf8ea65785d1dc3232c5d3f24ce5e693ccf2a | 481.79 ms | 530.56 ms | 48.77 ms |
| cf145b9758cbc4c04b97de43058981b37aa40794 | 449.38 ms | 538.56 ms | 89.18 ms |
| 160e5a5a1d19fb23eebee4cf52d1543819629601 | 460.87 ms | 509.56 ms | 48.69 ms |
| acc2ff0991fa2e01cf27a46082612cd8a8f8743b | 470.52 ms | 510.29 ms | 39.77 ms |
| a4e2e384b91413394e50796a5313ead53ec53908 | 459.34 ms | 506.62 ms | 47.28 ms |
| b2ebcf57b31ccb471c62307818d9261b684f15cb | 477.96 ms | 578.92 ms | 100.96 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5f38dda43d6089d75ecfa04ec72dd6d921adb849 | 6.46 MiB | 7.48 MiB | 1.02 MiB |
| 8adbf8ea65785d1dc3232c5d3f24ce5e693ccf2a | 6.49 MiB | 7.55 MiB | 1.07 MiB |
| cf145b9758cbc4c04b97de43058981b37aa40794 | 6.46 MiB | 7.48 MiB | 1.01 MiB |
| 160e5a5a1d19fb23eebee4cf52d1543819629601 | 6.49 MiB | 7.57 MiB | 1.08 MiB |
| acc2ff0991fa2e01cf27a46082612cd8a8f8743b | 6.49 MiB | 7.57 MiB | 1.08 MiB |
| a4e2e384b91413394e50796a5313ead53ec53908 | 6.49 MiB | 7.57 MiB | 1.08 MiB |
| b2ebcf57b31ccb471c62307818d9261b684f15cb | 6.46 MiB | 7.48 MiB | 1.02 MiB |
iOS Performance metrics :rocket:
| Plain | With Sentry | Diff | |
|---|---|---|---|
| Startup time | 1258.35 ms | 1277.06 ms | 18.71 ms |
| Size | 8.42 MiB | 9.89 MiB | 1.47 MiB |
Baseline results on branch: main
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7954fb356f96f17127c41230af433bc9ce01233c | 1247.20 ms | 1272.15 ms | 24.94 ms |
| 8ced2dc3a0ab7c8f70f4a0f0449ce528b924b96f | 1258.35 ms | 1272.98 ms | 14.62 ms |
| d0312c9616494d7365a21482a4564461e3bbd14d | 1205.55 ms | 1224.45 ms | 18.90 ms |
| 25e9b5900ecb2ddc682fe68375964943fe087595 | 1289.76 ms | 1295.27 ms | 5.51 ms |
| 754cdbe8e837db0c3e8d6cebf13feee66f651444 | 1261.67 ms | 1280.88 ms | 19.20 ms |
| e3ef57098845edc69a00ce9b4845b54351beccbf | 1220.08 ms | 1239.66 ms | 19.58 ms |
| f275487b349060e5e84df5d00e3c98d0b8a7cc68 | 1291.65 ms | 1339.92 ms | 48.26 ms |
| cecd4ed8dfd86177cc44e93236d7cbea68fcfeeb | 1232.88 ms | 1250.65 ms | 17.78 ms |
| 6d317ea0c2dcfba0d8300bc7693d2dc292486d01 | 1277.27 ms | 1287.47 ms | 10.20 ms |
| c1bb00f9a9935da3f990e1bbef4469c6bfe843f2 | 1265.14 ms | 1290.85 ms | 25.71 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7954fb356f96f17127c41230af433bc9ce01233c | 8.38 MiB | 9.75 MiB | 1.37 MiB |
| 8ced2dc3a0ab7c8f70f4a0f0449ce528b924b96f | 8.10 MiB | 9.16 MiB | 1.07 MiB |
| d0312c9616494d7365a21482a4564461e3bbd14d | 8.32 MiB | 9.39 MiB | 1.06 MiB |
| 25e9b5900ecb2ddc682fe68375964943fe087595 | 8.16 MiB | 9.15 MiB | 1021.15 KiB |
| 754cdbe8e837db0c3e8d6cebf13feee66f651444 | 8.29 MiB | 9.37 MiB | 1.08 MiB |
| e3ef57098845edc69a00ce9b4845b54351beccbf | 8.32 MiB | 9.38 MiB | 1.06 MiB |
| f275487b349060e5e84df5d00e3c98d0b8a7cc68 | 8.32 MiB | 9.38 MiB | 1.05 MiB |
| cecd4ed8dfd86177cc44e93236d7cbea68fcfeeb | 8.38 MiB | 9.75 MiB | 1.37 MiB |
| 6d317ea0c2dcfba0d8300bc7693d2dc292486d01 | 8.15 MiB | 9.12 MiB | 986.26 KiB |
| c1bb00f9a9935da3f990e1bbef4469c6bfe843f2 | 8.09 MiB | 9.07 MiB | 1001.06 KiB |
Previous results on branch: feat/spm
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| acc2ff0991fa2e01cf27a46082612cd8a8f8743b | 1223.71 ms | 1233.08 ms | 9.37 ms |
| cf145b9758cbc4c04b97de43058981b37aa40794 | 1253.06 ms | 1261.96 ms | 8.90 ms |
| b2ebcf57b31ccb471c62307818d9261b684f15cb | 1230.84 ms | 1260.41 ms | 29.57 ms |
| 8adbf8ea65785d1dc3232c5d3f24ce5e693ccf2a | 1258.88 ms | 1281.85 ms | 22.97 ms |
| 5f38dda43d6089d75ecfa04ec72dd6d921adb849 | 1259.00 ms | 1276.92 ms | 17.92 ms |
| a4e2e384b91413394e50796a5313ead53ec53908 | 1234.78 ms | 1256.79 ms | 22.01 ms |
| 160e5a5a1d19fb23eebee4cf52d1543819629601 | 1250.08 ms | 1277.88 ms | 27.79 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| acc2ff0991fa2e01cf27a46082612cd8a8f8743b | 8.38 MiB | 9.75 MiB | 1.37 MiB |
| cf145b9758cbc4c04b97de43058981b37aa40794 | 8.42 MiB | 9.86 MiB | 1.43 MiB |
| b2ebcf57b31ccb471c62307818d9261b684f15cb | 8.42 MiB | 9.89 MiB | 1.46 MiB |
| 8adbf8ea65785d1dc3232c5d3f24ce5e693ccf2a | 8.38 MiB | 9.73 MiB | 1.36 MiB |
| 5f38dda43d6089d75ecfa04ec72dd6d921adb849 | 8.42 MiB | 9.86 MiB | 1.44 MiB |
| a4e2e384b91413394e50796a5313ead53ec53908 | 8.38 MiB | 9.75 MiB | 1.37 MiB |
| 160e5a5a1d19fb23eebee4cf52d1543819629601 | 8.38 MiB | 9.75 MiB | 1.37 MiB |
🚨 Detected changes in high risk code 🚨
High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
- [ ] flutter/ios/Classes/SentryFlutterPluginApple.swift
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.63%. Comparing base (
ea6d86d) to head (124590f). Report is 1 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #2280 +/- ##
==========================================
+ Coverage 88.98% 92.63% +3.65%
==========================================
Files 262 91 -171
Lines 8966 3013 -5953
==========================================
- Hits 7978 2791 -5187
+ Misses 988 222 -766
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Detected changes in high risk code 🚨
High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
- [ ] flutter/ios/Classes/SentryFlutterPluginApple.swift
🚨 Detected changes in high risk code 🚨
High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
- [ ] flutter/ios/Classes/SentryFlutterPluginApple.swift
🚨 Detected changes in high risk code 🚨
High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
- [ ] flutter/ios/Classes/SentryFlutterPluginApple.swift
🚨 Detected changes in high risk code 🚨
High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
- [ ] flutter/ios/Classes/SentryFlutterPluginApple.swift
🚨 Detected changes in high risk code 🚨
High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
- [ ] flutter/ios/Classes/SentryFlutterPluginApple.swift
🚨 Detected changes in high risk code 🚨
High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
- [ ] flutter/ios/Classes/SentryFlutterPluginApple.swift
@buenaflor Works with SPM, but we still need to wait until sentry-cocoa is out of beta.
@buenaflor sentry-cocoa with SPM support is now release. [Flutter 3.27] with SPM support also has landed.
@buenaflor Sure, don't want to mess with releases before the holidays. :) Tested it on a new project, works without CocoaPods.
\cc @ueman 👀
I'm currently unable to test this. I'm right between jobs at the moment, so I don't have access to a code base which uses Sentry. (No clue whether the new one uses Sentry 😐) But it looks similar to a SPM migration in one of my packages and that didn't get any bug reports yet.
@ueman Thanks for the feedback and congrats on the new job! :)
@denrase I think we can merge this, pls update the branch