Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 28, 2025

When printing "${", it's unnecessary to escape the $ unless the quote character is a backtick.

Copy link
Member Author

overlookmotel commented Mar 28, 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-codegen Area - Code Generation C-bug Category - Bug labels Mar 28, 2025
@overlookmotel overlookmotel marked this pull request as ready for review March 28, 2025 10:35
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 28, 2025

CodSpeed Instrumentation Performance Report

Merging #10103 will create unknown performance changes

Comparing 03-28-fix_codegen_do_not_escape_in_strings_unless_using_backtick_as_quote (9b6e344) with 03-28-fix_codegen_prevent_arithmetic_overflow_calculating_quote_for_stringliteral_s (c903e42)

Summary

🆕 33 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 codegen[checker.ts] N/A 22.6 ms N/A
🆕 codegen_sourcemap[checker.ts] N/A 65.7 ms N/A
🆕 isolated-declarations[vue-id.ts] N/A 58.3 ms N/A
🆕 lexer[RadixUIAdoptionSection.jsx] N/A 21.5 µs N/A
🆕 lexer[antd.js] N/A 24.8 ms N/A
🆕 lexer[cal.com.tsx] N/A 5.9 ms N/A
🆕 lexer[checker.ts] N/A 14.8 ms N/A
🆕 lexer[pdf.mjs] N/A 3.9 ms N/A
🆕 linter[RadixUIAdoptionSection.jsx] N/A 2.7 ms N/A
🆕 linter[cal.com.tsx] N/A 1.2 s N/A
🆕 linter[checker.ts] N/A 2.9 s N/A
🆕 mangler[antd.js] N/A 16 ms N/A
🆕 mangler[react.development.js] N/A 294.5 µs N/A
🆕 mangler[typescript.js] N/A 39.7 ms N/A
🆕 minifier[antd.js] N/A 165.6 ms N/A
🆕 minifier[react.development.js] N/A 1.8 ms N/A
🆕 minifier[typescript.js] N/A 291.6 ms N/A
🆕 estree[checker.ts] N/A 96.9 ms N/A
🆕 parser[RadixUIAdoptionSection.jsx] N/A 92.4 µs N/A
🆕 parser[antd.js] N/A 113.2 ms N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@overlookmotel overlookmotel force-pushed the 03-28-fix_codegen_prevent_arithmetic_overflow_calculating_quote_for_stringliteral_s branch from d0ff0cc to 92a03b8 Compare March 28, 2025 12:07
@overlookmotel overlookmotel force-pushed the 03-28-fix_codegen_do_not_escape_in_strings_unless_using_backtick_as_quote branch from 196072e to dba7db6 Compare March 28, 2025 12:07
@overlookmotel overlookmotel changed the base branch from 03-28-fix_codegen_prevent_arithmetic_overflow_calculating_quote_for_stringliteral_s to graphite-base/10103 March 28, 2025 12:59
@overlookmotel overlookmotel force-pushed the 03-28-fix_codegen_do_not_escape_in_strings_unless_using_backtick_as_quote branch from dba7db6 to 87a539a Compare March 28, 2025 13:01
@overlookmotel overlookmotel changed the base branch from graphite-base/10103 to 03-28-fix_codegen_prevent_arithmetic_overflow_calculating_quote_for_stringliteral_s March 28, 2025 13:01
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Mar 28, 2025
@overlookmotel
Copy link
Member Author

The effect on output sizes is odd. Output for antd.js is 78 bytes shorter after this PR (before minification), but the gzipped size is slightly larger. Whereas typescript.js is smaller both with/without gzip.

Edit: Actually I can't replicate the larger gzipped size locally.

cargo run -p oxc_minifier --example minifier target/antd.js -- --mangle --nospace > out.js
gzip -9 out.js

That produces 5 bytes shorter output after this PR. So I don't understand why oxc_minsize reports the gzipped size as increasing. @Boshen?

@graphite-app
Copy link
Contributor

graphite-app bot commented Mar 29, 2025

Merge activity

…uote (#10103)

When printing `"${"`, it's unnecessary to escape the `$` unless the quote character is a backtick.
@graphite-app graphite-app bot force-pushed the 03-28-fix_codegen_prevent_arithmetic_overflow_calculating_quote_for_stringliteral_s branch from d3afce0 to c903e42 Compare March 29, 2025 12:50
@graphite-app graphite-app bot force-pushed the 03-28-fix_codegen_do_not_escape_in_strings_unless_using_backtick_as_quote branch from 87a539a to 9b6e344 Compare March 29, 2025 12:50
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 29, 2025
Base automatically changed from 03-28-fix_codegen_prevent_arithmetic_overflow_calculating_quote_for_stringliteral_s to main March 29, 2025 13:10
@graphite-app graphite-app bot merged commit 9b6e344 into main Mar 29, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 03-28-fix_codegen_do_not_escape_in_strings_unless_using_backtick_as_quote branch March 29, 2025 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-codegen Area - Code Generation C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants