Skip to content

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Sep 30, 2025

DCE options was using "smallest", hence debugger was removed.

fixes #14260

Copilot AI review requested due to automatic review settings September 30, 2025 15:52
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 an issue where the define plugin was incorrectly applying Dead Code Elimination (DCE) with overly aggressive settings, causing debugger statements to be removed when they shouldn't be.

  • Changed DCE options from smallest() to dce() to preserve debugger statements
  • Added test coverage to verify debugger statements are retained after define plugin transformation

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
crates/oxc/src/compiler.rs Updated DCE configuration from smallest() to dce() to fix aggressive removal
napi/transform/test/transform.test.ts Added test case to verify debugger statements are preserved

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

@github-actions github-actions bot added A-transformer Area - Transformer / Transpiler C-bug Category - Bug labels Sep 30, 2025
Copy link
Member Author

Boshen commented Sep 30, 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 Sep 30, 2025

Merge activity

…4264)

DCE options was using "smallest", hence `debugger` was removed.

fixes 14260
@graphite-app graphite-app bot force-pushed the 09-30-fix_napi_transform_fix_define_plugin_not_applying_dce_correctly branch from c69e31e to 013e053 Compare September 30, 2025 15:58
@graphite-app graphite-app bot merged commit 013e053 into main Sep 30, 2025
35 checks passed
@graphite-app graphite-app bot deleted the 09-30-fix_napi_transform_fix_define_plugin_not_applying_dce_correctly branch September 30, 2025 16:04
@Boshen Boshen mentioned this pull request Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-transformer Area - Transformer / Transpiler C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

transformer: debugger is removed when define is used

2 participants