-
Notifications
You must be signed in to change notification settings - Fork 35
chore!: Move CRT dependency from SmithyHTTPAPI to ClientRuntime #1003
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
Conversation
|
|
||
| public init(urlString: String, | ||
| headers: Headers = Headers(), | ||
| endpointProperties: [String: EndpointProperty]) throws { |
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.
The initializer above is only called by DefaultEndpointResolver so it is moved here from SmithyHTTPAPI.
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.
FYI, this is the place where this initializer is called from:
https://github.com/smithy-lang/smithy-swift/blob/main/Sources/ClientRuntime/Endpoints/DefaultEndpointResolver.swift#L36
| } | ||
| } | ||
|
|
||
| private extension EndpointPropertyValue { |
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 extension on EndpointPropertyValue is only called from the initializer above, so it is moved here & scoped private.
| try self.init(url: url, headers: headers, properties: properties) | ||
| } | ||
| } | ||
|
|
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.
The code above is moved to ClientRuntime to be with the DefaultEndpointResolver that calls it.
| } | ||
| } | ||
| } | ||
|
|
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.
The extension above was only ever called by the initializer in the file above.
| "Smithy", | ||
| .product(name: "AwsCommonRuntimeKit", package: "aws-crt-swift") | ||
| ] | ||
| dependencies: ["Smithy"] |
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.
CRT dependency is removed from SmithyHTTPAPI since no remaining types in SmithyHTTPAPI reference it.
Description of changes
SmithyHTTPAPIhas a dependency on CRTAwsCommonRuntimeKitbecause it includes code for converting endpoint properties to/from the CRT types.That code is moved to
ClientRuntimewith theDefaultEndpointResolverthat uses it, and the dependency ofSmithyHTTPAPIonAwsCommonRuntimeKitis removed.This is a breaking change due to moving public components from one module to the other, but should be zero impact on customers since only
DefaultEndpointResolver(located inClientRuntime) calls the moved methods, and it is unlikely customers ever interact with them.Scope
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.