Skip to content

fix(ast_visit): fix visitation order for FormalParameters in Utf8ToUtf16Converter#11019

Merged
graphite-app[bot] merged 1 commit intomainfrom
05-13-fix_ast_visit_fix_visitation_order_for_formalparameters_in_utf8toutf16converter_
May 14, 2025
Merged

fix(ast_visit): fix visitation order for FormalParameters in Utf8ToUtf16Converter#11019
graphite-app[bot] merged 1 commit intomainfrom
05-13-fix_ast_visit_fix_visitation_order_for_formalparameters_in_utf8toutf16converter_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented May 13, 2025

Fix visitation order in Utf8ToUtf16Converter to process span offsets in ascending order in FormalParameters.

FormalParameters's span starts before TSThisParameter that precedes it in types like Function, so visiting TSThisParameter followed by FormalParameters results in out-of-order span offset conversion.

FormalParameters's span doesn't appear in ESTree AST, so solution is just to skip converting its span entirely.

Copy link
Member Author

overlookmotel commented May 13, 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 May 13, 2025

CodSpeed Instrumentation Performance Report

Merging #11019 will create unknown performance changes

Comparing 05-13-fix_ast_visit_fix_visitation_order_for_formalparameters_in_utf8toutf16converter_ (2bdb338) with main (d0d04e3)

Summary

🆕 36 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 codegen[checker.ts] N/A 22.8 ms N/A
🆕 codegen_sourcemap[checker.ts] N/A 67 ms N/A
🆕 formatter[antd.js] N/A 715.8 ms N/A
🆕 formatter[react.development.js] N/A 8.1 ms N/A
🆕 formatter[typescript.js] N/A 1.1 s N/A
🆕 isolated-declarations[vue-id.ts] N/A 58.5 ms N/A
🆕 lexer[RadixUIAdoptionSection.jsx] N/A 21.7 µs N/A
🆕 lexer[antd.js] N/A 25 ms N/A
🆕 lexer[cal.com.tsx] N/A 6.1 ms N/A
🆕 lexer[checker.ts] N/A 14.9 ms N/A
🆕 lexer[pdf.mjs] N/A 4 ms N/A
🆕 linter[RadixUIAdoptionSection.jsx] N/A 2.8 ms N/A
🆕 linter[cal.com.tsx] N/A 1.2 s N/A
🆕 linter[checker.ts] N/A 3.1 s N/A
🆕 mangler[antd.js] N/A 16 ms N/A
🆕 mangler[react.development.js] N/A 294.4 µs N/A
🆕 mangler[typescript.js] N/A 39.6 ms N/A
🆕 minifier[antd.js] N/A 164.4 ms N/A
🆕 minifier[react.development.js] N/A 1.8 ms N/A
🆕 minifier[typescript.js] N/A 288.8 ms N/A
... ... ... ... ...

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

@overlookmotel overlookmotel marked this pull request as ready for review May 13, 2025 17:18
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label May 14, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented May 14, 2025

Merge activity

…oUtf16Converter` (#11019)

Fix visitation order in `Utf8ToUtf16Converter` to process span offsets in ascending order in `FormalParameters`.

`FormalParameters`'s span starts before `TSThisParameter` that precedes it in types like `Function`, so visiting `TSThisParameter` followed by `FormalParameters` results in out-of-order span offset conversion.

`FormalParameters`'s span doesn't appear in ESTree AST, so solution is just to skip converting its span entirely.
@graphite-app graphite-app bot force-pushed the 05-13-fix_ast_visit_fix_visitation_order_for_tstemplateliteraltype_in_utf8toutf16converter_ branch from 53a2430 to 282420c Compare May 14, 2025 01:23
@graphite-app graphite-app bot force-pushed the 05-13-fix_ast_visit_fix_visitation_order_for_formalparameters_in_utf8toutf16converter_ branch from cc8948c to 2bdb338 Compare May 14, 2025 01:24
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label May 14, 2025
Base automatically changed from 05-13-fix_ast_visit_fix_visitation_order_for_tstemplateliteraltype_in_utf8toutf16converter_ to main May 14, 2025 01:29
@graphite-app graphite-app bot merged commit 2bdb338 into main May 14, 2025
27 checks passed
@graphite-app graphite-app bot deleted the 05-13-fix_ast_visit_fix_visitation_order_for_formalparameters_in_utf8toutf16converter_ branch May 14, 2025 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast-tools Area - AST tools C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant