-
Notifications
You must be signed in to change notification settings - Fork 880
Open
Labels
feature-requestA feature should be added or improved.A feature should be added or improved.needs-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.
Description
Describe the feature
When an AWS SDK library has a dependency to another one, it resolves it either by using the GlobalRuntimeDependencyRegistry class, or by performing some reflection. The former method exists because the reflection employed is not compatible with trimming or Native AOT.
However, it is possible to use trim-friendly reflection patterns (centered arround passing a string literal to Type.GetType(string)), and eliminate the need for GlobalRuntimeDependencyRegistry.
Use Case
- Reduce barriers of using the AWS SDK with trimming or Native AOT.
- Increase reliability and trim-safety, by reducing the amount of
UnconditionalSuppressMessageAttributeuses. - Simplify the codebase.
Proposed Solution
- Add new overloads to
ServiceClientHelpersmethods, that accept a single string parameter with the type's assembly-qualified name (e.g.Amazon.SecurityToken.AmazonSecurityTokenServiceClient, Amazon.SecurityToken), and appropriately annotate them so that the trimmer keeps these types.- Update code to use these overloads.
- Remove
[UnconditionalSuppressMessage]where no longer necessary.
- Obsolete all methods of
GlobalRuntimeDependencyRegistry, suggesting that they are no longer necessary to call, and guide users to just reference the respective NuGet package.
Other Information
No response
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
AWS .NET SDK and/or Package version used
AWSSDK.Core V4
AWSSDK.DynamoDBv2 V4 (for its S3 Link feature)
Targeted .NET Platform
All supported frameworks, particularly modern .NET with trimming or NativeAOT
Operating System and version
All supported operating systems
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature-requestA feature should be added or improved.A feature should be added or improved.needs-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.