Skip to content

Add support for JavaScript JSX files (.jsx)#674

Open
redlotusaustin wants to merge 2 commits intoCodeGraphContext:mainfrom
redlotusaustin:feature/jsx-support-468
Open

Add support for JavaScript JSX files (.jsx)#674
redlotusaustin wants to merge 2 commits intoCodeGraphContext:mainfrom
redlotusaustin:feature/jsx-support-468

Conversation

@redlotusaustin
Copy link

Summary

  • Add .jsx extension support using JavaScript parser (tree-sitter's JavaScript parser natively handles JSX syntax)
  • Add TSX language support using dedicated tsx parser (fixes JSX parsing errors in .tsx files)
  • Fix import ordering in typescriptjsx.py (imports must be at top of file)
  • Optimize pre_scan_typescript: combine 6 queries into 1 (6x faster tree traversal)
  • Optimize _find_react_components: combine 4 queries into 1 (4x faster tree traversal)
  • Add comprehensive sample_jsx.jsx test fixture with React patterns
  • Add 7 unit tests for JSX parser in test_jsx_parser.py
  • Update documentation in sample_project_javascript/README.md

Testing

All tests pass:

32 passed, 2 skipped in 0.60s

Verification

Extension Language Parser JSX Support
.jsx javascript JavascriptTreeSitterParser
.tsx tsx TypescriptJSXTreeSitterParser

Fixes #468

Fixes CodeGraphContext#468

- Add .jsx extension support using JavaScript parser (already handles JSX syntax)
- Add TSX language support using dedicated tsx parser (fixes JSX parsing errors)
- Add tsx to LANGUAGE_ALIASES in tree_sitter_manager.py
- Register TypescriptJSXTreeSitterParser for .tsx files in graph_builder.py
- Fix import ordering in typescriptjsx.py (imports must be at top of file)
- Optimize typescriptjsx.py: combine 6 queries into 1 in pre_scan_typescript
- Optimize typescriptjsx.py: combine 4 queries into 1 in _find_react_components
- Add comprehensive sample_jsx.jsx test fixture
- Add 7 unit tests for JSX parser (test_jsx_parser.py)
- Update sample_project_javascript/README.md with JSX documentation
@vercel
Copy link

vercel bot commented Mar 7, 2026

Someone is attempting to deploy a commit to the shashankss1205's projects Team on Vercel.

A member of the Team first needs to authorize it.

Resolved conflicts in graph_builder.py:
- Kept elixir support from upstream
- Added tsx parser registration
- Changed .tsx to use tsx parser instead of typescript
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.

Add support for JavaScript JSX files (.jsx)

1 participant