github Moya/Moya 9.0.0

latest releases: 15.0.3, 15.0.1, 15.0.0...
6 years ago

This is a big major release and thanks to everyone involved! 🎉 🎉 🎉

In this release there were two big changes:

  1. We deprecated reactive providers and started using rx and reactive namespaces.
  2. We removed parameters, parameterEncoding and expanded task.

We also added Swift 4.0 support to Moya core (and preliminary for ReactiveSwift) where support for RxSwift will be in a next major release. We improved our test coverage from 76% up to 83%, added callbackQueues as an option for all requests (reactive or not!), headers to TargetType, improved AccessTokenPlugin, started using Single<Response> instead of Observable<Response> for RxSwift normal requests and many, many more! Checkout the changelog below and have fun! 🎉 There is also a migration guide to help you make it through!

Oh, and if you find anything you are concerned about, make a new Issue - or better yet, make a PR with the fix! 😉

Changes since 9.0.0-beta.1:

  • Removed default value for task from Endpoint initializer.

Full changelog for Moya 9.0.0:

  • Breaking Change Added support to get the response (if any) from MoyaError.
  • Breaking Change Added headers to TargetType.
  • Breaking Change Updated RxMoyaProvider.request to return a Single<Request>.
  • Breaking Change Updated Moya.Response's responseto use an HTTPURLResponse instead of a URLResponse.
  • Breaking Change Updated TargetTypes so it no longer receives the Authorization: Bearer <token> header by default when using AccessTokenPlugin.
  • Breaking Change Renamed all occurrences of queue to callbackQueue.
  • Breaking Change Deprecated ReactiveSwiftMoyaProvider and RxSwiftMoyaProvider. Use MoyaProvider with reactive properties now: provider.reactive._, provider.rx._. In case you were subclassing reactive providers, please take a look at this PR from Eidolon. It covers migration from subclassing given providers, to usage by composition.
  • Breaking Change Removed parameter name in requestWithProgress for ReactiveSwiftMoyaProvider.
  • Breaking Change Removed deprecated in Moya 8.0.0: Moya.Error,
    endpointByAddingParameters(parameters:), endpointByAddingHttpHeaderFields(httpHeaderFields:), endpointByAddingParameterEncoding(newParameterEncoding:), endpointByAdding(parameters:httpHeaderFields:parameterEncoding), StructTarget, filterStatusCodes(range:), filterStatusCode(code:), willSendRequest(request:target:), didReceiveResponse(result:target:), ReactiveCocoaMoyaProvider, ReactiveSwiftMoyaProvider.request(token:).
  • Breaking Change Replaced parameters & parameterEncoding in TargetType with extended Task cases.
  • Breaking Change Replaced shouldAuthorize: Bool in AccessTokenAuthorizable with authorizationType: AuthorizationType.
  • Breaking Change Replaced token in AccessTokenPlugin with tokenClosure.
  • Breaking Change Flattened UploadType and DownloadType into Task cases.
  • Added optional callback queue parameter to reactive providers.
  • Added public URL(target:) initializator that creates url from TargetType.
  • Added an optional requestDataFormatterin NetworkLoggerPlugin to allow the client to interact with the request data before logging it.
  • Added Swift 4.0 support for Moya core (without RxSwift/ReactiveSwift extensions for now).
  • Added all the filter/map operators that were available for Observable<Response> to Single<Response> as well.
  • Added AuthorizationType to AccessTokenAuthorizable representing request headers of .none, .basic, and .bearer.
  • Added tests for Single<Response> operators.
  • Added Progress object into the response when calling progress callback on completion.
  • Added tests for creating URLRequest from Task.
  • Updated minimum version of RxSwift to 3.3.
  • Updated minimum version of ReactiveSwift to 2.0.
  • Fixed a bug where you would have two response events in requestWithProgress method on ReactiveSwift module.
  • Fixed a bug where you weren't notified on progress callback for data request.
  • Enabled the "Allow app extension API only" flag.
  • Removed default value for task from Endpoint initializer.

Don't miss a new Moya release

NewReleases is sending notifications on new releases.