Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(minifier): compress (a = _a) != null ? a : b and (a = _a) != null ? a.b() : undefined #8823

Conversation

sapphi-red
Copy link
Contributor

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

Compresses (a = _a) != null ? a : b to (a = _a) ?? b and (a = _a) != null ? a.b() : undefined to (a = _a).b(). This commonly happens when lowered.

Copy link
Contributor Author

sapphi-red commented Feb 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.

@github-actions github-actions bot added A-minifier Area - Minifier C-enhancement Category - New feature or request labels Feb 1, 2025
@sapphi-red sapphi-red marked this pull request as ready for review February 1, 2025 13:39
Copy link

codspeed-hq bot commented Feb 1, 2025

CodSpeed Performance Report

Merging #8823 will not alter performance

Comparing 01-31-feat_minifier_compress_a__a_null_a_b_and_a__a_null_a.b_undefined_ (5cfea76) with main (0568210)

Summary

✅ 33 untouched benchmarks

@sapphi-red sapphi-red force-pushed the 01-31-refactor_minifier_extract_extract_id_or_assign_to_id_method branch from 357135a to 117c289 Compare February 1, 2025 14:17
@Boshen Boshen changed the base branch from 01-31-refactor_minifier_extract_extract_id_or_assign_to_id_method to graphite-base/8823 February 1, 2025 14:24
@github-actions github-actions bot added the A-ast Area - AST label Feb 1, 2025
@sapphi-red sapphi-red marked this pull request as draft February 1, 2025 14:26
@sapphi-red sapphi-red force-pushed the 01-31-feat_minifier_compress_a__a_null_a_b_and_a__a_null_a.b_undefined_ branch from 97e953e to 49e1b11 Compare February 1, 2025 14:27
@Boshen Boshen changed the base branch from graphite-base/8823 to main February 1, 2025 14:30
@Boshen Boshen force-pushed the 01-31-feat_minifier_compress_a__a_null_a_b_and_a__a_null_a.b_undefined_ branch from 49e1b11 to 8dc8a5a Compare February 1, 2025 14:30
@sapphi-red sapphi-red force-pushed the 01-31-feat_minifier_compress_a__a_null_a_b_and_a__a_null_a.b_undefined_ branch from 8dc8a5a to 591a58b Compare February 1, 2025 15:46
@sapphi-red sapphi-red marked this pull request as ready for review February 1, 2025 15:47
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Feb 2, 2025
Copy link
Member

Boshen commented Feb 2, 2025

Merge activity

  • Feb 1, 8:08 PM EST: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Feb 1, 8:09 PM EST: A user added this pull request to the Graphite merge queue.
  • Feb 1, 8:15 PM EST: A user merged this pull request with the Graphite merge queue.

…null ? a.b() : undefined` (#8823)

Compresses `(a = _a) != null ? a : b` to `(a = _a) ?? b` and `(a = _a) != null ? a.b() : undefined` to `(a = _a).b()`. This commonly happens when lowered.
@graphite-app graphite-app bot force-pushed the 01-31-feat_minifier_compress_a__a_null_a_b_and_a__a_null_a.b_undefined_ branch from 591a58b to 5cfea76 Compare February 2, 2025 01:09
@graphite-app graphite-app bot merged commit 5cfea76 into main Feb 2, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 01-31-feat_minifier_compress_a__a_null_a_b_and_a__a_null_a.b_undefined_ branch February 2, 2025 01:15
@oxc-bot oxc-bot mentioned this pull request Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue A-ast Area - AST A-minifier Area - Minifier C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants