Update SVG upstream and complete SkiaSharp 3 AOT cleanup#527
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: afc704902c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c6c3e1e0d6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1576e2594
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
This PR updates the SVG submodule to the latest upstream commit carrying the trim/AOT annotation cleanup and completes the downstream Svg.Skia changes needed to build against SkiaSharp 3 without runtime sampling reflection.
What Changed
externals/SVGto upstream commit853a9ae8, including the SVG library trim/AOT annotation cleanup from Remove DynamicallyAccessedMemberTypes to improve trim/aot compatibility svg-net/SVG#1211.3.119.2.build/SkiaSharp.Avalonia.propsso direct SkiaSharp references in Avalonia sample/test apps stay aligned with the Avalonia.Skia 12.0.0 SkiaSharp3.119.3-preview.1.1dependency.SkiaSharp.v3.propsandSkiaSharp.Native.v3.propssplit and normalized project imports.SkiaSharpSamplingOptionsApibridge fromSkiaModel.SKSamplingOptionsAPIs.RequiresUnreferencedCodeandDynamicallyAccessedMembersannotations from the reviewed runtime path.TypeDescriptor.GetConverter(Type)by reusing per-property converters captured from SVG descriptors and by handling common primitive/unit conversions directly.SVGAngle.valueAsStringkeep their original unit spelling and surviveDeepCopy().TypeDescriptor.GetConverterwhile preserving SVG casing such asvisiblePainted,whenNotActive,color-dodge, andhueRotate.Why
SkiaSharp 3 exposes the sampling API directly. Keeping the old runtime reflection bridge required AOT annotations and retained a trim-sensitive path. Moving to SkiaSharp 3 as the baseline lets Svg.Skia use the real static API surface while preserving framework-specific package constraints for Avalonia.
The SVG upstream update also changed enum/string conversion behavior in ways that affected JavaScript DOM compatibility. The new raw DOM attribute side table keeps script-observable string values distinct from typed model conversions.
Validation
dotnet format Svg.Skia.slnx --no-restoredotnet build Svg.Skia.slnx -c Releasedotnet test Svg.Skia.slnx -c Releasedotnet build src/Svg.Controls.Skia.Maui/Svg.Controls.Skia.Maui.csproj -c Releasedotnet build src/SvgML.Maui/SvgML.Maui.csproj -c Releasegit diff --checkrg -n "DynamicallyAccessedMembers|RequiresUnreferencedCode|RequiresDynamicCode|SkiaSharpSamplingOptionsApi" src externals/SVG -g '*.cs'Notes
The full solution build/test still reports existing warnings only: known package advisories, nullable warnings, and SkiaSharp 3 text API obsoletions. The reviewed runtime paths no longer contain
RequiresUnreferencedCode,DynamicallyAccessedMembers, or the SkiaSharp sampling reflection shim.