Skip to content
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

Can we make NIOFoundationCompat depend on FoundationEssentials? #3038

Open
t089 opened this issue Dec 26, 2024 · 6 comments
Open

Can we make NIOFoundationCompat depend on FoundationEssentials? #3038

t089 opened this issue Dec 26, 2024 · 6 comments
Labels
⚠️ semver/major Breaks existing public API.

Comments

@t089
Copy link
Contributor

t089 commented Dec 26, 2024

Can we make NIOFoundationCompat only depend on FoundationEssentials?

Currently, unfortunately, I don't think we can as it provides convenience methods for types that are only available in full Foundation:

  • JSONSerialization
  • RunLoop

:( Would we need a NIOEssentialsCompat?

@Lukasa
Copy link
Contributor

Lukasa commented Dec 27, 2024

Essentially we can’t, because of the way Swift module imports leak. Until all those leaks are plugged, it is just not possible for us to ever remove an import without a semver major.

@weissi
Copy link
Member

weissi commented Feb 15, 2025

@Lukasa On a second thought with this one: Are there really places that import NIOFoundationCompat but not Foundation out in the real world? I agree that the effect is observable but I think that's a risk worth taking, especially if we communicate it well. (Assuming, of course, that NIOFoundationCompat doesn't depend on anything outside of FoundationEssentials).

@weissi weissi added the ⚠️ semver/major Breaks existing public API. label Feb 15, 2025
@weissi
Copy link
Member

weissi commented Feb 15, 2025

Eh, bad news, in 2021 we introduced an extension to JSONSerialization which is not in FoundationEssentials.

I think this makes it a deal breaker until NIO 3.0, right?

@weissi
Copy link
Member

weissi commented Feb 15, 2025

@t089 / @Lukasa What are we doing here?

  • Keep this for NIO 3 and create a new NIOFoundationEssentialsCompat?
  • Close this one?

@Lukasa
Copy link
Contributor

Lukasa commented Feb 17, 2025

Hrm, @parkera is there any particularly reason JSONSerialization couldn't be moved into FoundationEssentials?

@Lukasa
Copy link
Contributor

Lukasa commented Feb 17, 2025

We could do NIOFoundationEssentialsCompat. Normally I'd be opposed to doing that, but in this rare instance I think we could justify it as NIO users tend to be unusually sensitive to their usage of Foundation.

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

No branches or pull requests

3 participants