Repository navigation
Fix Octane TSRX parser compatibility - #10
Merged
thejackshelton merged 1 commit intoAug 12, 2026
Merged
Conversation
trueadm
marked this pull request as ready for review
August 12, 2026 21:32
Contributor
|
Reviewed and merged as-is (rebase, 14147ff) — thanks Dominic, the diff held up well under review: validation claims reproduced locally (cargo test 273/0, clippy clean, parser-api 9/9, addon 1/1), the reconstruct passes are fail-closed, and the diagnostic suppression is narrowly scoped with a carried count. Two follow-ups landed/noted:
One observation, no action needed: dropping |
This was referenced Aug 12, 2026
Closed
This was referenced Aug 14, 2026
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.
Summary
Root cause
The Octane corpus exposed several places where the parser scanner applied ordinary JavaScript or JSX assumptions to valid TSRX authoring forms. A smaller set parsed successfully in OXC but produced a different AST shape or an extra TypeScript diagnostic compared with the reference TSRX parser.
The scanner, projection overlay, marker validation, and reconstruction passes now carry those authored forms explicitly and restore their exact spans and metadata after the single OXC parse.
Impact
The Octane corpus improves from 39 failures to zero failures across 2,137
.tsrxfiles. The compatibility AST remains scaffold-free and the new reconstruction work uses the existing indexed object pass.A warm in-memory Apple arm64 corpus comparison measured a 297.21 ms median for this branch versus 1,616.71 ms for
@tsrx/[email protected], or 5.44x faster.Validation
cargo test --release --locked --offline -p tsrx_syntax -p oxc_adapter -p tsrx_parser_enginecargo clippy --release --locked --offline -p tsrx_syntax -p oxc_adapter -p tsrx_parser_engine --all-targets -- -D warningspnpm test:parser-api(9/9)OXC_TSRX_PARSER_ADDON=packages/toolchain/parser.node pnpm test:parser-addon(1/1)git diff --checkCloses #9