Skip to content

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Aug 12, 2025

Copilot AI review requested due to automatic review settings August 12, 2025 14:27
@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 12, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added A-minifier Area - Minifier C-enhancement Category - New feature or request labels Aug 12, 2025
@Boshen Boshen force-pushed the 08-12-refactor_minifier_separate_.minify_and_.dce_methods branch from 12f4e5f to 78fa81e Compare August 12, 2025 14:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the minifier API by introducing new .minify() and .dce() methods to replace the existing .build() method, and implements dead code elimination (DCE) to run in a loop for better optimization. The changes improve the minifier's API clarity and enhance dead code elimination effectiveness.

Key changes:

  • Replace .build() method calls with .minify() across the codebase
  • Add .dce() method for dead code elimination only
  • Implement loop-based DCE execution with iteration tracking

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tasks/minsize/src/lib.rs Updates method call from .build() to .minify()
napi/playground/src/lib.rs Updates method call from .build() to .minify()
napi/minify/src/lib.rs Updates method call from .build() to .minify()
crates/oxc_minifier/tests/peephole/dead_code_elimination.rs Comments out test cases and adds new complex test case
crates/oxc_minifier/src/peephole/remove_dead_code.rs Removes manual state change tracking
crates/oxc_minifier/src/peephole/mod.rs Refactors DCE to run in loop with iteration tracking
crates/oxc_minifier/src/lib.rs Adds new .minify() and .dce() methods
crates/oxc_minifier/src/compressor.rs Updates DCE methods to return iteration count
crates/oxc_minifier/examples/minifier.rs Updates method call from .build() to .minify()

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 12, 2025

CodSpeed Instrumentation Performance Report

Merging #13026 will not alter performance

Comparing 08-12-refactor_minifier_separate_.minify_and_.dce_methods (993db89) with main (9c05e2f)

Summary

✅ 34 untouched benchmarks

@Boshen Boshen force-pushed the 08-12-refactor_minifier_separate_.minify_and_.dce_methods branch from c84365b to 78fa81e Compare August 12, 2025 14:51
Copy link
Member Author

Boshen commented Aug 12, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

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

@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 12, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 08-12-refactor_minifier_separate_.minify_and_.dce_methods branch from 78fa81e to 993db89 Compare August 12, 2025 14:58
@graphite-app graphite-app bot merged commit 993db89 into main Aug 12, 2025
31 checks passed
@graphite-app graphite-app bot deleted the 08-12-refactor_minifier_separate_.minify_and_.dce_methods branch August 12, 2025 15:05
taearls pushed a commit to taearls/oxc that referenced this pull request Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-minifier Area - Minifier C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

minifier: does not eliminate unnecessary side-effect free function call [Bug]: Unable to eliminate dead code

2 participants