Skip to content

Comments

feat(minifier): store symbol information for for init variables#13507

Merged
graphite-app[bot] merged 1 commit intomainfrom
09-01-feat_minifier_store_symbol_information_for_for_init_variables
Sep 1, 2025
Merged

feat(minifier): store symbol information for for init variables#13507
graphite-app[bot] merged 1 commit intomainfrom
09-01-feat_minifier_store_symbol_information_for_for_init_variables

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Sep 1, 2025

Store the symbol information for "for init variables" so that the transformation that relies on it can use it.

@github-actions github-actions bot added A-minifier Area - Minifier C-enhancement Category - New feature or request labels Sep 1, 2025
Copy link
Member Author

sapphi-red commented Sep 1, 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.

@sapphi-red sapphi-red marked this pull request as ready for review September 1, 2025 13:25
Copilot AI review requested due to automatic review settings September 1, 2025 13:25
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 how for statement initializer variables are handled in the minifier by moving the logic from symbol-level tracking to more targeted transformation-specific checks.

  • Removes the for_statement_init field from SymbolValue struct
  • Implements local checks for for statement context in transformations that need it
  • Updates affected optimizations to use the new approach

Reviewed Changes

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

Show a summary per file
File Description
crates/oxc_minifier/src/symbol_value.rs Removes for_statement_init field from SymbolValue struct
crates/oxc_minifier/src/ctx.rs Removes for statement initialization logic and field assignment
crates/oxc_minifier/src/peephole/inline.rs Adds local is_for_statement_init function and updates value initialization logic
crates/oxc_minifier/src/peephole/remove_unused_expression.rs Removes for statement check and adds new test cases
tasks/track_memory_allocations/allocs_minifier.snap Updates memory allocation snapshots
tasks/minsize/minsize.snap Updates minification size snapshots

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

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 1, 2025

CodSpeed Instrumentation Performance Report

Merging #13507 will not alter performance

Comparing 09-01-feat_minifier_store_symbol_information_for_for_init_variables (b4dfddd) with main (65aca9e)1

Summary

✅ 37 untouched benchmarks

Footnotes

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

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

graphite-app bot commented Sep 1, 2025

Merge activity

Store the symbol information for "for init variables" so that the transformation that relies on it can use it.
@graphite-app graphite-app bot force-pushed the 09-01-feat_minifier_store_symbol_information_for_for_init_variables branch from cc81738 to b4dfddd Compare September 1, 2025 14:56
@graphite-app graphite-app bot merged commit b4dfddd into main Sep 1, 2025
24 checks passed
@graphite-app graphite-app bot deleted the 09-01-feat_minifier_store_symbol_information_for_for_init_variables branch September 1, 2025 15:01
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 1, 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.

1 participant