Skip to content

Handle convenience code better#14

Merged
RandomHashTags merged 9 commits intomainfrom
handle-convenience-better
Oct 20, 2025
Merged

Handle convenience code better#14
RandomHashTags merged 9 commits intomainfrom
handle-convenience-better

Conversation

@RandomHashTags
Copy link
Owner

@RandomHashTags RandomHashTags commented Oct 19, 2025

to reduce code duplication & bloat, and also unify implementations (and so we don't end up maintaining separate implementations based on enabled features)

- remove convenience using `MediaType` (alternatively use the `some MediaTypeProtocol` convenience logic)
- `String` now conforms to `HTTPRequestMethodProtocol`
- use `String` for the convenient `Route` methods (prevously required the http request method package traits)
- merged behind compilation conditions (and removed some package traits)
- merge `GenericHTTPMessage` into `HTTPMessage`
- merge `GenericStaticRoute` into `StaticRoute`
- merge `GenericDynamicRoute` into `DynamicRoute`
- merge `GenericDynamicResponse` into `DynamicResponse`
- moved some protocols and structs to `DestinyEmbedded`
- added `EMBEDDED` package trait to emulate building for embedded
- removed some obsolete convenient inits and funcs
- some code formatting updates to convenient funcs
- update imports and parsing function visibility in `HTTPRequestMethodExtensions.swift`
- remove `DestinyDefaults` import in `Route+Convenience+Copyable.swift` (and fix a TODO typo)
- use `HTTPResponseMessageHead` in more places
- significant changes to `Route` convenience to reduce code duplication and bloat (indirectly fixes missing additional headers and cookies)
- added `@inlinable` (if enabled via package trait) to `HTTPRequestMenthodExtensions`
@RandomHashTags RandomHashTags self-assigned this Oct 19, 2025
@RandomHashTags RandomHashTags added enhancement New feature or request semver/major Semantic Version MAJOR changes (made incompatible API changes) bugfix Fixes a bug performance Relates to performance behavior cookies Relates to HTTP Cookies convenience Relates to convenient code unit tests Relates to unit tests in some way compilation conditions Involves compilation conditions in some way embedded Relates to Swift Embedded mode labels Oct 19, 2025
- they now get upgraded to a `StaticString` if possible
- any string body now includes the pound delimiter when expanded, if present
- performance changes to `IntermediateResponseBody`
- minor documentation updates
- add warning to `Router+Routes+Static` if appending isn't supported
@RandomHashTags RandomHashTags merged commit 26a2be5 into main Oct 20, 2025
@RandomHashTags RandomHashTags deleted the handle-convenience-better branch October 20, 2025 13:44
@RandomHashTags RandomHashTags added the package traits Relates to Package Traits label Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes a bug compilation conditions Involves compilation conditions in some way convenience Relates to convenient code cookies Relates to HTTP Cookies embedded Relates to Swift Embedded mode enhancement New feature or request package traits Relates to Package Traits performance Relates to performance behavior semver/major Semantic Version MAJOR changes (made incompatible API changes) unit tests Relates to unit tests in some way

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant