-
Notifications
You must be signed in to change notification settings - Fork 21
perf: Add NativeAOT Support #554
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ON handling Signed-off-by: André Silva <[email protected]>
… reflection Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
…vider tests Signed-off-by: André Silva <[email protected]>
3 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #554 +/- ##
==========================================
+ Coverage 89.67% 89.73% +0.05%
==========================================
Files 64 64
Lines 2509 2522 +13
Branches 296 295 -1
==========================================
+ Hits 2250 2263 +13
Misses 199 199
Partials 60 60 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
…size comparison Signed-off-by: André Silva <[email protected]>
…erties and AspNetCore sample tests Signed-off-by: André Silva <[email protected]>
…step and standardize comment formatting Signed-off-by: André Silva <[email protected]>
…nd switch to PowerShell for script execution Signed-off-by: André Silva <[email protected]>
… compatibility workflow Signed-off-by: André Silva <[email protected]>
…lumn and enhance binary size logging Signed-off-by: André Silva <[email protected]>
…rkflow Signed-off-by: André Silva <[email protected]>
…ntation for NativeAOT support Signed-off-by: André Silva <[email protected]>
… sections and enhancing clarity Signed-off-by: André Silva <[email protected]>
…ibility workflow Signed-off-by: André Silva <[email protected]>
WeihanLi
reviewed
Aug 19, 2025
test/OpenFeature.AotCompatibility/OpenFeature.AotCompatibility.csproj
Outdated
Show resolved
Hide resolved
test/OpenFeature.AotCompatibility/OpenFeature.AotCompatibility.csproj
Outdated
Show resolved
Hide resolved
Co-authored-by: Weihan Li <[email protected]> Signed-off-by: André Silva <[email protected]>
Co-authored-by: Weihan Li <[email protected]> Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
…d community providers Signed-off-by: André Silva <[email protected]>
WeihanLi
reviewed
Aug 20, 2025
Co-authored-by: Weihan Li <[email protected]> Signed-off-by: André Silva <[email protected]>
kylejuliandev
approved these changes
Aug 20, 2025
WeihanLi
reviewed
Aug 21, 2025
Signed-off-by: André Silva <[email protected]>
WeihanLi
approved these changes
Aug 22, 2025
…ests Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
WeihanLi
reviewed
Aug 22, 2025
beeme1mr
approved these changes
Aug 25, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR
This pull request introduces comprehensive support for .NET NativeAOT compilation in the OpenFeature .NET SDK. It adds an AOT compatibility test project, updates documentation, and refactors code to remove reflection usage and ensure all components work seamlessly with AOT and trimming. The changes also include updates to the build configuration and dependency management to guarantee full compatibility across all major platforms and architectures.
AOT/NativeAOT Compatibility and Testing
.github/workflows/aot-compatibility.yml
) to automatically test AOT compatibility across Linux, Windows, and macOS (both x64 and ARM64) for every push and pull request.test/OpenFeature.AotCompatibility/OpenFeature.AotCompatibility.csproj
project, which is configured and implemented to verify AOT compatibility and demonstrate usage patterns.build/Common.prod.props
to setIsAotCompatible
fornet8.0
andnet9.0
targets, ensuring all relevant builds are flagged for AOT support.Documentation and Guidance
docs/AOT_COMPATIBILITY.md
with detailed instructions, migration guide, and examples for using OpenFeature with NativeAOT. The mainREADME.md
now highlights full NativeAOT compatibility and links to this guide. [1] [2]Codebase Refactoring for AOT
DescriptionAttribute
usage fromErrorType
enum and replaced reflection-based enum description logic with a manual, switch-based implementation inEnumExtensions
, making it AOT-compatible. [1] [2] [3]ValueJsonConverter
documentation and implementation to clarify and ensure AOT compatibility by using manual JSON reading/writing.OpenFeatureJsonSerializerContext
to pre-generate JSON serialization code for all relevant types, enabling trimming and NativeAOT scenarios.Dependency and Solution Updates
Microsoft.Extensions.Logging.Console
,Microsoft.Extensions.Hosting
) for AOT scenarios and updatedDirectory.Packages.props
accordingly.Related Issues
Fixes #440
Notes