mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 13:06:00 +03:00
[GH-ISSUE #288] Framework-specific lifecycle dispose missing on destroy #73
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#73
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @veracioux on GitHub (Nov 9, 2025).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/288
While writing TUI tests for opencode, I noticed that the onCleanup (solidjs) was only invoked when the process exited. This caused a lot of test flakiness because the components had event listeners that survived between tests.
I think that this kind of cleanup should be performed when the renderer is destroyed. I'll create a PoC PR.
@kommander commented on GitHub (Nov 10, 2025):
@msmps @Adictya can you weigh in here for the framework packages?
@Adictya commented on GitHub (Nov 10, 2025):
the api makes sense for solid, solid-js/web also returns a dispose method like its suggested in the poc
@veracioux commented on GitHub (Nov 11, 2025):
@kommander Do I have the green light to implement it, at least for solidjs? I would like to have it available for the opencode tests.
@kommander commented on GitHub (Nov 11, 2025):
Sure, seems like it makes sense. Shouldn't break current behavior and tests, right?
@veracioux commented on GitHub (Nov 11, 2025):
@kommander No it shouldn't. The opencode tests definitely work with the poc from the PR cuz I've been using the development version of opentui from the poc PR branch for a while.
@veracioux commented on GitHub (Nov 11, 2025):
@kommander Could you also give feedback on this in the PR: https://github.com/sst/opentui/pull/289
@kommander commented on GitHub (Nov 11, 2025):
Mhh an onDestroy callback like on the renderables could make sense. It needs to be try/catch wrapped though so when something goes wrong in the callback it does not prevent the shutdown from completing, because that would leave the renderer and the terminal in a bad state.
@veracioux commented on GitHub (Nov 12, 2025):
@kommander Fix for solidjs is ready in https://github.com/sst/opentui/pull/289 (see updated PR description). I'll be playing around with React as well but I'm gonna create a separate PR for that later.
@msmps commented on GitHub (Nov 12, 2025):
i've made some changes to the react package and
createRootnow returns anunmountmethod so this should be handled at the consumer level.i've also introduced the
testRendererfor consumers here.@veracioux commented on GitHub (Nov 13, 2025):
Nice. Closing this then.