Conversation
…eplacement The forked universal renderer diverged from solid-js's upstream behavior in cleanChildren(). When called without a marker or replacement (e.g. when Show/Switch hides content), it returned `replacement` which is `undefined`, instead of returning "" like solid-js does. This caused undefined to propagate through the reactive graph as the `current` value in insertExpression, eventually corrupting downstream memo reads. Introduced in #169 when the universal renderer was forked.
@opentui/core
@opentui/react
@opentui/solid
@opentui/core-darwin-arm64
@opentui/core-darwin-x64
@opentui/core-linux-arm64
@opentui/core-linux-x64
@opentui/core-win32-arm64
@opentui/core-win32-x64
commit: |
There was a problem hiding this comment.
Pull request overview
Aligns the forked Solid universal renderer with upstream Solid behavior by ensuring cleanChildren returns the empty-string sentinel ("") instead of undefined when no replacement node is provided, preventing undefined from propagating through insertExpression’s reactive updates.
Changes:
- Update
cleanChildren’s no-marker early return toreplacement ?? ""to preserve Solid’s empty-string sentinel semantics.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adictya
left a comment
There was a problem hiding this comment.
I for the life of me can't find the thread of the bug removing this initially solved, i guess this was a holdover from experimenting with having text without surrounding tags. Explored more edge cases locally as well seems to be fine for now. And if opencode is working then it must be holdover only. Will still keep an eye out
Summary
cleanChildrenin the forked universal renderer to return""instead ofundefinedwhen called without a replacement, matching solid-js's upstream behaviorProblem
When
cleanChildrenis called without amarkerorreplacement(e.g. whenShow/Switchhides content), the no-marker early-return path returnsreplacement— which isundefined. The solid-js upstream returns"".This
undefinedpropagates as thecurrentvalue throughinsertExpression's reactive chain, eventually corrupting downstream memo reads and causing crashes like:Introduced in #169 when the universal renderer was forked from solid-js.
Fix