ReviewOS

also looking at this

stacks/dtsx

fix: generate React component declarations

#3104
Merged chris wants to merge agent/react-component-declarations into main
14 files +875 -35
9 days ago

What changed

  • infer portable JSX.Element returns for function, arrow, nullable, fragment, member-tag, generic, and class components
  • preserve forwardRef, memo, lazy, namespace, named, and type-only React imports when emitted declarations reference them
  • scan JSX initializer nesting correctly so default exports and following declarations are not swallowed
  • support named and nested higher-order component wrappers without broadening ordinary call inference
  • cover both semantic inference and isolated-declarations paths, including the Zig emitter

Why

JSX brackets were previously interpreted as comparisons, arithmetic, or generic arguments. This produced incorrect number/boolean component returns, dropped wrapper imports, and could consume declarations following a JSX initializer.

Validation

  • 20 focused React declaration tests pass across the TypeScript and Zig engines
  • 313 Zig/Bun integration tests pass
  • 36 native type-inference tests pass
  • 26 native root scanner/emitter tests pass
  • 1,259 of 1,260 dtsx tests pass; the remaining pre-existing Vue test references the deleted packages/dtsx/test/fixtures/vue/NFTBurnButton.vue fixture
  • typecheck and build pass
  • lint reports zero errors and one pre-existing Markdown warning

14 changed files on the files tab, with 0 review threads.

Sign in to comment on this pull request.