Releases: BrentMifsud/Simplicity
Releases · BrentMifsud/Simplicity
1.1.0
What's New
Platform Support
- Added visionOS 1.0+ support
Improvements
- Improved cross-platform URLError handling for better error propagation
- Updated CI to test all Apple platforms in parallel (macOS, iOS, tvOS, watchOS, visionOS)
Full Changelog
Simplicity 1.0.0
Simplicity 1.0.0
The first stable release of Simplicity - a type-safe HTTP client library for Swift.
Highlights
- Type-Safe Requests: Define HTTP requests with associated
RequestBody,SuccessResponseBody, andFailureResponseBodytypes for compile-time safety - Middleware Architecture: Composable request/response interception for authentication, logging, retries, caching, and more
- Full Swift 6 Concurrency Support: Actor-based client with typed throws (
throws(ClientError)) andSendableconformance throughout - Flexible Caching: Multiple cache policies, manual cache management API, and
CacheMiddlewarefor advanced caching scenarios
Features
Core
HTTPRequestprotocol with default JSON encoding/decodingHTTPClientprotocol withURLSessionHTTPClientimplementationHTTPResponsewith on-demand success/failure body decodingHTTPMethodandHTTPStatusCodeenums with convenience properties
Middleware
Middlewareprotocol for request/response interception- Full access to request metadata:
operationID,httpMethod,baseURL,path,queryItems,headers,httpBody,cachePolicy - Support for request mutation, response transformation, and short-circuiting
Caching
CachePolicyenum mirroringURLRequest.CachePolicysemantics- Per-request cache policy configuration
- Manual cache management:
setCachedResponse,cachedResponse,removeCachedResponse,clearNetworkCache CacheMiddlewarefor cache-policy-aware caching that works with authenticated requests
File Uploads
HTTPUploadRequestprotocol for upload operationsMultipartFormEncoderformultipart/form-datapayloadsURLFormEncoderforapplication/x-www-form-urlencodeddata
Error Handling
ClientErrorenum with specific cases:cancelled,timedOut,cacheMiss,encodingError,transport,middleware,invalidResponse,unknown- Typed throws for precise error handling
Requirements
- Swift 6.2+
- iOS 17.0+ / macOS 14.0+ / tvOS 17.0+ / watchOS 10.0+ / Mac Catalyst 17.0+
Installation
dependencies: [
.package(url: "https://github.com/BrentMifsud/Simplicity.git", from: "1.0.0")
]What's Changed Since 0.2.9
- Added
CacheMiddlewarefor cache policy-aware caching - Added manual cache management API to
HTTPClientprotocol - Updated CI to Swift 6.2
- Added comprehensive README with documentation for all features
- Added
CLAUDE.mdfor Claude Code guidance