Skip to content

✨ host: add framework-neutral mutation API - #20

Closed
cowboyd wants to merge 1 commit into
tree-lifecyclefrom
tree-host
Closed

cowboyd wants to merge 1 commit into
tree-lifecyclefrom
tree-host

Conversation

@cowboyd

@cowboyd cowboyd commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

React, Preact, Solid, and raw consumers all ultimately need the same small set of operations: create elements and literals, set properties, and insert, move, or remove children. A framework-neutral Host makes those mutations the compatibility boundary for Bombshell, allowing every reconciler to target one model while custom elements extend the same operations through middleware. This prevents the core UI from becoming React-shaped, DOM-shaped, or tied to any one rendering strategy.

The ordered Host element tree is intentionally distinct from the middleware tree. Elements and literals can be assembled while detached, then attaching or reparenting an element creates the corresponding middleware nodes in the correct context. This preserves element identity while letting framework reconcilers perform their normal move operations and gives later layout code a definitive render order.

import { createHost } from './host.ts';

const host = createHost();
const box = host.createElement('box');
const greeting = host.createLiteral('Hello, world!');

host.insertBefore(box, greeting);
host.insertBefore(host.element, box);

This PR adds Host, HostApi, HostElement, HostLiteral, and the extensible HostElements type map. It supports detached subtree construction, attachment, reparenting, same-parent reordering, removal, properties, and literal updates. Tests define the mutation and lifecycle contract framework adapters will consume.

@pkg-pr-new

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

Copy link
Copy Markdown

commit: 6fbb974

@cowboyd
cowboyd force-pushed the tree-host branch 2 times, most recently from b9d2f0a to c0a23d5 Compare August 11, 2026 04:00
@cowboyd
cowboyd force-pushed the tree-host branch 2 times, most recently from 0db862a to f1ad9a8 Compare August 22, 2026 05:24
@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