Files
oxc-project__oxc/crates/oxc_minifier/README.md
Boshen f1862c4303 docs(minifier): add comprehensive documentation for oxc_minifier (#13938)
Goal of this PR is too feed AI with more context.

## Summary
Add extensive documentation to guide development of the world's best JavaScript minifier.

## Documentation Added

### New Files
- **ARCHITECTURE.md**: Design philosophy and component overview
- **OPTIMIZATIONS.md**: Catalog of all 17 current optimizations and planned additions
- **ASSUMPTIONS.md**: Document code assumptions for safe optimizations
- **CORRECTNESS.md**: Testing strategies and validation guarantees
- **ROADMAP.md**: Development phases and success metrics
- **CLAUDE.md**: AI assistant guide for development

### Updated Files
- **README.md**: Updated with features, testing infrastructure, and documentation links
- **src/lib.rs**: Enhanced module documentation with examples

## Goals
This documentation establishes the vision for oxc_minifier:
- 🎯 **Smallest output size** (beat Closure Compiler)
- ✅ **100% correctness** (full test suite compliance)
- ⚡ **Reasonable performance** (competitive with esbuild)

## Inspiration
Learning from industry leaders:
- Closure Compiler (advanced size optimizations)
- Terser/UglifyJS (comprehensive battle-tested transforms)
- esbuild (efficient algorithms)
- SWC (modern Rust architecture)

## Benefits
- Clear development roadmap
- Comprehensive optimization documentation
- AI-friendly development guide
- Testing and correctness guarantees
- Documented assumptions for safe optimizations

🤖 Generated with [Claude Code](https://claude.ai/code)
2025-09-20 10:46:19 +00:00

1.8 KiB

Oxc Minifier

Next-generation JavaScript/TypeScript minifier achieving best-in-class compression.

Inspiration

  • Closure Compiler: Advanced size optimizations
  • Terser/UglifyJS: Comprehensive battle-tested transforms
  • esbuild: Efficient algorithms and architecture
  • SWC: Modern Rust performance

Key Features

  • Maximum compression through exhaustive optimizations
  • 100% correctness with comprehensive testing
  • Fixed-point iteration for optimal size
  • Arena allocation for performance

Current Performance

See tasks/minsize for compression benchmarks.

  • Matching/beating esbuild on many libraries
  • Full test262, Babel, TypeScript conformance

Usage

use oxc_minifier::{Minifier, MinifierOptions};

let options = MinifierOptions::default();
let minifier = Minifier::new(options);
let result = minifier.minify(&mut program);

Testing Infrastructure

  • just minsize - Track compression benchmarks
  • cargo coverage - Conformance tests (test262, Babel, TypeScript)
  • tasks/e2e - Real-world E2E testing

Development

  • just test - Run all tests
  • cargo run -p oxc_minifier --example minifier - Try the minifier

Key Dependencies

Documentation