-
Notifications
You must be signed in to change notification settings - Fork 189
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
Clean up re-exports and improve 'BuildError' conversions #3173
Conversation
f1e47fc
to
1e7968a
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.
This is awesome!
use #{IntoShared}; | ||
#{StaticUriEndpointResolver}::uri(url).into_shared() |
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 compiles? How does it know where into_shared
came from?
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.
it's re-exported above
* Although it is not always possible to use this, this is the preferred method for using types in config customizations | ||
* and ensures that your type will be re-exported if it is used. | ||
*/ | ||
fun configReexport(type: RuntimeType): RuntimeType = RuntimeType.forInlineFun(type.name, module = ClientRustModule.config) { |
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.
In an ideal world, I prefer to have all the re-exports in one place, but I understand the need to make them conditional and how that's easier with this approach. That said, I don't think we should use this for re-exports that are supposed to always be present since then it could be easy to break one of these re-exports just by changing codegen in some other place.
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.
I see that but I think:
- It's easier to miss items
- We'll get a semver failure if we delete something by accident
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 other benefit is that in-situ, we're actually using the rexport which I think is a benefit. We could make non-conditional re-exports be runtime types though, not opposed to that.
1bf97f8
to
c9d67d4
Compare
A new generated diff is ready to view.
A new doc preview is ready to view. |
## Motivation and Context - Fixes #3171 - Fixes #3155 - Fixes #3172 ## Description - Add `configReExport` to make it easy and consistent to re-export types into the config module when they are used! - Add this for a bunch of types and clean up some (now) dead code - Re export `BuildError` - Enable converting from `BuildError` into `SdkError` There are probably more places this can be used, but I'd like to keep this change small to facilitate easy backport to 0.57. ## Testing CI ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates - [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
## Motivation and Context - Fixes #3171 - Fixes #3155 - Fixes #3172 ## Description - Add `configReExport` to make it easy and consistent to re-export types into the config module when they are used! - Add this for a bunch of types and clean up some (now) dead code - Re export `BuildError` - Enable converting from `BuildError` into `SdkError` There are probably more places this can be used, but I'd like to keep this change small to facilitate easy backport to 0.57. ## Testing CI ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates - [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
Motivation and Context
BuildError
intoSdkError
#3171ProvideCredentials
#3155BuildError
#3172Description
configReExport
to make it easy and consistent to re-export types into the config module when they are used!BuildError
BuildError
intoSdkError
There are probably more places this can be used, but I'd like to keep this change small to facilitate easy backport to 0.57.
Testing
CI
Checklist
CHANGELOG.next.toml
if I made changes to the smithy-rs codegen or runtime cratesCHANGELOG.next.toml
if I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.