Skip to content

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Aug 10, 2025

No description provided.

Copilot AI review requested due to automatic review settings August 10, 2025 15:36
@github-actions github-actions bot added A-minifier Area - Minifier C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Aug 10, 2025
Copy link
Member Author

Boshen commented Aug 10, 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.

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 constant folding optimization in the minifier to modify the AST in-place instead of returning Option<Expression>. This eliminates the need for pattern matching on returned values and directly updates expressions when optimizations are possible.

Key changes:

  • Functions now take &mut Expression and modify it directly instead of returning Option<Expression>
  • Removed the outer pattern matching logic that checked for Some(folded_expr) and replaced expressions
  • All fold functions now handle their own expression type checking and state updates

@Boshen Boshen force-pushed the 08-10-refactor_minifier_change_ast_in-place_instead_of_returning_option_expression_ branch from 1ca16f2 to 43f90e9 Compare August 10, 2025 15:40
@codspeed-hq
Copy link

codspeed-hq bot commented Aug 10, 2025

CodSpeed Instrumentation Performance Report

Merging #12969 will not alter performance

Comparing 08-10-refactor_minifier_change_ast_in-place_instead_of_returning_option_expression_ (451bc07) with main (166f5cc)1

Summary

✅ 34 untouched benchmarks

Footnotes

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

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Aug 10, 2025
@Boshen Boshen marked this pull request as draft August 10, 2025 15:42
@Boshen Boshen force-pushed the 08-10-refactor_minifier_change_ast_in-place_instead_of_returning_option_expression_ branch 3 times, most recently from cad73cd to ee2871e Compare August 10, 2025 16:57
@Boshen Boshen marked this pull request as ready for review August 10, 2025 16:57
@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 10, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 08-10-refactor_minifier_change_ast_in-place_instead_of_returning_option_expression_ branch from ee2871e to 451bc07 Compare August 10, 2025 17:03
@graphite-app graphite-app bot merged commit 451bc07 into main Aug 10, 2025
29 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 10, 2025
@graphite-app graphite-app bot deleted the 08-10-refactor_minifier_change_ast_in-place_instead_of_returning_option_expression_ branch August 10, 2025 17:09
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-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants