Alamofire v5.0.0-rc.1 Release Notes

Release Date: 2019-09-04 // 7 months ago
  • Released on 2019-09-04. All issues associated with this milestone can be found using this filter. Note: Alamofire 5 is now API stable.

    ➕ Added

    • cancelAllRequests method on Session to cancel all in flight requests.
    • Ability to inject FileManager instance into UploadRequest.
    • DataPreprocessor protocol and implementations, allowing the preprocessing of data before serialization.
    • Internal URLRequest validation and error. GET requests with body data will now produce an error.
    • Generic Failure constraint to DataResponse and DownloadResponse, making them DataResponse<Success, Failure: Error> and DownloadResponse<Success, Failure: Error>.
    • 👍 Precondition to ensure Session can't be used with background URLSessionConfigurations. Alamofire will explicitly support such functionality at some point in the future.
    • ⚡️ SwiftFormat configuration and updated styling.
    • AFDataResponse<Success> and AFDownloadResponse<Success> typealiases to help deal with the doubly generic responses.

    ⚡️ Updated

    • All internal Result usage to use the fully qualified type instead of AFResult.
    • DataRequest and DownloadRequest functional API, renaming flatMap to tryMap.
    • HTTPMethod to be a struct rather than an enum.
    • 0️⃣ All errors produced by Alamofire to be AFError by default. All responses will now start with an AFError Failure type.
    • NetworkReachabilityManager to simplify and modernize its API.
    • 📚 Usage.md documentation to be fully up-to-date with Alamofire 5.
    • Bundle identifiers to include the platform name, fixing ITMS-90806.

    🛠 Fixed

    • Thread-safety issue with serialization queue usage.