oxc/crates/oxc_minifier
Song Gao ebc80f6749
refactor(ast)!: change 'raw' from &str to Option<Atom> (#7547)
Fix #7254 

Changed all "raw" properties of literal types (if they have this property) to `Option<Atom>`.

---------

Co-authored-by: overlookmotel <theoverlookmotel@gmail.com>
2024-12-05 00:34:45 +00:00
..
examples refactor(minifier): remove unused ast pass from DCE (#7540) 2024-11-29 08:10:07 +00:00
src refactor(ast)!: change 'raw' from &str to Option<Atom> (#7547) 2024-12-05 00:34:45 +00:00
tests refactor(ast)!: change 'raw' from &str to Option<Atom> (#7547) 2024-12-05 00:34:45 +00:00
Cargo.toml release(crates): v0.39.0 (#7643) 2024-12-04 19:43:22 +08:00
CHANGELOG.md release(crates): v0.39.0 (#7643) 2024-12-04 19:43:22 +08:00
README.md chore(doc): replace main/master to tag/commit to make the url always accessible (#7298) 2024-11-16 21:00:30 +08:00

Minifier

A JavaScript minifier has three components:

  1. printer
  2. mangler
  3. compressor

Mangler

The mangler implementation is part of the SymbolTable residing in oxc_semantic. It is responsible for shortening variables. Its algorithm should be gzip friendly.

The printer is also responsible for printing out the shortened variable names.

Compressor

The compressor is responsible for rewriting statements and expressions for minimal text output. Terser is a good place to start for learning the fundamentals.

Terser Tests

The fixtures are copied from https://github.com/terser/terser/tree/v5.9.0/test/compress