Skip to content

feat: migrate to Swift 6.0 with Sendable/consuming annotations - #9

Merged
grdsdev merged 1 commit into
mainfrom
feat/swift-6-migration
Feb 25, 2026
Merged

feat: migrate to Swift 6.0 with Sendable/consuming annotations#9
grdsdev merged 1 commit into
mainfrom
feat/swift-6-migration

Conversation

@grdsdev

@grdsdev grdsdev commented Feb 25, 2026

Copy link
Copy Markdown
Owner

This PR migrates the library to Swift 6.0 with proper Sendable and consuming parameter annotations for better Swift concurrency support.

**Breaking Changes:**
- Minimum Swift version: 5.10 → 6.0
- Minimum iOS: 13.0 → 16.0
- Minimum macOS: 10.15 → 13.0
- Minimum watchOS: 6.0 → 9.0
- Minimum tvOS: 13.0 → 16.0
- Minimum macCatalyst: 13.0 → 16.0

**Swift 6 Concurrency:**
- Fixed all strict concurrency checking errors
- Made MultipartFormData non-Sendable (builder pattern, no isolation transfer needed)
- Added SendableBox helper for thread-safe test state
- Refactored test log handlers to use actors

**Ownership Annotations:**
- Added `sending` to HTTPBody parameters in ClientTransport.send()
- Added `sending` to HTTPBody parameters in ClientMiddleware.intercept()
- Added `sending` to HTTPBody in Client.send()
- Added `consuming` to MultipartFormData.encode() and writeEncodedData()
- HTTPBody ownership transfer is now explicit and compiler-enforced

**Benefits:**
- Type-safe ownership semantics prevent accidental body reuse
- Self-documenting API with clear resource lifetimes
- Compiler optimizations enabled by explicit ownership
- All unit tests pass with Swift 6 strict concurrency

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@grdsdev
grdsdev merged commit 1922381 into main Feb 25, 2026
5 checks passed
@grdsdev
grdsdev deleted the feat/swift-6-migration branch February 25, 2026 16:52
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