mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
After studying google closure compiler, I'm leaning towards a multi-ast-pass infrastructure for the minifier. This is one of the few places where we are going to trade maintainability over performance, given the goal of the minifier is compression size not performance. All of the terminologies and separation of concerns are aligned with google closure compiler. Infrastructure of `terser` and `esbuild` are not suitable for us to study nor pursuit. Their code are so tightly coupled - I failed to comprehend any of them every time I try to walk through a piece of optmization. Google closure compiler despite being written in Java, it's actually the most readable minifier out there. To improve performance between ast passes, I envision a change detection system over a portion of the code. The benchmark will demonstrate the performance regression of running 5 ast passes instead of 2. To complete this PR, I need to figure out "fix-point" and order of these ast passes. |
||
|---|---|---|
| .. | ||
| misc | ||
| src | ||
| Cargo.toml | ||
| codegen_babel.snap | ||
| codegen_misc.snap | ||
| codegen_runtime_test262.snap | ||
| codegen_sourcemap.snap | ||
| codegen_test262.snap | ||
| codegen_typescript.snap | ||
| minifier_babel.snap | ||
| minifier_test262.snap | ||
| parser_babel.snap | ||
| parser_misc.snap | ||
| parser_test262.snap | ||
| parser_typescript.snap | ||
| prettier_babel.snap | ||
| prettier_misc.snap | ||
| prettier_test262.snap | ||
| prettier_typescript.snap | ||
| README.md | ||
| transformer_babel.snap | ||
| transformer_misc.snap | ||
| transformer_test262.snap | ||
| transformer_typescript.snap | ||
| transpile.snap | ||
Coverage
Tools are tested against test262, babel and TypeScript for conformance.
Clone the test repositories beforehand:
just submodules
Development
# full run
cargo coverage
cargo coverage js # for test262
cargo coverage babel # for babel
cargo coverage ts # for typescript
# run in watch
cargo watch -x 'coverage js'
# filter for a file path
cargo watch -x 'coverage js --filter filter-file-path'
# find crash scene by turning off rayon and print out the test cases in serial
cargo coverage -- --debug
# Run after submodules are updated
UPDATE_SNAPSHOT=1 just c