BottleRocketStudios / iOS-Hyperspace

An extremely lightweight wrapper around URLSession to make working with APIs a breeze.
Apache License 2.0
47 stars 17 forks source link

Release prep #53

Closed wmcginty closed 6 years ago

wmcginty commented 6 years ago

Final few preparations for 2.0.0 (unless someone plans on writing a migration guide- we already have guides for custom decoding and advanced error handling, and most usages of AnyRequest remain untouched).

codecov-io commented 6 years ago

Codecov Report

Merging #53 into release/2.0.0 will decrease coverage by 0.14%. The diff coverage is 75%.

Impacted file tree graph

@@                Coverage Diff                @@
##           release/2.0.0      #53      +/-   ##
=================================================
- Coverage          96.53%   96.39%   -0.15%     
=================================================
  Files                 32       33       +1     
  Lines               1184     1192       +8     
=================================================
+ Hits                1143     1149       +6     
- Misses                41       43       +2
Impacted Files Coverage Δ
Sources/Hyperspace/Request/AnyRequest.swift 100% <ø> (ø) :arrow_up:
Sources/Hyperspace/Request/Request.swift 96.92% <0%> (-3.08%) :arrow_down:
...space/Service/Network/NetworkServiceProtocol.swift 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e1b8637...9d08d70. Read the comment docs.

tylermilner commented 6 years ago

I feel like we should go ahead and get some sort of a migration guide up so that we're not one of those awful open source libraries that offers no help when things change. 😄

Looking at the CHANGELOG, these look like the main ideas that people will need to deal with:

I think the guide should mainly highlight the breaking changes that will require people to make code changes, right? I believe that should be just about all of them.

wmcginty commented 6 years ago

A lot of it depends on how deeply you were using 1.x. I think the best thing would be to find 1 or 2 internal projects on 1.0 and see what breaks.

The decodable container stuff is purely opt in (as is the error recovery). It will allow users to move code out of individual JSON transformers in favor of the container types. It is explained in more depth in the custom decoding docs I wrote (we could simply link to those from a migration guide).

wmcginty commented 6 years ago

@tylermilner @earlgaspard Added a migration guide, and then used it to migrate one of the fairly large internal projects using Hyperspace 1.0. In order to ease the migration, I re-added some of the types we removed with a deprecation warning. Also added a deprecated type alias for NetworkRequest = Request and AnyNetworkRequest<T> = AnyRequest<T>. All in all was able to migrate an implementation using a custom Request conforming type with 0 required code changes. Would recommend then clearing out the deprecations in 2.1.

If all seems well I'm going to try and get this released tomorrow.

tylermilner commented 6 years ago

Before we merge this, check out #55 for some proposed enhancements to the migration guide.