Skip to content

Commit

Permalink
Re-export RuntimeComponents in generated clients (#2904)
Browse files Browse the repository at this point in the history
Re-export `RuntimeComponents`, and for generic clients,
`RuntimeComponentsBuilder`, so that a direct dependency on
`aws-smithy-runtime-api` isn't required to implement custom interceptors
or runtime plugins.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
  • Loading branch information
jdisanti authored Aug 7, 2023
1 parent 54c3ede commit 791e8d4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 13 additions & 1 deletion CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,16 @@
# message = "Fix typos in module documentation for generated crates"
# references = ["smithy-rs#920"]
# meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client | server | all"}
# author = "rcoh"
# author = "rcoh"

[[aws-sdk-rust]]
message = "`RuntimeComponents` are now re-exported so that implementing a custom interceptor doens't require directly depending on `aws-smithy-runtime-api`."
references = ["smithy-rs#2904", "aws-sdk-rust#862"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "jdisanti"

[[smithy-rs]]
message = "`RuntimeComponents` and `RuntimeComponentsBuilder` are now re-exported in generated clients so that implementing a custom interceptor or runtime plugin doens't require directly depending on `aws-smithy-runtime-api`."
references = ["smithy-rs#2904"]
meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client"}
author = "jdisanti"
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ class ClientRuntimeTypesReExportGenerator(
"""
pub use #{ConfigBag};
pub use #{Interceptor};
pub use #{RuntimeComponents};
pub use #{SharedInterceptor};
""",
"ConfigBag" to RuntimeType.configBag(rc),
"Interceptor" to RuntimeType.interceptor(rc),
"RuntimeComponents" to RuntimeType.runtimeComponents(rc),
"SharedInterceptor" to RuntimeType.sharedInterceptor(rc),
)

Expand All @@ -40,9 +42,11 @@ class ClientRuntimeTypesReExportGenerator(
"""
pub use #{runtime_plugin}::{RuntimePlugin, SharedRuntimePlugin};
pub use #{config_bag}::FrozenLayer;
pub use #{RuntimeComponentsBuilder};
""",
"runtime_plugin" to RuntimeType.smithyRuntimeApi(rc).resolve("client::runtime_plugin"),
"config_bag" to RuntimeType.smithyTypes(rc).resolve("config_bag"),
"RuntimeComponentsBuilder" to RuntimeType.runtimeComponentsBuilder(rc),
)
}
}
Expand Down

0 comments on commit 791e8d4

Please sign in to comment.