This is a big major release and thanks to everyone involved! 🎉 🎉 🎉
In this release there were two big changes:
- We deprecated reactive providers and started using
rx
andreactive
namespaces. - We removed
parameters
,parameterEncoding
and expandedtask
.
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 callbackQueue
s 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
toTargetType
. - Breaking Change Updated
RxMoyaProvider.request
to return aSingle<Request>
. - Breaking Change Updated
Moya.Response
'sresponse
to use anHTTPURLResponse
instead of aURLResponse
. - Breaking Change Updated
TargetTypes
so it no longer receives theAuthorization: Bearer <token>
header by default when usingAccessTokenPlugin
. - Breaking Change Renamed all occurrences of
queue
tocallbackQueue
. - Breaking Change Deprecated
ReactiveSwiftMoyaProvider
andRxSwiftMoyaProvider
. UseMoyaProvider
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
forReactiveSwiftMoyaProvider
. - 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
¶meterEncoding
inTargetType
with extendedTask
cases. - Breaking Change Replaced
shouldAuthorize: Bool
inAccessTokenAuthorizable
withauthorizationType: AuthorizationType
. - Breaking Change Replaced
token
inAccessTokenPlugin
withtokenClosure
. - Breaking Change Flattened
UploadType
andDownloadType
intoTask
cases. - Added optional callback queue parameter to reactive providers.
- Added public
URL(target:)
initializator that creates url fromTargetType
. - Added an optional
requestDataFormatter
inNetworkLoggerPlugin
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 forObservable<Response>
toSingle<Response>
as well. - Added
AuthorizationType
toAccessTokenAuthorizable
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
fromTask
. - Updated minimum version of
RxSwift
to3.3
. - Updated minimum version of
ReactiveSwift
to2.0
. - Fixed a bug where you would have two response events in
requestWithProgress
method onReactiveSwift
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.