Skip to content

import FoundationEssentials instead of Foundation when available#798

Closed
t089 wants to merge 1 commit intoswift-server:mainfrom
t089:foundation-essentials
Closed

import FoundationEssentials instead of Foundation when available#798
t089 wants to merge 1 commit intoswift-server:mainfrom
t089:foundation-essentials

Conversation

@t089
Copy link
Contributor

@t089 t089 commented Dec 27, 2024

This PR replaces import Foundation with import FoundationEssentials when available.

Linking Foundation on Linux comes with a significant binary size increase due to the included icu data. None of this is necessary for the HTTP client. Instead we can use FoundationEssentials to get access to the essential types like URL, Data, Date, ... without including icu data.

According to @Lukasa, sadly, this might be a semver major change. :(

@Lukasa
Copy link
Collaborator

Lukasa commented Dec 30, 2024

Indeed it is. See apple/swift-crypto#317 for the full discussion.

@Lukasa Lukasa added the ⚠️ semver/major Breaks existing public API. label Dec 30, 2024
@madsodgaard
Copy link
Contributor

Hey @t089 - with the recent announcement from ESG about adopting FoundationEssentials, we can actually get this PR merged in.

Are you up for bringing the PR up to date and getting it submitted? Otherwise I can also do it, if you don't have the time 👍

@t089 t089 closed this Mar 3, 2026
@t089
Copy link
Contributor Author

t089 commented Mar 3, 2026

@madsodgaard please feel free to open a new PR :) Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚠️ semver/major Breaks existing public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants