Skip to content

✨ react: add adapter and hello-world example - #33

Closed
cowboyd wants to merge 1 commit into
tree-preactfrom
tree-react
Closed

cowboyd wants to merge 1 commit into
tree-preactfrom
tree-react

Conversation

@cowboyd

@cowboyd cowboyd commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

React brings the architecture to the largest JS component ecosystem and completes the initial framework story. A custom React reconciler maps Fiber’s mutation host configuration directly onto the same Host operations already exercised by raw code, Solid, and Preact. Because focus, input, events, layout, invalidation, terminal rendering, and cleanup already belong to lower layers, the React package can remain focused on reconciliation instead of becoming a second TUI implementation.

Mounting into an arbitrary attached Host element makes React composable rather than exclusive: an application can use React for one subtree, another framework elsewhere, or raw Host operations alongside both. Typed lowercase box, text, and input elements preserve familiar JSX and onInput conventions while deriving their actual properties from the framework-neutral element registry.

import { createUI } from '@clack/ui';
import { createRoot } from '@clack/ui-react';
import { HelloWorld } from './app.tsx';

await using ui = await createUI({
	input: process.stdin,
	output: process.stdout,
});

const root = createRoot(ui.host.element);
root.render(<HelloWorld />);

await ui.main();

This PR adds @clack/ui-react, a synchronous mutation-mode React reconciler, typed JSX intrinsic elements, and root mounting and unmounting. React instance, text, property, event, ordering, and removal operations are translated into Host mutations, with an optional commit hook available to consumers. It also adds the React version of the Hello World example.

2026-08-07 01 16 47

@socket-security

socket-security Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​types/​react-reconciler@​0.33.01001007582100
Added@​types/​react@​19.3.01001007993100
Addedreact@​19.3.01001008497100
Addedreact-reconciler@​0.33.01001009997100

View full report

@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
More templates

npm i https://pkg.pr.new/bombshell-dev/ui/@clack/ui@33
npm i https://pkg.pr.new/bombshell-dev/ui/@clack/ui-preact@33
npm i https://pkg.pr.new/bombshell-dev/ui/@clack/ui-react@33
npm i https://pkg.pr.new/bombshell-dev/ui/@clack/ui-solid@33

commit: fb55c35

@cowboyd

cowboyd commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

closing out in favor of a DOM based substrate. See #37

@cowboyd cowboyd closed this Oct 23, 2026
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.

1 participant