Bundles file size improvements#3832
Merged
Merged
Conversation
…d more fields and more robust against mistakes
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors serialization to produce more compact JSON, replaces specific key prefixes, and disables indented output to reduce bundle file size from ~300 KB to ~70 KB.
- Updated backup key delimiters in
GitHubBackupService - Introduced
AsJsonNodeoverrides across serializable classes and switchedAsJsonStringto minify JSON - Disabled
WriteIndentedinSerializationHelpers
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/UniGetUI/Services/GitHubBackupService.cs | Changed backup key markers from #[…] to @[…] |
| src/UniGetUI/Pages/SoftwarePages/PackageBundlesPage.cs | Swapped JsonSerializer.Serialize(...) for AsJsonString() |
Serializable* files in UniGetUI.PackageEngine.Serializable |
Added AsJsonNode implementations for all serializable types |
| src/UniGetUI.Core.Tools/SerializationHelpers.cs | Set WriteIndented = false to disable pretty JSON |
Comments suppressed due to low confidence (3)
src/UniGetUI.PackageEngine.Serializable/SerializableComponent.cs:27
- [nitpick] Add unit tests for
AsJsonNodeandAsJsonStringto verify that serialized output is correct and remains compact after these refactorings.
return JsonSerializer.Serialize(AsJsonNode(), SerializationHelpers.DefaultOptions);
src/UniGetUI.PackageEngine.Serializable/InstallOptions.cs:60
- The initializer
= []is invalid for a List. Replace with= new List<string>()or a valid collection expression.
public List<string> KillBeforeOperation { get; set; } = [];
src/UniGetUI/Services/GitHubBackupService.cs:9
- If any code or regex matches the old
#[…]pattern, it must be updated to the new@[…]prefix to avoid lookup failures.
private const string GistDescription_EndingKey = "@[UNIGETUI_BACKUP_V1]";
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.
Improvements to bundle save file size. So far, ~300K -> ~100K