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

Road to a Swift only SDK

Open philipphofmann opened this issue 1 year ago • 0 comments

Description

With 8.21.0, we changed our SDK setup to mix Swift and ObjC code in our code base. For more details check our internal develop docs and a decision log entry.

While we don't have a major refactoring plan for converting all ObjC code to Swift, we try to convert ObjC to Swift on the go and write new code in Swift when possible. Certain features, such as SentryCrash, profiling, our swizzling code, and more, aren't easily convertible to Swift or impossible to convert. With the Swift foundation project and other projects such as Swift Vapor, it makes sense to drive our SDK towards offering a Swift-only SDK with a limited feature set. A lightweight SDK with only a client, hub, and transport to capture errors, maybe spans, and transactions could be enough. To make this happen, we could split up the SDK into a core Swift package and one to multiple other packages. The default sentry-cocoa SDK could still have the full feature set.

Another big advantage of using Swift over ObjC is that Swift is designed for safety, so it should increase the stability of the SDK in the long run.

Please upvote if you would like to have a Sentry Swift-only SDK.

philipphofmann avatar Mar 21 '24 13:03 philipphofmann