swift-http-types icon indicating copy to clipboard operation
swift-http-types copied to clipboard

Move foundation extensions behind traits

Open FranzBusch opened this issue 10 months ago • 0 comments

Motivation

Currently this package extends various Foundation types in a separate module. One problem with this module is that it unconditionally imports FoundationNetworking. This is undesirable on Linux since it brings curl as a dependency. Additionally, the discoverability of having to import an additional module isn't great.

Modification

This PR introduces two new traits that enable extensions on types from FoundationEssentials and FoundationNetworking respectively. Giving adopters fine control of what they want to link against. It also moves all the extensions into the main HTTPTypes module.

Result

Only a single module that is configurable through package traits.

FranzBusch avatar Jan 07 '25 10:01 FranzBusch