Support full trim publishing#5053
Merged
Merged
Conversation
Switch the Avalonia app to TrimMode=full by default, replace Octokit with a trim-safe source-generated GitHub API client, and statically root the conditional Windows Mica resource so full-trim publish launches successfully. Add CI visibility for full-trim publish warnings and targeted trim warning handling for app-owned COM activation and expected Avalonia constructor diagnostics. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Gabriel Dufresne (GabrielDuf)
approved these changes
Jul 7, 2026
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.
Summary
TrimMode=partialtoTrimMode=fullwhile keeping self-contained ReadyToRun publishing.GitHubApiClientusingHttpClientand source-generatedSystem.Text.JsonDTOs for OAuth, device flow, current user, and gist backup APIs.ResourceDictionary; the first full-trim launch exposed this because the dynamically loadedStyles.WindowsMica.axamlresource was trimmed.Size impact
Measured against same-code x64 Release self-contained ReadyToRun publishes:
Earlier installer measurement showed a similar gain:
44.56 MiB->36.66 MiB, about7.9 MiBsmaller.Full-trim warning audit
Full-trim publish succeeds and now leaves 45 trim warnings, all from external dependencies:
AutoGenerateColumns="False", but grids still need careful manual validation.I intentionally did not blanket-suppress the remaining external warnings so future app-owned trim regressions stay visible.
Needs careful review
Validation
dotnet restore src/UniGetUI.Windows.slnxdotnet build src/UniGetUI.Windows.slnx --no-restore --verbosity q --nologo /p:Platform=x64 /p:UseSharedCompilation=false /m:1dotnet test src/UniGetUI.Windows.slnx --no-restore --verbosity q --nologo /p:Platform=x64 /p:UseSharedCompilation=false /m:1dotnet format whitespace src --folder --verify-no-changes --verbosity minimaldotnet format style src/UniGetUI.Windows.slnx --no-restore --verify-no-changes --verbosity minimalTrimmerSingleWarn=falseUniGetUI.exesuccessfully and inspected the backup settings UI path