feat: Make common sdk AOT safe#169
Merged
jsonbailey merged 4 commits intolaunchdarkly:mainfrom Apr 8, 2026
Merged
Conversation
Contributor
|
@justindbaur thanks for submitting the PR. I will review this as soon as I can. |
jsonbailey
approved these changes
Apr 8, 2026
Contributor
|
@justindbaur sorry for the delay in review. I've reviewed and tested the builds with a sample project and this looks good. |
Contributor
|
I will let you know once we have the new package released but are hoping to release it this week. |
jsonbailey
pushed a commit
that referenced
this pull request
Apr 8, 2026
🤖 I have created a release *beep* *boop* --- ## [7.2.0](LaunchDarkly.CommonSdk-v7.1.1...LaunchDarkly.CommonSdk-v7.2.0) (2026-04-08) ### Features * Make common sdk AOT safe ([#169](#169)) ([8c6948e](8c6948e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: this PR only updates release metadata/version numbers and documentation (changelog/provenance), with no functional code changes in the library itself. > > **Overview** > **Releases `LaunchDarkly.CommonSdk` v7.2.0.** > > Bumps the `pkgs/shared/common` version to `7.2.0` in `.release-please-manifest.json` and updates the package version in `LaunchDarkly.CommonSdk.csproj`. > > Updates release docs by adding the `7.2.0` entry to `CHANGELOG.md` (noting the AOT-safety feature) and updating the version used in `PROVENANCE.md` verification instructions. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit d2e954b. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Contributor
|
The new common package has been published with the AOT update incorporated. I've also released updates for all the SDKs that rely on it. Thanks again for your commit! |
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
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.
Requirements
Related issues
Part of #90
Prerequisite for launchdarkly/dotnet-sdk-internal#49
Describe the solution you've provided
I made all targets of the common SDK trim safe using the built in system text json source generators.
Describe alternatives you've considered
The already written converters could be called directly in the places where
LdValueandContextneed to be serialized.Additional context
I do have a test console app that can be published with AOT and then ran to make sure that these items can be serialized properly but wasn't totally sure where I should put it. If that is desired I can add it, just need to know where to put it.
Note
Medium Risk
Touches core JSON serialization paths for
LdValueandContextand introduces framework-conditional behavior; mistakes could change emitted JSON or break deserialization under specific target frameworks/AOT settings.Overview
Improves trim/native-AOT compatibility by switching
LdValueandContextserialization/deserialization to useSystem.Text.Jsonsource generation onNET7_0_OR_GREATERvia a newLdJsonSerializerContext.Adds AOT/trimming warning annotations to
LdJsonSerializationAPIs on .NET 7+, updates enum conversion helpers to use genericEnum.GetValues<T>()when available, and adjusts the CommonSdk project settings to enable AOT compatibility and setLangVersion9.0 for net7+ builds.Reviewed by Cursor Bugbot for commit b2bfc51. Bugbot is set up for automated code reviews on this repo. Configure here.