Skip to content

fix(compiler): preserve TSRX setup spans at synthetic semicolons - #3779

Merged
ryansolid merged 1 commit into
solidjs:nextfrom
everton-dgn:fix/tsrx-semicolon-spans
Oct 5, 2026
Merged

ryansolid merged 1 commit into
solidjs:nextfrom
everton-dgn:fix/tsrx-semicolon-spans

Conversation

@everton-dgn

Copy link
Copy Markdown

Summary

The parser projection inserts a semicolon before line-leading markup. For a setup statement without an authored semicolon, that extra byte made the native compiler fail to match the statement to its source span.

Exclude the synthetic terminator when mapping the span back to the source. The adjustment requires contiguous authored segments and markup immediately after the generated separator, so exact statement matching and authored semicolons are preserved.

Fixes #3762.

How did you test this change?

Semicolonless setup before a dynamic tag such as <{Tag} />, and U+2028/U+2029 statement boundaries, still fail earlier in the pinned parsers. Those fixes are being prepared upstream; this PR keeps the current dependency versions. Existing Clippy and rustfmt failures are being repaired separately. WASI and other platforms were not tested.

The parser projection inserts a semicolon before line-leading markup.
Exclude that synthetic terminator when mapping a statement back to its
authored span. Require contiguous authored segments and markup directly
after the separator, preserving exact matching and authored semicolons.

Cover DOM, SSR and universal output, source maps, nearby statements,
comments, Unicode text and LF/CRLF input. Reject unrelated synthetic gaps.

Validation: the reported example fails before the fix and passes after
it. Rust passes in all three feature configurations. Compiler JavaScript
revalidation on next passes, including the rerun of seven timed-out tests.

Fixes solidjs#3762.
@changeset-bot

changeset-bot Bot commented Oct 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b02ccb0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@solidjs/compiler Patch
@solidjs/babel-plugin Patch
@solidjs/diagnostics Patch
@solidjs/element Patch
@solidjs/h Patch
@solidjs/html Patch
@solidjs/signals Patch
solid-js Patch
@solidjs/universal Patch
@solidjs/web Patch
test-integration Patch
todos-server-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codspeed

codspeed Bot commented Oct 4, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 185 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing everton-dgn:fix/tsrx-semicolon-spans (b02ccb0) with next (1b9ceb6)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@ryansolid
ryansolid merged commit ea5f1da into solidjs:next Oct 5, 2026
7 checks passed
@ryansolid

Copy link
Copy Markdown
Member

Merged — thanks for tracking down the synthetic-semicolon span mismatch and for the thorough regression coverage!

— Claude via Cursor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants