Skip to content

✨ render: request frames after host mutations - #22

Closed
cowboyd wants to merge 1 commit into
tree-layoutfrom
tree-render
Closed

cowboyd wants to merge 1 commit into
tree-layoutfrom
tree-render

Conversation

@cowboyd

@cowboyd cowboyd commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Once layout can produce a frame, mutations need a way to say that the visible UI is stale. They should not decide whether rendering happens immediately, at the next animation frame, after coalescing, or through a future incremental renderer. A minimal requestRender() API creates that scheduling seam so raw code and framework adapters can trigger the same pipeline without owning terminal output themselves.

Host rendering middleware observes mutations at their semantic source. Moving an attached element can invalidate both its previous and new locations, while detached work produces no unnecessary render request; the eventual UI layer remains free to turn those requests into the simplest correct renderer first.

import { RenderApi } from './render.ts';

RenderApi.around(host.root, {
	requestRender([node], next) {
		next(node);
		scheduleFrame();
	},
});

This PR adds RenderApi and useHostRenderer(). Host insertion, movement, removal, property changes, and literal changes now request rendering for the affected attached nodes, with tests covering each invalidation case.

@pkg-pr-new

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

Copy link
Copy Markdown

commit: 3d06cb8

@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