Skip to content

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Oct 15, 2025

Implemented drop_labels feature, which is implemented in esbuild and rolldown.
The plan is to use this in Rolldown.

Copy link
Member Author

sapphi-red commented Oct 15, 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.

@github-actions github-actions bot added A-minifier Area - Minifier C-enhancement Category - New feature or request labels Oct 15, 2025
@sapphi-red sapphi-red marked this pull request as ready for review October 15, 2025 16:06
Copilot AI review requested due to automatic review settings October 15, 2025 16:06
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 15, 2025

CodSpeed Performance Report

Merging #14634 will not alter performance

Comparing 10-15-feat_minifier_add_drop_labels_feature (d09c7ee) with main (73f2cbb)1

Summary

✅ 37 untouched

Footnotes

  1. No successful run was found on main (d09c7ee) during the generation of this report, so 73f2cbb was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

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

Add support for dropping labeled statements during minification via a new drop_labels option, aligning with esbuild/rolldown behavior.

  • Introduces CompressOptions.drop_labels (FxHashSet) in oxc_minifier
  • Implements removal of matching labeled statements in peephole optimizer
  • Adds tests for dropping specific labels; wires default in napi, adds rustc-hash dep there

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
napi/minify/src/options.rs Imports FxHashSet and sets drop_labels to default when converting to internal options
napi/minify/Cargo.toml Adds rustc-hash workspace dependency
crates/oxc_minifier/src/options.rs Adds drop_labels option to CompressOptions with docs and defaults
crates/oxc_minifier/src/peephole/remove_dead_code.rs Removes labeled statements when label is in drop_labels
crates/oxc_minifier/tests/peephole/dead_code_elimination.rs Adds tests and a helper to verify drop_labels behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Oct 16, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 16, 2025

Merge activity

Implemented `drop_labels` feature, which is implemented in [esbuild](https://esbuild.github.io/api/#drop-labels) and [rolldown](https://rolldown.rs/apis/config-options#droplabels).
The plan is to use this in Rolldown.
@graphite-app graphite-app bot force-pushed the 10-15-feat_minifier_add_drop_labels_feature branch from c635d1f to d09c7ee Compare October 16, 2025 06:07
@graphite-app graphite-app bot merged commit d09c7ee into main Oct 16, 2025
28 checks passed
@graphite-app graphite-app bot deleted the 10-15-feat_minifier_add_drop_labels_feature branch October 16, 2025 06:13
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Oct 16, 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.

3 participants