flowkey / UIKit-cross-platform

Cross-platform Swift implementation of UIKit, mostly for Android
MIT License
594 stars 40 forks source link

Reduce dependency on Foundation #344

Closed ephemer closed 1 year ago

ephemer commented 2 years ago

Type of change: DX

Motivation (current vs expected behavior)

Foundation is huge in file size and complexity. It is difficult to build, tedious to update, and relying on it is blocking us from moving to new platforms (like the browser). As an open source project swift-corelibs-foundation has not gained a huge amount of traction and appears to be only implementing the bare minimum. In general, it seems like the Swift community is looking to replace it with lighter more specific modules. We would also do better to remove it and implement what we need from it in other ways wherever possible.

This PR makes it clear that we are really only relying on a few key parts of Foundation in UIKit-Cross-Platform:

Some of these dependencies will be easier to to remove than others, and that work should happen in a separate PR. For now, we just want to make explicit what we are actually using and remove some trivial dependencies directly.

Please check if the PR fulfills these requirements

ephemer commented 1 year ago

FYI @rikner @michaelknoch I am going to merge this. The tests are passing and this PR should not introduce any behavioural change 🙏🏼