Conversation
Bump Avalonia core packages from 11.2.4 to 12.0.1 and port ClipboardService to the new IAsyncDataTransfer / DataFormat API. - SetTextAsync: now an extension method in Avalonia.Input.Platform. - SetDataAsync: build a DataTransfer with a DataTransferItem holding a DataFormat.CreateBytesPlatformFormat(format) value, then SetDataAsync. - GetFormatsAsync: read DataFormat[] via GetDataFormatsAsync and expose their string Identifier to keep IClipboardService's shape. - GetDataAsync: TryGetDataAsync returns a disposable IAsyncDataTransfer; pull the value for the requested format and dispose. Pin Avalonia.Controls.DataGrid to 12.0.0 explicitly to override the stale 11.1.0 transitive that ships via AvaloniaEdit and can't parse v12 bindings. Avalonia.Diagnostics has no 12.x release; 11.3.14 is the last maintained version and restores cleanly alongside 12.0.1. It remains Debug-only gated in the csproj.
Avalonia 12 removed in-process DevTools. The replacement (AvaloniaUI.DiagnosticsSupport + external AvaloniaUI Developer Tools app) requires a paid license we don't have, and the previous Avalonia.Diagnostics 11.3.14 crashes at runtime when F12 attaches against the 12.x core. Drop the reference entirely rather than ship a dead F12 binding.
Accidentally added in e3dbde8; should stay out of the repo's gitignore so each contributor can decide what to ignore via their personal global gitignore or a local exclude.
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.
Bumps Avalonia core from 11.2.4 to 12.0.1 and ports the one place the new API broke us (clipboard).
Changes
Directory.Packages.props— Avalonia / Avalonia.Desktop / Avalonia.Themes.Fluent / Avalonia.Fonts.Inter → 12.0.1; Avalonia.AvaloniaEdit / AvaloniaEdit.TextMate → 12.0.0; TextMateSharp.Grammars → 2.0.3.Avalonia.Controls.DataGridpinned to 12.0.0 — a stale 11.1.0 was coming in transitively via AvaloniaEdit and couldn't parse v12 bindings, which took outTableEditorControl.axaml. Adding an explicit top-level reference forces the correct version.ClipboardService.csrewritten against the new clipboard API:SetTextAsyncis nowClipboardExtensions.SetTextAsync(extension onIClipboard, requiresusing Avalonia.Input.Platform).SetDataObjectAsync(IDataObject)is gone; replacement is aDataTransfercontaining aDataTransferItem.Create(DataFormat.CreateBytesPlatformFormat(format), bytes)passed toIClipboard.SetDataAsync(IAsyncDataTransfer).GetFormatsAsync()is nowClipboardExtensions.GetDataFormatsAsync()and returnsDataFormat[]; we project.Identifierto keepIClipboardService'sstring[]shape so no callers change.GetDataAsync(format)is nowclipboard.TryGetDataAsync()returning a disposableIAsyncDataTransfer; we wrap it inusingand pull the typed value withTryGetValueAsync(DataFormat.CreateBytesPlatformFormat(format)).IClipboardService's public shape is unchanged, soMainWindowViewModelandRawClipboardWindowdidn't need changes.Avalonia.Diagnosticsdropped entirely. Avalonia 12 removed in-process F12 DevTools. The replacement bridge (AvaloniaUI.DiagnosticsSupport+ an external AvaloniaUI Developer Tools desktop app) requires a paid license. The previousAvalonia.Diagnostics 11.3.14restored alongside 12.0.1 core but crashes at runtime when F12 attaches. Rather than ship a dead F12 binding or adopt a paid tool, the package is removed.Avalonia.Xaml.Interactionsdropped. No XAML or C# in the codebase referenced it.FluentAvaloniaUIdropped. The only usage was one helper class (DataPackage) in the clipboard copy path, which Avalonia 12'sDataTransferItemreplaces directly. None of FluentAvaloniaUI's controls were ever used; it had been unused from the moment of the ClipboardService rewrite above.Why the clipboard API changed (upstream context)
Avalonia PR #20521 replaced the
IDataObject+stringmodel with an async-first, typed, multi-item model:stringformat identifiers gave no guidance on platform-vs-application-vs-in-process scoping. The newDataFormattype makes that explicit and typed (DataFormat<byte[]>,DataFormat<string>, etc.).IDataObjectflattened that to one blob."AS IS" passthrough semantics are preserved for platform-specific formats (
CreateBytesPlatformFormat), which is what SharpFM needs for FileMaker'sMac-XM*types.