Skip to content

Remove backward-compatibility shims before the first stable release #1819

Backlog

Description

Reactor is still in preview, so this is the time to drop compatibility shims for API shapes that were superseded before (or during) the preview. Anything we keep now becomes a commitment once the first stable release ships.

This issue tracks finding and removing that code. Each item needs evidence that it's safe to remove before it goes.

First item: ModifiedElement

ModifiedElement(Element Inner, ElementModifiers WrappedModifiers) is documented as "Kept for backward compatibility. New code stores modifiers inline on Element.Modifiers."

  • The fluent modifiers stopped producing it in internal commit 8e95edc80 (2026-03-20). That was long before the OSS launch (Pre-launch hardening: security review remediations + OSS launch prep #102, 2026-05-01) and before v0.1.0-preview.1 (2026-06-09), so no public release ever produced it from the DSL.
  • Today .Margin(), .Background(), .OnMount() and every other modifier go through Modify<T> in ElementExtensions.cs, which stores modifiers inline with el with { Modifiers = … }.
  • Nothing in src, samples, tools or the docs constructs it. Only selftest and unit fixtures do, to cover the compat path.
  • The framework still pays for it. Unwrap loops and special cases live in Reconciler.Mount/Update, Reconciler.Modifiers, Reconciler.SourcePublishing, Reconciler.ReactorState, KeyedListDiff, ReactorSourcePublisher and Element.cs. Make Border BorderBrush and Canvas Background modifiers win over the record #1790 also had to add a merged-modifiers copy for Border/Canvas just to keep this path correct. A throwaway benchmark measured that copy at about 224 extra bytes per legacy-wrapped Border on every update.

Migration for an app that builds one by hand is mechanical:

// before
new ModifiedElement(inner, mods)
// after (ElementModifiers.Merge is public), or just use the fluent modifiers
inner with { Modifiers = inner.Modifiers?.Merge(mods) ?? mods }

Removing it means deleting the type and its unwrap paths, converting or deleting the fixtures that exist only for this path, regenerating reactor.api.txt (both copies) and the reference docs, fixing the snippet in docs/guide/reconciliation.md, and adding a CHANGELOG Removed entry with the migration above.

Other candidates (to be filled in)

Look for public or internal surface that exists only to keep an older Reactor shape working. Some patterns to search for:

  • Types, members or overloads documented as "legacy", "backward compat", "kept for compatibility" or "obsolete", or marked [Obsolete].
  • Forwarders or aliases left behind after a rename or move, where the new name is the only one the docs teach.
  • Dual code paths where the framework no longer produces one of the shapes.
  • Options or flags whose only job is to restore pre-preview behavior.

Each candidate goes in the checklist below with its evidence before anything is removed:

  1. When and why the old shape was replaced (commit or PR).
  2. That nothing in the framework, samples, templates, the agent kit or the docs still produces or recommends it.
  3. Who would break (public vs. internal) and the migration.
  4. Whether it shipped in a public preview, and for how long.

Anything that's still the recommended way to do something, or where the evidence is unclear, stays out.

Checklist

  • ModifiedElement: remove the type and its unwrap paths (Remove the legacy ModifiedElement record #1820)
  • Obsolete fluent modifier aliases in ElementExtensions.cs (Visible, Disabled, ShowAddButton and the rest) plus their ModifierSchema aliases
  • ReactorApp.ActiveHost
  • TreeViewNodeData.ContentElement and its reconciler paths
  • Redraw on ChartHandle<T>, PieChartHandle<T> and TreeChartHandle
  • IDockBehavior and DockManager.Behavior
  • ItemsHostOptions
  • Internal PersistedStateCache shim
  • Internal LocaleContext
  • --preview and --preview-list devtools aliases, after moving the doc pipeline, contributor docs and the VS Code extension fallback to --devtools
  • Make DockableContent abstract and drop its positional constructor in favor of Document / ToolWindow. Map saved "dockableContent" panes to Document on load and move the gallery, test app, docking guide and serializer internals over
  • Move the taskbar implementation into TaskbarItem and drop the ReactorWindow shortcuts (Progress, Overlay, SetThumbnailToolbar, ClearThumbnailToolbar)
  • Finish the DataGrid hook-paging migration. Port the client-side sort and filter fallback to the hook path, make it the default, then delete DataPageCache<T>, DataGridState.PageCache, RowKeyCache and ReactorFeatureFlags.UseHookBasedPaging

Evidence for each item is in #1819 (comment) and the decisions on the last four are in #1819 (comment)

Activity

  1. azchohfi commented on Dec 3, 2026

    @azchohfi
    CollaboratorAuthor

    I went through src looking for code that only exists to keep an older Reactor shape compiling or running. Everything in the first list was replaced or marked obsolete before v0.1.0-preview.1 (June 9), so none of it was ever the current API in a public preview. All of it still ships in every preview up to v0.1.0-preview.18 (Nov 12). I searched src, samples, tools, docs (guide templates and pipeline apps), skills/ and plugins/, and ran a positive control for each search so a zero really means zero. ModifiedElement is left out since it's already being handled.

    Ready to remove

    1. Obsolete fluent modifier aliases in ElementExtensions.cs

    Visible, Disabled, DisabledFocusable, Selectable, ReadOnly (TextBox and RatingControl), Editable, Closable, Active, IsAddButtonVisible, ShowAddButton, LightDismiss, and both AccessKeyDisplayRequested overloads.

    2. ReactorApp.ActiveHost

    • Replaced by ReactorApp.PrimaryWindow and ReactorApp.Windows in the window model work (Spec 036: Window model — full implementation (Phases 1-8) #215, 2026-05-08) and marked [Obsolete] in the same PR. Spec 036 §12.4 planned to keep it for two releases and delete it in the third. We're 18 previews in.
    • Framework code already goes through the internal ActiveHostInternal. The only mention outside the declaration is docs/research/investigations/winforms-interop.md, which is a research write-up, not guidance.
    • Public. Use ReactorApp.PrimaryWindow?.Host, or pick a window from ReactorApp.Windows.

    3. TreeViewNodeData.ContentElement

    • Marked [Obsolete] in fix(treeview): typed data-driven TreeView<T> with per-container hosting (#447) #453 (the fix for [Bug] TreeView does not render per-node ContentElement (ListView/GridView do) - #447, 2026-05-30). Node-mode TreeView can't host a prebuilt element, and the doc comment itself says this path renders blank under virtualization recycling. The typed TreeView<T>(items, keySelector, childrenSelector, viewBuilder) replaced it.
    • No sample, doc app or skill sets it. The regedit sample uses node-mode TreeView with plain text, which keeps working.
    • The framework still carries it in Reconciler.Mount (around line 718), Reconciler.Update (around 2034), the TreeChildren strategy in ChildrenStrategy.cs (around 410 to 495) and Reconciler.SourcePublishing (around 489). The GeneratedBindableCustomProperty scoping on the record is there partly to avoid CS0618 on this property. docs/guide/control-reconciler-protocol.md still mentions an "optional per-node ContentElement" and needs a one-line fix.
    • Public. Move to TreeView<T> with a viewBuilder.

    4. Redraw on ChartHandle<T>, PieChartHandle<T> and TreeChartHandle

    • Obsolete since the charts became native element trees (internal commit 177143783, 2026-04-12, before the OSS launch). The method bodies are empty, so a call today silently does nothing.
    • No callers anywhere. The handles themselves stay because OnReady still uses them to hand out the Canvas.
    • Public, now in Reactor.Advanced (it was in the core package at preview.1). Drop the call and re-render through state, e.g. setData(newData).

    5. IDockBehavior and DockManager.Behavior

    • Replaced in docking Phase 2 (feat(045): docking windows Phase 2 — ready for §2.29 review #377, 2026-05-22) by OnContentDocked, OnContentFloating and OnContentFloated. Both are [Obsolete] with "slated for removal one release after Phase 2 ships".
    • Nothing in the docking code reads Behavior or calls OnDocked/OnFloating, so setting it already has no effect. No sample, doc or skill uses it.
    • Public, now in Reactor.Advanced (core package at preview.1). Move handlers to the per-event props. Apps lose nothing at runtime because the hook isn't called today.

    6. ItemsHostOptions

    7. Internal PersistedStateCache shim (Core/PersistedStateCache.cs)

    8. Internal LocaleContext (Core/Localization/LocaleContext.cs)

    • Documented as "kept for backward compatibility" after IntlContexts.Locale replaced it (internal commit e955fe114, 2026-04-08). LocaleProviderComponent still creates one and sets LocaleContext.Current, but nothing reads Current or subscribes to it any more.
    • Internal, no user impact. Delete the class and the two effects that maintain it in LocaleProviderElement.cs. The SharedMessageCache.Flush() that currently runs inside the second effect should stay as a plain effect on locale change.

    Needs a decision

    • --preview and --preview-list devtools flags. This covers DevtoolsCliParser, the public DevtoolsCliOptions.UsedDeprecatedPreview and the VS Code extension's fallback. They were renamed to --devtools in 27e89d916 (2026-04-18), before the OSS launch, so every public package has --devtools. But our own doc pipeline still launches apps with --preview --vscode (tools/Reactor.DocPipeline/ScreenshotCapture.cs), and docs/contributing/doc-pipeline.md and docs/security/threat-model.md still use it. Do we migrate those and drop the alias and the VS Code fallback, or keep the alias through stable?
    • DockableContent's Phase 1 positional constructor. Its doc says it's kept for Phase 1 source compat, and spec 045 §5.3.1 planned an analyzer pointing people to Document(...) and ToolWindow(...). That analyzer was never written, and the gallery docking page, the test app, the docking guide and the layout serializer all still use the old constructor. Is it deprecated, or just the simple way to make a pane? If it's deprecated, samples and docs need to move first.
    • Taskbar shortcuts on ReactorWindow (Progress, Overlay, SetThumbnailToolbar, ClearThumbnailToolbar). TaskbarItem (Spec 054: Windowing evolution #536, 2026-06-06) groups the same features, and the docs say the window shortcuts stay "for compatibility". Both shapes landed before preview.1. The desktop integration guide lists both, while the skills only teach UseWindow()!.TaskbarItem. Keep the shortcuts as convenience API, or make TaskbarItem the only surface? The implementation lives on ReactorWindow, so dropping them means moving it.
    • DataGrid's DataPageCache path behind ReactorFeatureFlags.UseHookBasedPaging, plus DataGridState.RowKeyCache, which is documented as legacy. This is a rollout flag rather than compat code, and the old path is still the default. ReactorFeatureFlags says a flag goes away once its default flips, so shipping stable with it public commits us to both paths. Finish the migration first, or ship the flag?

    Looked at and left out

    • ReactorApp.Run<TRoot> and Run(string, Func<...>). Internal comments call them the "legacy bridge", but they're what the docs, skills and 38 sample files use to start an app.
    • IDockAdapter. Its remarks say it will collapse into Action props, but it isn't obsolete and the docking guide still teaches it.
    • The devtools scope: "app" alias. mur's set-resource --scope app and the devtools skill still use that spelling.
    • GridSizePxRenameRule. Reactor never had GridSize.Pixel, Pixels or Fixed, so it's a did-you-mean for WPF habits, not a migration.
    • mur code that detects or uninstalls the old Microsoft.UI.Reactor.ProjectTemplates pack. That's dev machine cleanup, not API.
    • Docking layout readers that accept older files, and Yoga's legacy stretch errata. One is persisted user data and the other is upstream parity, so both stay.
    • "Legacy" comments in V1Protocol, ElementFactory and IItemViewSource about the int-index and element-based list paths. Those are live paths, not old shapes.
    • A few stale "V1 OFF" comments in handlers. The V1 switch is already gone, so those are comment fixes only.
  2. azchohfi commented on Dec 3, 2026

    @azchohfi
    CollaboratorAuthor

    Decided on the four that were open. We're going with the new shape for all of them, so they're now in the checklist.

    • --preview goes. The doc pipeline, contributor docs and the VS Code fallback move to --devtools first.
    • DockableContent becomes abstract and the positional constructor goes. A plain pane is its own neutral role today, so saved layouts with "dockableContent" panes need to load as Document. Note that Document defaults to CanClose = true and routes to the document area.
    • The ReactorWindow taskbar shortcuts go and TaskbarItem becomes the only surface.
    • The DataGrid moves to hook paging for good. The hook path doesn't have the client-side sort and filter fallback that LoadDataAsync has for sources without ServerSort or ServerFilter, so that has to be ported before the default flips and DataPageCache is deleted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions