TRON v5.0.0 Release Notes

Release Date: 2019-06-28 // 8 months ago
  • ➕ Added

    • 👌 Support for per-request Interceptors.
    • 🏗 Three different behaviors for building URLs: .appendingPathComponent, .relativeToBaseURL and .custom. Those can be set in TRON initializer:

      let tron = TRON(baseURL: "https://www.example.com/", buildingURL: .relativeToBaseURL)

    Or you can change URLBuilder.Behavior on per-request basis, using the new DSL:

    let request: APIRequest\<Int,APIError\> = tron.swiftyJSON .request("status/200") .buildURL(.relativeToBaseURL)
    

    0️⃣ Default behavior for TRON is .appendingPathComponent.

    ✂ Removed

    • URLBuildable protocol. Please use different behaviors for URLBuilder instead.

Previous changes from v5.0.0-beta.4

  • ➕ Added

    • 👌 Support for Swift Package Manager in Xcode 11
    • 🆕 New convenient DSL, that allows to convert this code:
    func deleteSession() -> APIRequest<Empty, UnknownError> {
        let request : APIRequest<Empty, UnknownError> = tron.codable.request("session")
        request.method = .delete
        return request
    }
    

    into:

    func deleteSession() -> APIRequest<Empty, UnknownError> {
        return tron.codable.request("session").delete()
    }
    

    📄 Read more about other DSL improvements in 5.0 Migration Guide

    🔄 Changed

    • URLBuilder now resolves URL's using URL(string:relativeTo:) method, thus allowing more flexible url creation.