8000 Replace all Foundation imports with FoundationEssentials by Lukasa · Pull Request #363 · apple/swift-crypto · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Replace all Foundation imports with FoundationEssentials #363

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 10000 on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 18, 2025

Conversation

Lukasa
Copy link
Contributor
@Lukasa Lukasa commented Jun 17, 2025

Motivation:

FoundationEssentials produces smaller binaries on most platforms.

Modifications:

Where FoundationEssentials is available, import that.

Result:

Improved binary size

@Lukasa Lukasa added the ⚠️ semver/major Breaks existing public API. label Jun 17, 2025
@@ -18,8 +18,12 @@
#if CRYPTOKIT_NO_ACCESS_TO_FOUNDATION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking: does CRYPTOKIT_NO_ACCESS_TO_FOUNDATION imply no access to FoundationEssentials either?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does.

Comment on lines 27 to +28
#else
#if canImport(FoundationEssentials)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason we shouldn't use #elseif to avoid the extra nesting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really didn't want to think that hard about it, honestly, as we had to change a good 150 files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair

@Lukasa Lukasa merged commit 83a1500 into apple:wwdc-25 Jun 18, 2025
28 of 30 checks passed
@Lukasa Lukasa deleted the cb-replace-foundation-with-essentials branch June 18, 2025 14:59
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
0