Skip to content

Complete Octane parser compatibility - #12

Merged
thejackshelton merged 1 commit into
tsrx-org:mainfrom
trueadm:codex/octane-parser-compatibility
Aug 14, 2026
Merged

thejackshelton merged 1 commit into
tsrx-org:mainfrom
trueadm:codex/octane-parser-compatibility

Conversation

@trueadm

@trueadm trueadm commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • publish the supported oxc-tsrx/tsrx-core-compat subpath from the main npm package
  • materialize the TypeScript fields, source locations, directive keyword origins, and complete scoped-CSS AST/hash expected by @tsrx/core compiler consumers
  • preserve authored UTF-16 spans for TypeScript descendants and remove synthetic empty statements produced by JSX block comments
  • make binary Program transfers work across JavaScript realms and keep the parser bundle-safe under Vite

Root cause

PR #10 removed the original Octane corpus parse failures, but the released compatibility path still lacked the AST data Octane consumes. The eager native route also omitted TypeScript fields, identifier-owned TypeScript descendants were not traversed during span reconstruction, and one projected JSX comment escaped as a synthetic EmptyStatement.

The integration additionally exposed two host-boundary assumptions: native typed arrays can come from a different JavaScript realm, and Vite treats dynamic new URL(..., import.meta.url) addon lookup as an asset glob.

Impact

The public subpath now parses all 2,140 tracked Octane .tsrx files with zero failures. Octane's focused compiler, source-segment, and scoped-style suites pass all 285 tests against the local package.

In four warmed whole-corpus rounds on Apple arm64, the compatibility subpath averaged 786 ms versus 1,955 ms for @tsrx/[email protected], about 2.5x faster end to end.

This is a follow-up to #9 and #10.

Validation

  • cargo test --release --locked --offline -p tsrx_parser_engine
  • cargo clippy --release --locked --offline -p tsrx_parser_engine -p parser_napi_binding --all-targets -- -D warnings
  • pnpm test (211/211)
  • pnpm run test:parser-api (11/11)
  • compatibility facade tests (17/17)
  • packaging metadata, dist freshness, and outside-consumer install tests (6/6)
  • focused Octane compiler/style tests (285/285)
  • full Octane corpus replay (2,140/2,140)
  • pnpm exec tsc -p packages/tsrx-core-compat/tsconfig.json
  • git diff --check

@trueadm
trueadm marked this pull request as ready for review August 14, 2026 20:52
@thejackshelton
thejackshelton merged commit 4b3f019 into tsrx-org:main Aug 14, 2026
10 checks passed
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