Skip to content

Comments

fix(minifier): remove unused long array expressions#13752

Merged
graphite-app[bot] merged 1 commit intomainfrom
09-14-fix_minifier_remove_unused_long_array_expressions
Sep 14, 2025
Merged

fix(minifier): remove unused long array expressions#13752
graphite-app[bot] merged 1 commit intomainfrom
09-14-fix_minifier_remove_unused_long_array_expressions

Conversation

@sapphi-red
Copy link
Member

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

Long array expressions are converted to "str1,str2".split(','), but that was not removed because it was not detected as sideeffect free. This PR fixes that by adding pure = true to the .split call.

@github-actions github-actions bot added A-minifier Area - Minifier C-bug Category - Bug labels Sep 14, 2025
Copy link
Member Author


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 requested a review from Boshen September 14, 2025 08:47
@sapphi-red sapphi-red marked this pull request as ready for review September 14, 2025 08:48
Copilot AI review requested due to automatic review settings September 14, 2025 08:48
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 long array expressions converted to string split operations were not being properly removed by the minifier due to missing side-effect annotations. The fix adds the pure = true annotation to .split() calls to ensure they are detected as side-effect free and can be removed when unused.

  • Adds pure = true parameter to expression_call_with_pure for array-to-split transformations
  • Updates test expectations to include /* @__PURE__ */ comments in generated code
  • Adds test case to verify unused array expressions are properly removed

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 14, 2025

CodSpeed Instrumentation Performance Report

Merging #13752 will not alter performance

Comparing 09-14-fix_minifier_remove_unused_long_array_expressions (3d895cf) with main (c364ad1)1

Summary

✅ 37 untouched

Footnotes

  1. No successful run was found on main (3d895cf) during the generation of this report, so c364ad1 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 Sep 14, 2025
Copy link
Member

Boshen commented Sep 14, 2025

Merge activity

Long array expressions are converted to `"str1,str2".split(',')`, but that was not removed because it was not detected as sideeffect free. This PR fixes that by adding `pure = true` to the `.split` call.
@graphite-app graphite-app bot force-pushed the 09-14-fix_minifier_remove_unused_long_array_expressions branch from 41adbd1 to 3d895cf Compare September 14, 2025 13:15
@graphite-app graphite-app bot merged commit 3d895cf into main Sep 14, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 09-14-fix_minifier_remove_unused_long_array_expressions branch September 14, 2025 13:20
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 14, 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-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants