Skip to content

Proposal: Reactor — React-style declarative UI framework for MAUI (next to Comet)#297

Draft
simonrozsival wants to merge 1 commit into
dotnet:mainfrom
simonrozsival:reactor-proposal
Draft

Proposal: Reactor — React-style declarative UI framework for MAUI (next to Comet)#297
simonrozsival wants to merge 1 commit into
dotnet:mainfrom
simonrozsival:reactor-proposal

Conversation

@simonrozsival
Copy link
Copy Markdown
Member

Proposal: host Reactor as an experimental MAUI UI framework, next to Comet

This is a draft proposal PR. It adds a single document — src/Reactor/README.md — placing Reactor as a sibling product to Comet. It deliberately contains no framework source code yet; it's meant to start a conversation about whether/how to host the experiment here.

What is Reactor?

A React-style declarative UI framework for C#: UI is an immutable virtual element tree, state is managed with hooks (UseState, UseEffect, UseReducer, …), and a reconciler diffs successive trees and patches only what changed on real native controls. It originates from microsoft/microsoft-ui-reactor (WinUI 3).

An external PoC ran this unchanged counter source on Mac Catalyst via a MAUI backend, validating that the hook/state engine and reconciler are platform-neutral:

class MyApp : Component
{
    public override Element Render()
    {
        var (count, setCount) = UseState(0);
        return VStack(
            Heading($"Count: {count}"),
            HStack(8,
                Button("-", () => setCount(count - 1)),
                Button("+", () => setCount(count + 1))));
    }
}

Why maui-labs / why next to Comet

maui-labs already hosts Comet, an experimental declarative C# UI framework for MAUI, so it's the natural home for a second one. Reactor and Comet are complementary mental models (React hooks + reconciler vs. MVU + signals), and both care about Yoga/Flexbox layout.

What this PR contains

  • src/Reactor/README.md — the proposal (positioning, proposed package/folder layout, open questions). No source from microsoft/microsoft-ui-reactor.

Suggested follow-up (not in this PR, to avoid README conflicts)

A Reactor (proposal) entry could be added to the root Products list, immediately after the Comet section:

Reactor (proposal)

React-style declarative UI framework for .NET MAUI — virtual element tree, hooks (UseState, UseEffect, …), and a reconciler that patches only what changed. Ported from WinUI 3 (microsoft/microsoft-ui-reactor); a sibling to Comet. See src/Reactor/README.md.

Package Description
Reactor.Core (proposed) Platform-neutral element tree, hooks, and reconciler
Reactor.Maui (proposed) .NET MAUI backend (renders Reactor elements as MAUI controls)

Open questions for maintainers

  1. Scope — MAUI-native framework, or the larger "write once, WinUI + MAUI" story (requires decoupling the WinUI-coupled engine)?
  2. Naming — keep Microsoft.UI.Reactor, or rebrand for MAUI (Microsoft.Maui.Reactor / Reactor)?
  3. Provenance — how to bring code over (CLA / licensing / THIRD-PARTY-NOTICES)?
  4. Relationship to Comet — independent product or shared infrastructure (Yoga, tooling)?

Feedback welcome before any framework code lands.

Adds a proposal document (src/Reactor/README.md) for Reactor, a React-style
declarative UI framework (virtual element tree + hooks + reconciler) ported
from WinUI 3 (microsoft/microsoft-ui-reactor). Proposal only: no framework
source is included, placing it as a sibling to Comet.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@davidortinau
Copy link
Copy Markdown
Contributor

One difference I want to make sure is understood when comparing Comet to others is that it bypasses Microsoft.Maui.Controls and directly implements ITextButton.

  • Comet has a thinner abstraction and faster path to the native control.
  • Comet is free to implement it's own styling and reactive systems without conflicting or competing with Microsoft.Maui.Controls

How would this adoption of Microsoft.UI.Reactor interact with the native controls? If I'm reading correctly it's more like https://github.com/adospace/reactorui-maui which wraps Microsoft.Maui.Controls so instead of losing a layer like Comet you've gained a layer?

Re: Yoga - would it be possible to have it shared across .NET frameworks/experiences instead of having a new one for every experiment? https://github.com/dotnet/maui-labs/tree/main/src/Comet/src/Comet.Layout.Yoga

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants