Skip to content

Conversation

@sushichan044
Copy link
Contributor

fixes #14512

Fixes the compress.unused option implemented in PR #11796 to properly accept boolean values from the napi binding.

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 11, 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-bug Category - Bug labels Oct 11, 2025
@sushichan044 sushichan044 changed the title fix(napi/minify): support boolean values for compress.unused option fix(napi/minify): handle boolean values for compress.unused option Oct 11, 2025
@sushichan044 sushichan044 marked this pull request as ready for review October 11, 2025 20:20
Copilot AI review requested due to automatic review settings October 11, 2025 20:20
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 the compress.unused option in the NAPI minify binding to properly handle boolean values alongside the existing string option. The change allows users to pass true/false boolean values in addition to the string "keep_assign".

  • Updated the TypeScript type annotation from "true | false | 'keep_assign'" to "boolean | 'keep_assign'"
  • Changed the field type from Option<String> to Option<Either<bool, String>> to support both boolean and string values
  • Implemented proper pattern matching logic to handle boolean values and map them to the appropriate enum variants

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

@Boshen Boshen self-assigned this Oct 14, 2025
@sushichan044 sushichan044 force-pushed the sushichan044-202510120135-napi-minify-unused branch from c93aa2f to df5926c Compare October 14, 2025 10:23
@sushichan044
Copy link
Contributor Author

Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

Thank you!

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

graphite-app bot commented Oct 15, 2025

Merge activity

  • Oct 15, 1:25 AM UTC: @sushichan044 we removed the merge queue label because we could not find a Graphite account associated with your GitHub profile.

You must have a Graphite account in order to use the merge queue. Create an account and try again using this link

@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Oct 15, 2025
@Boshen Boshen merged commit 14686a4 into oxc-project:main Oct 15, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

napi/minifier: compress.unused option cannot be set correctly from napi binding

3 participants