Skip to content

feat(minifier): inline and evaluate constant values #11819

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Boshen
Copy link
Member

@Boshen Boshen commented Jun 19, 2025

part of #2646

Rules for constant evaluation is much harder than I thought, because the resulting code length can be larger:

const a = 'aaaa';
const b = 'bbbb';
const c = a + b'

I may reduce this PR to inline template variables, it is safe for length <= 3:

const a = 'aaa';
const b = 'bbb';
const c = `${a}${b}`

@github-actions github-actions bot added A-minifier Area - Minifier C-enhancement Category - New feature or request labels Jun 19, 2025
@Boshen Boshen marked this pull request as draft June 19, 2025 14:19
Copy link
Member Author

Boshen commented Jun 19, 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

codspeed-hq bot commented Jun 19, 2025

CodSpeed Instrumentation Performance Report

Merging #11819 will improve performances by 25.07%

Comparing 06-19-feat_minifier_inline_and_evaluate_constant_values (bf95fc3) with main (5a46641)

Summary

⚡ 1 improvements
✅ 37 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
mangler[cal.com.tsx] 3.4 ms 2.7 ms +25.07%

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