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

Move foundation extensions behind traits #81

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FranzBusch
Copy link
Member

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.

# 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant