getsentry / getsentry/sentry-cocoa

Road to Swift SDK / Server-Side Swift Support

Open
#3,780 1 comment 21 reactions 0 assignees View on GitHub
Cocoa Traces
Dominant language
Swift
Stars
1.1k
Forks
418
Avg merge
2d 3h
Merged PRs (30d)
106

Description

### 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](https://github.com/getsentry/sentry-cocoa/tree/main/develop-docs#swift-and-objective-c-interoperability) and a [decision log entry](https://github.com/getsentry/sentry-cocoa/blob/main/develop-docs/DECISIONS.md#removing-sentryprivate-).

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](https://github.com/apple/swift-foundation) and other projects such as [Swift Vapor](https://vapor.codes/), 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](https://developer.apple.com/swift/#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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.