-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adopt Codable and JSONDecoder #221
Conversation
1a8ca95
to
4df10cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay!
Is there anything we can do to make this extension fit in more naturally?
1c7c808
to
fa0f5f3
Compare
Replaced the extension with an |
V4 compatibility was pretty isolated before. I wonder if I made that part worse. 🤔 |
48550ab
to
5dfc04c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before merging, let's double check this integrates properly with another library that uses this as a dependency. |
f7cb6c1
to
7438bd9
Compare
MapboxDirections/MBDirections.swift
Outdated
errorHandler(apiError) | ||
} | ||
guard let data = data, response?.mimeType == "application/json" else { | ||
errorHandler(Directions.informativeError(describing: [:], response: response, underlyingError: error as NSError?)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call used to take a JSON object whose code
and message
keys determined the message. Does that no longer matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Errors are handled more gracefully in 1a161d6
I haven't noticed any changes or regressions in mapbox-navigation-ios after these changes but let's hold off a bit more. V5Tests.testGeoJSON frequently times out on CI with a timeout set to 2 seconds. Before Codable, testGeoJSON consistently finished at 750ms compared to 1.7s after adopting Codable. It's a 3.2MB JSON but still. |
Managed to get it down to 1.3s but we may want to wait for https://bugs.swift.org/browse/SR-6252 |
b7f5a88
to
acde13c
Compare
acde13c
to
e53177c
Compare
The bottleneck persists in Swift 4.2 |
…behavior with `Codable`, which is in-flight in #221.
…behavior with `Codable`, which is in-flight in #221.
…behavior with `Codable`, which is in-flight in #221.
Superseded by #382. |
Fixes #134
@bsudekum @1ec5 👀