-
-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto Performance Monitoring for SwiftUI #1737
Comments
SwiftUI generates the UIViewControllers for SwiftUI views during runtime. It does that between For a work in progress branch checkout https://github.com/getsentry/sentry-cocoa/tree/feat/swift-ui-performance. Internal Notion page. |
SwiftUI view are not really UI elements, its more like a description on what the screen should looks like. Thats why we can't manipulate Views directly. And all the code responsible to convert View into UIViews is private. If we try to manipulate it, we may cause apps to be rejected during review. The alternative is to create a Root View or a view modifier that tracks its children performance. Of course, this will no be an automatic solution, the user must actively use this. Also, we need to create an extra package for this. Im convinced that we should not include Swift code in the SDK. |
An update on some findings
|
Current ChallengesWhile working on this issue, we identified many new challenges that we did not face before. Adding SwiftFirst, to be able to build SwiftUI performance monitoring, we need Swift code on the Sentry SDK. Challenges we face for that:
Distribution with Package ManagersWe use 3 different ways to distribute the Sentry framework: Swift Package Manager (SPM), CocoaPods, and Carthage.
SwiftUI Performance MonitoringOnce we have Swift in our codebase, we can talk about how we gonna introduce SwiftUI performance monitoring. While there are multiple ideas on what we can achieve, the first step is a wrapper view that will be explicitly used in the UI for tracking the performance of SwiftUI views. On a pair programming session with @philipphofmann, we identified that by including this wrapper view in our Sentry SDK, every project that uses the Sentry Cocoa SDK would also load the SwiftUI framework at runtime, even if they don't use it. This is unacceptable, as the SwiftUI framework is quite large (around 25 MB); we don't want to do this. The proposal is to create another library for those project that uses SwiftUI. This extra library introduces more challenges.
|
@brustolin, please explain why you closed this issue and add the PR(s) completing this issue. |
Looks like it was added in #2271? |
Description
With #1242 we disabled swizzling UIViewControllers generated by SwiftUI because they have long confusing names. @brustolin had an idea of how to make sense of these names. If we can extract some meaningful information out of these names, we could enable APM for SwiftUI again.
This is part of a general SwiftUI support improvement:
The text was updated successfully, but these errors were encountered: