Unverified Commit 791e8d41 authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Re-export `RuntimeComponents` in generated clients (#2904)

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._
parent 54c3ede8
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -10,3 +10,15 @@
# references = ["smithy-rs#920"]
# meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client | server | all"}
# 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"
+4 −0
Original line number Diff line number Diff line
@@ -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),
            )

@@ -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),
                )
            }
        }