Thanks to visit codestin.com
Credit goes to lib.rs

192 releases (breaking)

Uses new Rust 2024

new 0.132.0 May 18, 2026
0.130.0 May 11, 2026
0.123.0 Mar 30, 2026
0.106.0 Dec 29, 2025
0.0.1 Mar 30, 2023

#1067 in Programming languages

Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

337,248 downloads per month
Used in 353 crates (106 directly)

MIT license

4MB
68K SLoC

Oxc AST

Abstract Syntax Tree definitions for JavaScript, TypeScript, and JSX.

Overview

This crate provides comprehensive AST (Abstract Syntax Tree) node definitions that support the full spectrum of JavaScript and TypeScript syntax, including JSX. The AST closely follows ECMAScript specifications while providing ergonomic APIs for manipulation.

Key Features

  • Complete language support: JavaScript, TypeScript, JSX, and TSX
  • ECMAScript compliant: AST structure follows official specifications
  • Memory efficient: Designed to work with oxc_allocator for fast allocation
  • Visitor patterns: Integrates with oxc_ast_visit for traversal
  • Type-safe: Leverages Rust's type system for correctness

AST Design Principles

The AST design differs from estree in several important ways:

  • Explicit identifiers: Uses specific types like BindingIdentifier, IdentifierReference, and IdentifierName instead of generic Identifier
  • Precise assignment targets: AssignmentExpression.left uses AssignmentTarget instead of generic Pattern
  • Literal specialization: Replaces generic Literal with BooleanLiteral, NumericLiteral, StringLiteral, etc.
  • Evaluation order: Field order follows ECMAScript evaluation order for consistency

Architecture

The AST is designed for:

  • Parse: Efficient construction during parsing
  • Transform: Easy manipulation during transpilation
  • Visit: Systematic traversal for analysis
  • Codegen: Clean conversion back to source code

All AST nodes are allocated in an arena (oxc_allocator) for optimal performance.

Dependencies

~5MB
~78K SLoC