Skip to content

Upgrade to Avalonia 12.0#473

Merged
wieslawsoltes merged 15 commits into
masterfrom
chore/avalonia-12-rc1-upgrade
Apr 8, 2026
Merged

Upgrade to Avalonia 12.0#473
wieslawsoltes merged 15 commits into
masterfrom
chore/avalonia-12-rc1-upgrade

Conversation

@wieslawsoltes
Copy link
Copy Markdown
Owner

@wieslawsoltes wieslawsoltes commented Mar 19, 2026

Avalonia 12.0.0 upgrade

Summary

This branch updates the Avalonia integration in Svg.Skia to stable 12.0.0, retargets the Avalonia-specific packages to supported TFMs, migrates the remaining Avalonia 12 API breakages in controls, editor code, and samples, switches optional devtools support to ProDiagnostics, and updates the docs/test infrastructure to match the new Avalonia lane.

Key changes

Package and version updates

  • Directory.Packages.props
    • Bumps the Avalonia package family to 12.0.0.
    • Replaces Avalonia.Diagnostics with opt-in ProDiagnostics.
    • Adds xunit.v3 centrally for the Avalonia headless test projects.
  • Directory.Build.props
    • Updates package metadata to VersionPrefix=4.0.0.
    • Sets AvaloniaVersionPrefix=12.0.0.
  • build/SkiaSharp.v3.props and build/SkiaSharp.Native.v3.props
    • Align the SkiaSharp v3 overrides to 3.119.3-preview.1.1, which is required by the Avalonia 12 dependency chain.
  • build/ReactiveUI.Avalonia.props
    • Replaces the old Avalonia ReactiveUI props wiring with ReactiveUI.Avalonia for TestApp.

Avalonia project targeting and test infrastructure

  • Skia.Controls.Avalonia, Svg.Controls.Avalonia, Svg.Controls.Skia.Avalonia, Svg.Editor.Avalonia, and Svg.Editor.Skia.Avalonia
    • Retarget from the old multi-TFM matrix to net8.0;net10.0.
  • TestApp and AvaloniaSKPictureImageSample
    • Disable compiled bindings by default where the Avalonia 12 migration path needs it.
  • Avalonia unit test projects
    • Switch to xunit.v3 and OutputType=Exe for the Avalonia headless host.
  • tests/Avalonia.Svg.Skia.UiTests/Avalonia.Svg.Skia.UiTests.csproj
    • Drops stale Linux-specific props imports that are no longer part of this test lane.

Avalonia 12 API migrations

  • src/Svg.Controls.Avalonia/AvaloniaSvgAssetLoader.cs
    • Updates glyph measurement to the Avalonia 12 glyph-typeface APIs using CharacterToGlyphMap and TryGetHorizontalGlyphAdvance.
  • src/Svg.Editor.Skia.Avalonia/SvgEditorWorkspace.axaml.cs
    • Migrates drag/drop to DataTransfer, TryGetFiles(), and DragDrop.DoDragDropAsync(...).
    • Updates tree container access to ContainerFromIndex(...).
  • samples/AvaloniaSvgSample/MainWindow.axaml.cs
  • samples/AvaloniaSvgSkiaSample/MainWindow.axaml.cs
  • samples/TestApp/Services/StorageService.cs
    • Move file drag/drop and storage-provider access to the Avalonia 12 APIs.
  • src/Svg.Editor.Avalonia/InsertElementPickerView.axaml.cs
  • src/Svg.Editor.Avalonia/SymbolPickerView.axaml.cs
    • Update focus handlers from GotFocusEventArgs to FocusChangedEventArgs.
  • Avalonia views such as samples/TestApp/Views/MainView.axaml
    • Replace Watermark with PlaceholderText where required by Avalonia 12.

Samples, diagnostics, and docs

  • Sample windows no longer unconditionally call AttachDevTools() in debug builds.
  • build/Avalonia.Diagnostics.props
    • Makes diagnostics opt-in via UseAvaloniaDiagnostics=true and routes that to ProDiagnostics.
  • .github/workflows/docs.yml
    • Splits docs into a build job plus a push-only deploy job so pull requests stop attempting Pages deployment.
  • site/config.scriban and related docs articles
    • Keep netstandard2.0 as the default API extraction target, while overriding the Avalonia 12 packages to net8.0 and the Uno control package to net10.0.

Validation

Validated with:

dotnet build Svg.Skia.slnx -c Release
dotnet test Svg.Skia.slnx -c Release --no-build

Observed results from the latest full solution run:

  • ShimSkiaSharp.UnitTests: 128 passed
  • Svg.Model.UnitTests: 64 passed
  • Svg.Editor.Skia.UnitTests: 10 passed
  • Svg.Editor.Svg.UnitTests: 4 passed
  • Svg.Controls.Skia.Uno.UnitTests: 17 passed
  • Svg.Controls.Avalonia.UnitTests: 10 passed
  • Svg.Controls.Skia.Avalonia.UnitTests: 19 passed
  • Svg.Editor.Skia.Avalonia.UnitTests: 18 passed
  • Svg.Skia.UnitTests: 1327 passed, 769 skipped

No test failures were observed in the final branch state.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e5fa69bfb7

ℹ️ 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".

Comment thread Directory.Packages.props Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1cbc3e21f9

ℹ️ 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".

Comment thread .github/workflows/docs.yml
@wieslawsoltes wieslawsoltes changed the title Upgrade Avalonia support to 12.0.0-rc1 Upgrade to Avalonia 12.0 Apr 8, 2026
@wieslawsoltes wieslawsoltes marked this pull request as ready for review April 8, 2026 20:38
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4a5f1b5cfd

ℹ️ 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".

Comment thread Directory.Packages.props
<PackageVersion Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia.ReactiveUI" Version="$(AvaloniaVersion)" />
<PackageVersion Include="ProDiagnostics" Version="$(AvaloniaVersion)" />
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Replace invalid diagnostics package ID

ProDiagnostics is wired as the central diagnostics package version, but this repo’s NuGet.Config only allows nuget.org and Avalonia’s own tooling docs/packages use AvaloniaUI.DiagnosticsSupport (with Avalonia.Diagnostics explicitly deprecated). Because all sample projects import build/Avalonia.Diagnostics.props, restore will attempt to resolve ProDiagnostics at $(AvaloniaVersion) and fail with a missing-package error on a clean environment.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked this after 784f10b9f74cb35512a77fc2b68ac343f9b9d18e (Use ProDiagnostics for devtools) and 1aaaa347d04eb6c579a3b71f942438a090ad8149 (Always reference ProDiagnostics). No code rollback was needed: ProDiagnostics is published on nuget.org, including 12.0.0 (https://api.nuget.org/v3-flatcontainer/prodiagnostics/index.json lists it), and the branch currently restores/builds successfully with the shared build/Avalonia.Diagnostics.props import in place. I also reran dotnet build Svg.Skia.slnx -c Release on the current branch after making the diagnostics wiring unconditional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant