Skip to content

feat(opentui): add universal renderer binding - #852

Merged
trueadm merged 9 commits into
octanejs:mainfrom
jonkwheeler:jon/feat/opentui-binding
Aug 26, 2026
Merged

trueadm merged 9 commits into
octanejs:mainfrom
jonkwheeler:jon/feat/opentui-binding

Conversation

@jonkwheeler

@jonkwheeler jonkwheeler commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add @octanejs/opentui, an Octane universal renderer binding for @opentui/[email protected]
  • cover the complete built-in terminal intrinsic catalogue, public hooks, portals, refs, scheduling, errors, and plugin slots
  • pin and vendor the exact upstream source and license, with a machine-checked parity manifest and offline materialization lock
  • run framework-neutral contracts under Node and the native renderer integration suite under Bun in CI

Why

  • OpenTUI applications should be able to use Octane component execution and compilation without embedding React Reconciler
  • the binding keeps @opentui/core responsible for layout, input, rendering, and native resources while Octane owns component lifecycle and reconciliation

Changes

  • implement a transactional universal host driver over OpenTUI renderables
  • add .opentui.tsrx compiler configuration and renderer-local intrinsic types
  • port OpenTUI's hooks, text modifiers, TimeToFirstDraw, test utility, and slot registry surface
  • preserve OpenTUI callback names, receiver semantics, and multi-argument callback shapes
  • record the exact @opentui/[email protected] package integrity, commit, MIT license, public export crosswalk, and upstream test inventory
  • fix React-port inventory discovery for fixture modules and test-prefixed render helpers discovered during the immutable preflight
  • document intentional divergences and add a patch changeset

Validation

  • pnpm sync
  • pnpm format:check
  • pnpm typecheck
  • OpenTUI Node contracts — 2 files, 4 tests
  • OpenTUI Bun native integration — 1 file, 9 tests
  • exact OpenTUI parity harness — 4 registered cases
  • immutable upstream materialization, public exports, source-publication, test-marker, package-pack, and CI-workflow checks
  • current-head CI — all required checks passed on 67774aaee
  • full local pnpm test — browser projects require the CI browser harness; current-head CI is the authoritative full-suite result

Risk / follow-ups

  • OpenTUI 0.5.8's native renderer requires Bun 1.3+ or Node 26.4+ with --experimental-ffi
  • terminal rendering is client-only; SSR and hydration are unsupported
  • the parity manifest is deliberately recorded-unverified: all 56 upstream React registrations are pinned and inventoried, but this PR does not claim they have all been adapted one-for-one
  • React DevTools and OpenTUI's React runtime-plugin bundling subpaths are intentionally outside this port

Provenance

  • An agent produced this diff (agent-authored)

Note

Medium Risk
Adds a new native-FFI terminal renderer and compiler surface (Bun 1.3+ or Node 26.4+ with --experimental-ffi); scope is mostly isolated to the new package but expands CI and binding discovery paths.

Overview
Introduces @octanejs/opentui, an experimental Octane binding for @opentui/[email protected] that drives terminal UIs through Octane reconciliation instead of React Reconciler, while reusing @opentui/core unchanged.

The package adds .opentui.tsrx compiler support via opentuiRenderers, renderer-local terminal intrinsics (full built-in catalogue plus text modifiers), createRoot / createPortal, public OpenTUI hooks, slot plugins, act / flushSync, and an FFI-backed testRender helper. Upstream @opentui/react sources are pinned and vendored under packages/opentui/upstream with documented export crosswalk and a recorded-unverified parity manifest.

Workspace wiring updates binding inventories and status docs, maps @opentui/react in CLI/MCP tooling, adds packages/opentui to bindings:typecheck, registers the package for external hook slots, and runs OpenTUI native integration tests in CI (pnpm --dir packages/opentui test:native). Lockfile hash churn in existing parity audit JSON and eval manifests reflects the new dependency graph.

Reviewed by Cursor Bugbot for commit 67774aa. Bugbot is set up for automated code reviews on this repo. Configure here.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@github-actions github-actions Bot added the feat PR: new feature or capability label Aug 25, 2026
Comment thread packages/opentui/src/slot.ts Resolved
@github-actions github-actions Bot added the agent-authored Diff or issue body substantially produced by an AI agent label Aug 25, 2026
@github-actions
github-actions Bot marked this pull request as draft August 25, 2026 21:40
@jonkwheeler
jonkwheeler marked this pull request as ready for review August 25, 2026 21:40
Comment thread packages/opentui/src/driver.ts Resolved
jonkwheeler and others added 2 commits August 25, 2026 18:30
- restore deferred image sources after host recreation
- cover slot fallback identity across plugin add, reorder, and removal

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 2289a65. Configure here.

Comment thread packages/opentui/src/slot.ts Resolved
@trueadm
trueadm merged commit 4b44b65 into octanejs:main Aug 26, 2026
31 checks passed
@jonkwheeler
jonkwheeler deleted the jon/feat/opentui-binding branch October 20, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent feat PR: new feature or capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants