Skip to content

✨ preact: add adapter and hello-world example - #32

Closed
cowboyd wants to merge 1 commit into
tree-solidfrom
tree-preact
Closed

cowboyd wants to merge 1 commit into
tree-solidfrom
tree-preact

Conversation

@cowboyd

@cowboyd cowboyd commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Preact expects a compact DOM-shaped mutation surface, which presents a different integration challenge from Solid’s universal renderer. A small facade can satisfy those expectations by translating document, element, text, attribute, sibling, and listener operations into the Host contract. This validates that Bombshell can meet a framework where it is without leaking DOM assumptions into the core UI.

Like the Solid adapter, a Preact root mounts into an existing attached Host element and owns only reconciliation. Its JSX element types are derived from the same open HostElements map, so built-in and third-party elements retain framework-appropriate children, refs, keys, and event names without duplicating their core property definitions.

import { createUI } from '@clack/ui';
import { createRoot } from '@clack/ui-preact';
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-preact, including a minimal DOM-shaped facade over Host mutations, typed JSX intrinsic elements, and root mounting and unmounting. It adapts properties, text, movement, removal, and event listener identity without adding Preact-specific behavior to @clack/ui. It also adds the equivalent Preact Hello World example.

2026-08-07 01 13 59

@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
Addedpreact@​11.0.0-beta.21001009998100

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@32
npm i https://pkg.pr.new/bombshell-dev/ui/@clack/ui-preact@32
npm i https://pkg.pr.new/bombshell-dev/ui/@clack/ui-solid@32

commit: afb5c8e

@cowboyd
cowboyd marked this pull request as draft August 7, 2026 14:34
@cowboyd
cowboyd force-pushed the tree-preact branch 2 times, most recently from 9d87a66 to ad4a376 Compare August 11, 2026 04:27
@cowboyd
cowboyd force-pushed the tree-preact branch 2 times, most recently from f258057 to f4b8887 Compare August 23, 2026 17:28
@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