TRON v5.0.0-beta.1 Release Notes

Release Date: 2019-03-12 // about 5 years ago
  • TRON now requires:

    • Xcode 10
    • Swift 4 and higher
    • iOS/tvOS 10 and higher
    • watchOS 3 and higher
    • ๐ŸŽ macOS 10.12 and higher

    โž• Added

    • ๐Ÿ“š Complete documentation
    • TRONDataResponseSerializer and TRONDownloadResponseSerializer structs to encapsulate serialization of responses using closure.
    • โœ… All test suite now uses StubbingURLProtocol to stop tests from sending network requests. Closes #21.
    • โž• Additional JSONDecodable conformances have been added for arithmetic types such as Int8...Int64, UInt8...64.

    โœ‚ Removed

    • EmptyResponse type was replaced with Alamofire.Empty struct to not interfere with Alamofire.EmptyResponse protocol.
    • TRON.stubbingShouldBeSuccessful property since now each stub directly defines it's behavior instead of global setting
    • Conditional conformance of Array to JSONDecodable
    • Convenience download methods on CodableSerializer and JSONDecodableSerializer
    • AuthorizationRequirement enum. Please use Alamofire.RequestAdapter and Session.adapter property to adapt request, when additional headers are needed.
    • HeaderBuildable protocol and HeaderBuilder types. Please use BaseRequest.headers property of type Alamofire.HTTPHeaders directly.
    • ErrorHandlingDataResponseSerializerProtocol and ErrorHandlingDownloadResponseSerializer protocol. Now, ErrorModel on all requests conforms to ErrorSerializable protocol, that contains initializer that allows to create it directly.
    • ๐Ÿ“œ CodableDownloadParser and JSONDecodableDownloadParser, replacement class DownloadSerializer has been introduced, it allows to create a data model by implementing DownloadResponseSerializerProtocol
    • UploadAPIRequest.performMultipart method, because multipart upload is no longer a special case in Alamofire 5, please use UploadAPIRequest.perform instead.

    ๐Ÿ’ฅ Breaking

    • 0๏ธโƒฃ headers property of BaseRequest now contains HTTPHeaders type instead of [String: String]. Please note that along with HeaderBuilder removal TRON no longer sends 'Accept':'application/json' header by default.
    • APIError is changed to be able to accept SerializedObject and is now a class with nullable initializer. Also, DownloadAPIError type has been introduced for download errors, that do not have Data in them, but have fileURL instead.
    • ๐Ÿ”Œ Plugin methods that previously accepted APIError<ErrorModel> now accept ErrorModel directly. Added didSuccessfullyParseDownloadResponse and didReceiveDownloadResponse methods.
    • ๐Ÿ“œ All concrete implementations of DataResponseSerializerProtocol such as CodableParser and JSONDecodableParser now have only one generic argument - Model and are only parsing model type.
    • ๐Ÿšš JSONDecodableParser and CodableParser now have only one generic argument - Model, since ErrorModel is now moved to ErrorSerializable protocol, that does not depend on any particular serializer.
    • ๐Ÿ”Œ APIStub has been rewritten from scratch to allow injecting only results of network request(URLRequest, HTTPURLResponse, Data, Error and fileURL) as opposed to actual Model and errorModel as well as definition of successful/unsuccessful requests. APIStub now is been attached to Alamofire.Request when stubbing for this particular request has been enabled. Rewrite also allows plugin callbacks to be called more consistently for both stubbed and unstubbed cases.
    • ๐Ÿ”€ rxMultipartResult method on UploadRequest method was removed since UploadRequest for multipart requests in Alamofire 5 is now synchronous and now does not require special handling. You can now call rxResult replacement method instead.