oxc icon indicating copy to clipboard operation
oxc copied to clipboard

fix(minifier): collapse variables when `join_vars` option is `true`

Open DonIsaac opened this issue 1 year ago • 4 comments

The variable collapse AST pass was only collapsing declarations when CompressOptions::join_vars was true, and skipping when false. This does not follow the behavior documented for this option. This PR fixes this.

DonIsaac avatar Oct 01 '24 17:10 DonIsaac

  • #6227 Graphite
  • #6226 Graphite 👈
  • main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @DonIsaac and the rest of your teammates on Graphite Graphite

DonIsaac avatar Oct 01 '24 17:10 DonIsaac

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

graphite-app[bot] avatar Oct 01 '24 17:10 graphite-app[bot]

CodSpeed Performance Report

Merging #6226 will not alter performance

Comparing don/10-01-fix_minifier_collapse_variables_when_join_vars_option_is_true (ea896ec) with main (4b42047)

Summary

✅ 29 untouched benchmarks

codspeed-hq[bot] avatar Oct 01 '24 17:10 codspeed-hq[bot]

I don't know the minifier at all, so I think best leave Boshen to review this.

overlookmotel avatar Oct 01 '24 22:10 overlookmotel

It appears that the test262 breakage is caused by the void x declaration. However, surprisingly, this pass does not address the void x issue at all!

7086cmd avatar Oct 07 '24 14:10 7086cmd

closed by https://github.com/oxc-project/oxc/pull/6464

Boshen avatar Oct 13 '24 15:10 Boshen