-
Notifications
You must be signed in to change notification settings - Fork 464
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
Provide a way to generate files that only import FoundationEssentials
and conditionalize all Foundation
imports
#1756
Comments
Does a Swift version also come into play? Or does |
The |
Is there a good listing of what is in/out of FoundationEssentials? https://github.com/swiftlang/swift-foundation?tab=readme-ov-file#swift-foundation just lists a few and ends with and more which isn't that helpful. My initial thought is we probably only make use of |
I just landed this PR swiftlang/swift-foundation#1178 . So hopefully the documentation shows up on the Swift Package Index soon. This should help you see what types are part of |
Looks like docs are now live: https://swiftpackageindex.com/swiftlang/swift-foundation/main/documentation/foundationessentials |
Will this count as a breaking change since someone importing SwiftProtobuf or a module that had generated proto code, indirectly was getting Foundation? |
Did a quick search/replace on the runtime to try the saw, and a few things trip it up, so I think that means, we'd have to find a way to replace those things, otherwise, there wouldn't be any real wins. Failure: https://github.com/apple/swift-protobuf/actions/runs/13506421799/job/37736916317?pr=1758 Issues:
|
FoundationEssentials
allows to import just a small subset ofFoundation
on non-Darwin platforms. This has a great impact on binary size. The current recommended way to do this is this pattern:We need to update our generator to support this and audit all of our current Foundation imports. As a first step it would be good to understand if we rely on anything from
Foundation
that is not inFoundationEssentials
.The text was updated successfully, but these errors were encountered: