Repository navigation
solid: compile JSX in node_modules again - #2051
Merged
Merged
Conversation
Since 10dd994 the Solid transform skips every file under node_modules. Runtime plugins installed from a registry live there and ship TSX, so their JSX fell through to Bun's generic transform: no reactive props, eager control-flow children and a dropped key prop. JSX is compiled wherever it lives again. Plain JS and TS in node_modules stay excluded, because routing CJS through onLoad breaks its interop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since 10dd994 (in #1149, v0.4.0) the Solid transform skips every file under
node_modules. Runtime plugins installed from a registry live there and often ship TSX, so their JSX falls through to Bun's generic transform. Props are no longer reactive,<Show>/<Match>children are built eagerly, and akeyprop is dropped. Nothing warns.This broke OpenCode TUI plugins installed from npm or git. OpenCode's own docs publish
"./tui": "./src/tui.tsx". In opencode-claude-suite, opening its accounts dialog also built the hidden sign-in screen, which ranclaude auth loginand opened the browser. The dialog never updated and ignored every key. OpenCode first shipped OpenTUI 0.4 on 2026-07-06. Before that, the filter was/\.(js|ts)x/and compiled these files. Some plugins work around the regression: magic-context precompiles its TUI and says why insrc/tui/entry.mjs.JSX is compiled wherever it lives again. Plain JS and TS in
node_modulesstay excluded, because routing CJS throughonLoadbreaks its interop (see the note inruntime-plugin.ts). The runtime plugin and the preload share the same filter (ensureSolidTransformPlugincreates the plugin withoutresolvePath), so the preload also compilesnode_modulesJSX again, as it did before 0.4.0.The node_modules fixture now loads a TSX module from the installed package. Its
<Show when={false}>child must not run. Before this fix the module fails to load, because Bun's generic transform imports@opentui/solid/jsx-dev-runtime, which the runtime plugin never rewrites. In a host that has its own copy of@opentui/solidinstalled next to the plugin, it loads instead and renders without reactivity.Checks:
bun test tests/runtime-plugin-supportpasses (5 tests), and oxfmt and oxlint are clean on the changed files. The full Solid suite fails the same 293 tests with and without this change here. They all come from a stale locallibopentui.dylib, because the native build needs Zig 0.17 and this machine has 0.16.