[PR #469] [MERGED] feat(solid): allow passing custom CliRenderer to render() #1339

Closed
opened 2026-03-14 09:31:26 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/469
Author: @remorses
Created: 1/4/2026
Status: Merged
Merged: 1/4/2026
Merged by: @kommander

Base: mainHead: feature/solid-custom-renderer


📝 Commits (2)

  • c4de8f8 feat(solid): allow passing custom CliRenderer to render()
  • d9a40a7 fix: hook destroy event for custom renderer to auto-dispose

📊 Changes

1 file changed (+24 additions, -9 deletions)

View changed files

📝 packages/solid/index.ts (+24 -9)

📄 Description

Adds support for passing a custom CliRenderer instance to the render() function as the second parameter, while maintaining backwards compatibility with the existing config-based API.

This enables use cases like rendering OpenTUI in a web browser via WebSocket, where you need a custom renderer implementation instead of the default CLI renderer.

import { createCliRenderer } from "@opentui/core"
import { render } from "@opentui/solid"

const renderer = await createCliRenderer({ /* custom options */ })
const { dispose } = await render(() => <App />, renderer)

// Later
dispose()
  • render() now accepts either CliRendererConfig (existing) or CliRenderer instance (new)
  • render() now returns { dispose } for cleanup when using custom renderer

This PR was written by Opus 4.5 under the strict supervision of @remorses


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/469 **Author:** [@remorses](https://github.com/remorses) **Created:** 1/4/2026 **Status:** ✅ Merged **Merged:** 1/4/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `feature/solid-custom-renderer` --- ### 📝 Commits (2) - [`c4de8f8`](https://github.com/anomalyco/opentui/commit/c4de8f80af895d388b144f76a276423b0e43737f) feat(solid): allow passing custom CliRenderer to render() - [`d9a40a7`](https://github.com/anomalyco/opentui/commit/d9a40a70e8d9a4a2883a19198fc1c9736a3148ed) fix: hook destroy event for custom renderer to auto-dispose ### 📊 Changes **1 file changed** (+24 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `packages/solid/index.ts` (+24 -9) </details> ### 📄 Description Adds support for passing a custom `CliRenderer` instance to the `render()` function as the second parameter, while maintaining backwards compatibility with the existing config-based API. This enables use cases like rendering OpenTUI in a web browser via WebSocket, where you need a custom renderer implementation instead of the default CLI renderer. ```tsx import { createCliRenderer } from "@opentui/core" import { render } from "@opentui/solid" const renderer = await createCliRenderer({ /* custom options */ }) const { dispose } = await render(() => <App />, renderer) // Later dispose() ``` - `render()` now accepts either `CliRendererConfig` (existing) or `CliRenderer` instance (new) - `render()` now returns `{ dispose }` for cleanup when using custom renderer This PR was written by Opus 4.5 under the strict supervision of @remorses --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 09:31:26 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#1339
No description provided.