Skip to content

fix: preserve TypeScript qualified names during instrumentation - #46

Merged
stackloomdev merged 2 commits into
mainfrom
codex/fix-typescript-type-instrumentation
Jul 27, 2026
Merged

stackloomdev merged 2 commits into
mainfrom
codex/fix-typescript-type-instrumentation

Conversation

@stackloomdev

Copy link
Copy Markdown
Owner

What changed

  • Skip Babel TSType subtrees while collecting runtime inputs from JSX expressions.
  • Preserve qualified names such as React.CSSProperties and React.ComponentProps.
  • Keep runtime values inside the same assertion, including style, traceable.
  • Add a regression test that reparses the generated TSX.
  • Prepare 1.0.0-beta.5 release metadata and Changelog.

Root cause

CauseScope traversed the type-only branch of a TSAsExpression and wrapped the React identifier in React.CSSProperties with a runtime capture call. That produced an invalid TSQualifiedName whose left node was a CallExpression.

User impact

Real TypeScript component libraries using JSX style assertions can run the CauseScope development transform without crashing. Runtime provenance remains available, and production behavior is unchanged.

Closes #45.

Validation

  • Transformed the reported real-world sidebar.tsx successfully.
  • pnpm verify:release
  • pnpm check
  • pnpm test:e2e:firefox
  • Packed package verified against Vite 5.4, 6.4, 7.3, and 8.1.
  • Independent code review: no Critical, Important, or Minor findings.

@stackloomdev
stackloomdev merged commit a73d30b into main Jul 27, 2026
11 checks passed
@stackloomdev
stackloomdev deleted the codex/fix-typescript-type-instrumentation branch July 27, 2026 05:03
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.

Babel instrumentation crashes on qualified TypeScript names inside JSX expressions

1 participant