Skip to content

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Oct 3, 2025

as, any should be allowed to use as a variable name.

@github-actions github-actions bot added the C-bug Category - Bug label Oct 3, 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.

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 3, 2025

CodSpeed Instrumentation Performance Report

Merging #14315 will degrade performances by 9.24%

Comparing 10-02-fix_mangler_allow_using_typescript_keywords_as_variable_names (5d3114c) with main (0a42d7f)1

Summary

❌ 2 regressions
✅ 35 untouched

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

Benchmarks breakdown

Benchmark BASE HEAD Change
mangler[RadixUIAdoptionSection.jsx] 11.5 µs 12.7 µs -9.24%
mangler[binder.ts] 721 µs 743.4 µs -3.01%

Footnotes

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

@sapphi-red sapphi-red marked this pull request as ready for review October 3, 2025 14:55
Copilot AI review requested due to automatic review settings October 3, 2025 14:55
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 a mangler issue by allowing TypeScript keywords like as and any to be used as variable names. The change replaces a custom keyword checking function with the standard oxc_syntax reserved keyword checker, which only prevents mangling of actual JavaScript reserved words rather than TypeScript-specific keywords.

  • Replaced custom is_keyword function with oxc_syntax::keyword::is_reserved_keyword
  • Removed the custom keyword list that incorrectly included TypeScript keywords
  • Added oxc_syntax dependency to support the new keyword checking

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
crates/oxc_mangler/src/lib.rs Updated keyword checking logic and removed custom keyword function
crates/oxc_mangler/Cargo.toml Added oxc_syntax dependency for standard keyword checking
tasks/minsize/minsize.snap Updated minification test snapshots reflecting improved mangling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sapphi-red
Copy link
Member Author

I'm not sure about the perf regression. Maybe the phf lookup is slower than the matches!?

@sapphi-red sapphi-red requested a review from Boshen October 3, 2025 14:56
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Oct 3, 2025
Copy link
Member

Boshen commented Oct 3, 2025

Merge activity

`as`, `any` should be allowed to use as a variable name.
@graphite-app graphite-app bot force-pushed the 10-02-fix_mangler_allow_using_typescript_keywords_as_variable_names branch from 603e004 to 5d3114c Compare October 3, 2025 15:40
@graphite-app graphite-app bot merged commit 5d3114c into main Oct 3, 2025
28 checks passed
@graphite-app graphite-app bot deleted the 10-02-fix_mangler_allow_using_typescript_keywords_as_variable_names branch October 3, 2025 15:46
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Oct 3, 2025
@Boshen Boshen mentioned this pull request Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants