Closed wmcginty closed 6 years ago
Merging #53 into release/2.0.0 will decrease coverage by
0.14%
. The diff coverage is75%
.
@@ 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.
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:
NetworkRequest
--> Request
and AnyNetworkRequest
--> AnyRequest
.HTTP.Status
from enums to RawRepresentable
structs.dataTransformer
and DecodableContainer
usage - @wmcginty is this stuff that people on 1.x
would need to make code changes for when migrating to 2.x
or is it mostly just opt-in type stuff?Request
object. You now bake them into the URL yourself.BackendServiceError
type removed, requiring types conforming to Request
to specify an associated ErrorType
.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.
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).
@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.
Before we merge this, check out #55 for some proposed enhancements to the migration guide.
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).