Skip to content

Comments

feat(minifier): implement basic single use variable inlining#13275

Merged
graphite-app[bot] merged 1 commit intomainfrom
08-24-feat_minifier_implement_basic_single_use_variable_inlining
Aug 24, 2025
Merged

feat(minifier): implement basic single use variable inlining#13275
graphite-app[bot] merged 1 commit intomainfrom
08-24-feat_minifier_implement_basic_single_use_variable_inlining

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Aug 24, 2025

Ported the basic parts of esbuild's substituteSingleUseSymbolInStmt.
This would allow compressing

let x = fn();
return x;

into

return fn();

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

sapphi-red commented Aug 24, 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.

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 24, 2025

CodSpeed Instrumentation Performance Report

Merging #13275 will degrade performances by 5.72%

Comparing 08-24-feat_minifier_implement_basic_single_use_variable_inlining (66d6005) with main (e7a49ed)1

Summary

❌ 1 regressions
✅ 33 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
minifier[react.development.js] 2.1 ms 2.3 ms -5.72%

Footnotes

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

@sapphi-red sapphi-red force-pushed the 08-24-feat_minifier_implement_basic_single_use_variable_inlining branch from 6bdd8ac to 207945e Compare August 24, 2025 06:04
@sapphi-red sapphi-red changed the base branch from 08-23-feat_minifier_remove_unnecessary_parenthesis_from_nested_optional_chaining to graphite-base/13275 August 24, 2025 06:38
@sapphi-red sapphi-red force-pushed the graphite-base/13275 branch from ac40524 to 35ddeef Compare August 24, 2025 06:39
@sapphi-red sapphi-red force-pushed the 08-24-feat_minifier_implement_basic_single_use_variable_inlining branch from 207945e to 8a71884 Compare August 24, 2025 06:39
@sapphi-red sapphi-red changed the base branch from graphite-base/13275 to 08-23-feat_minifier_remove_unnecessary_parenthesis_from_nested_optional_chaining August 24, 2025 06:39
@sapphi-red sapphi-red changed the base branch from 08-23-feat_minifier_remove_unnecessary_parenthesis_from_nested_optional_chaining to graphite-base/13275 August 24, 2025 06:42
@sapphi-red sapphi-red force-pushed the graphite-base/13275 branch from 35ddeef to 77a4a2f Compare August 24, 2025 06:43
@sapphi-red sapphi-red force-pushed the 08-24-feat_minifier_implement_basic_single_use_variable_inlining branch from 8a71884 to 1c5eea3 Compare August 24, 2025 06:43
@sapphi-red sapphi-red changed the base branch from graphite-base/13275 to 08-23-feat_minifier_remove_unnecessary_parenthesis_from_nested_optional_chaining August 24, 2025 06:43
@sapphi-red sapphi-red marked this pull request as ready for review August 24, 2025 07:03
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Aug 24, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 24, 2025

Merge activity

Ported the basic parts of esbuild's `substituteSingleUseSymbolInStmt`.
This would allow compressing
```js
let x = fn();
return x;
```
into
```js
return fn();
```
@graphite-app graphite-app bot force-pushed the 08-23-feat_minifier_remove_unnecessary_parenthesis_from_nested_optional_chaining branch from 77a4a2f to 53f55a4 Compare August 24, 2025 08:44
@graphite-app graphite-app bot force-pushed the 08-24-feat_minifier_implement_basic_single_use_variable_inlining branch from 1c5eea3 to 66d6005 Compare August 24, 2025 08:45
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 24, 2025
Base automatically changed from 08-23-feat_minifier_remove_unnecessary_parenthesis_from_nested_optional_chaining to main August 24, 2025 08:51
@graphite-app graphite-app bot merged commit 66d6005 into main Aug 24, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 08-24-feat_minifier_implement_basic_single_use_variable_inlining branch August 24, 2025 08:52
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