Skip to content

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Aug 13, 2025

fixes #13050

Copilot AI review requested due to automatic review settings August 13, 2025 06:14
Copy link
Member Author

Boshen commented Aug 13, 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 A-ast Area - AST C-bug Category - Bug labels Aug 13, 2025
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 fixes a bug in the minifier where using and await using declarations were being incorrectly removed as unused. The fix prevents the removal of these declarations because their usage through Symbol.dispose cannot be statically determined.

  • Added a safety check to prevent removal of using declarations
  • Implemented a new is_using() helper method to identify using declarations
  • Added test coverage for both using and await using scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
crates/oxc_minifier/src/peephole/remove_unused_declaration.rs Added safety check to prevent removal of using declarations and corresponding tests
crates/oxc_ast/src/ast_impl/js.rs Added is_using() helper method to identify using declarations

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

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Aug 13, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 13, 2025

Merge activity

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 13, 2025

CodSpeed Instrumentation Performance Report

Merging #13052 will not alter performance

Comparing 08-13-fix_minifier_do_not_remove_using_x_ (6686cc4) with main (92a3550)

Summary

✅ 34 untouched benchmarks

@graphite-app graphite-app bot force-pushed the 08-13-fix_minifier_do_not_remove_using_x_ branch from a183a93 to 6686cc4 Compare August 13, 2025 06:20
@graphite-app graphite-app bot merged commit 6686cc4 into main Aug 13, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 08-13-fix_minifier_do_not_remove_using_x_ branch August 13, 2025 06:26
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast Area - AST A-minifier Area - Minifier C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

minifier: should not remove using a = even if a is not used unless the value is known to not have Symbol.dispose

2 participants