You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: tsrx-core: a pending changeset says a comment in an unbraced attribute value's element is text, but #713 made it a comment #729
Two pending @tsrx/core changesets describe the same input in opposite ways, so the next release's changelog will contradict itself and what the parser does.
The parser does what #713 says. The comment is left out of the text's value, and compiled output drops it.
Reproduction Steps
At f73b6760, run pnpm install --frozen-lockfile, then save this as repro.mjs in the repository root and run node repro.mjs:
import{parseModule}from'./packages/tsrx/src/index.js';// The first JSXText node in the tree.functionfindText(node){if(!node||typeofnode!=='object')return;if(node.type==='JSXText')returnnode;for(const[key,child]ofObject.entries(node)){if(key==='loc'||key==='metadata')continue;constfound=findText(child);if(found)returnfound;}}constsource=`export function App() @{ <div title=<b>a /* c */ b</b> />}`;consttext=findText(parseModule(source,'App.tsrx'));console.log(`value ${JSON.stringify(text.value)}, raw ${JSON.stringify(text.raw)}`);
value "a b", raw "a /* c */ b"
Expected: the changelog describes this. parser-element-value-crashes.md says the comment is text, which would give value "a /* c */ b".
Cause
#695 added parser-element-value-crashes.md while acorn-typescript's JSX parser still read that element, where a comment is text. #713 then read the element as template markup and added its own changeset, but left #695's sentence as it was.
Fix Direction
Edit .changeset/parser-element-value-crashes.md before the next release: keep the out-of-memory fix, and drop "The comment is text there, as in TSX, and as a line comment on its own line already was", or say it's a comment, as parser-spread-argument-markup.md does.
Environment
OS: macOS 26.6.2
Browser: n/a
TSRX package and version: @tsrx/core 0.4.0 (origin/main at f73b6760, pending changesets)
Compiler target and version: n/a (parser)
Node Version: 24.18.0
Additional Context
Found while checking how the next @tsrx/core release affects Ripple (Ripple-TS/ripple). In Ripple, the same input (<div title=<b>a /* c */ b</b> />) runs out of memory on @tsrx/core 0.3.3 and 0.4.0 and compiles on main with the comment dropped.
So the changelog reads correctly as history: the earlier release described the behaviour at that point, and #713's release changed it. The parser does what the later entry says.
Activity
jonkwheeler commentedon Oct 29, 2026
Closing: nothing contradicts any more. Both changesets have been released, in separate versions:
/in an opening tag as code (#653, #654, #655) #695 ("The comment is text there, as in TSX"), shipped first, and is atpackages/tsrx/CHANGELOG.mdline 893;So the changelog reads correctly as history: the earlier release described the behaviour at that point, and #713's release changed it. The parser does what the later entry says.