Skip to content

Releases: BrentMifsud/Simplicity

1.1.0

05 Dec 23:26
6837dbe

Choose a tag to compare

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

1.0.0...1.1.0

Simplicity 1.0.0

02 Dec 23:29
d8008a3

Choose a tag to compare

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, and FailureResponseBody types 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)) and Sendable conformance throughout
  • Flexible Caching: Multiple cache policies, manual cache management API, and CacheMiddleware for advanced caching scenarios

Features

Core

  • HTTPRequest protocol with default JSON encoding/decoding
  • HTTPClient protocol with URLSessionHTTPClient implementation
  • HTTPResponse with on-demand success/failure body decoding
  • HTTPMethod and HTTPStatusCode enums with convenience properties

Middleware

  • Middleware protocol 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

  • CachePolicy enum mirroring URLRequest.CachePolicy semantics
  • Per-request cache policy configuration
  • Manual cache management: setCachedResponse, cachedResponse, removeCachedResponse, clearNetworkCache
  • CacheMiddleware for cache-policy-aware caching that works with authenticated requests

File Uploads

  • HTTPUploadRequest protocol for upload operations
  • MultipartFormEncoder for multipart/form-data payloads
  • URLFormEncoder for application/x-www-form-urlencoded data

Error Handling

  • ClientError enum 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 CacheMiddleware for cache policy-aware caching
  • Added manual cache management API to HTTPClient protocol
  • Updated CI to Swift 6.2
  • Added comprehensive README with documentation for all features
  • Added CLAUDE.md for Claude Code guidance