Skip to content

refactor(estree/tokens): move logic for JSX identifiers into JSXState struct#19839

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/02-22-refactor_estree_tokens_move_logic_for_jsx_identifiers_into_jsxstate_struct
Feb 28, 2026
Merged

refactor(estree/tokens): move logic for JSX identifiers into JSXState struct#19839
graphite-app[bot] merged 1 commit intomainfrom
om/02-22-refactor_estree_tokens_move_logic_for_jsx_identifiers_into_jsxstate_struct

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Feb 28, 2026

Refactor. Move all state required to track when identifier tokens should be output as Identifier or JSXIdentifier tokens into a JSXState struct.

Copy link
Member Author

overlookmotel commented Feb 28, 2026


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.

@overlookmotel overlookmotel marked this pull request as ready for review February 28, 2026 12:42
Copilot AI review requested due to automatic review settings February 28, 2026 12:42
@overlookmotel overlookmotel self-assigned this Feb 28, 2026
@overlookmotel overlookmotel added A-parser Area - Parser A-linter-plugins Area - Linter JS plugins labels Feb 28, 2026
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

Refactors JSX-related token emission logic by consolidating the “are we inside a JSX expression member access?” tracking fields into a dedicated JSXState struct inside oxc_estree_tokens, keeping the visitor logic simpler and more encapsulated.

Changes:

  • Replace individual JSX depth counters on ESTreeTokenContext with a single jsx_state: JSXState.
  • Centralize enter/exit logic for JSX expressions and member expressions in JSXState.
  • Reuse JSXState::should_emit_jsx_identifier() in identifier visitors to decide between Identifier and JSXIdentifier.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 28, 2026

Merging this PR will not alter performance

✅ 52 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/02-22-refactor_estree_tokens_move_logic_for_jsx_identifiers_into_jsxstate_struct (0778205) with main (42bd431)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@overlookmotel overlookmotel force-pushed the om/02-22-fix_linter_plugins_decode_escapes_in_identifier_tokens branch from a175b31 to 425151b Compare February 28, 2026 12:59
@overlookmotel overlookmotel force-pushed the om/02-22-refactor_estree_tokens_move_logic_for_jsx_identifiers_into_jsxstate_struct branch from 6be5cf1 to 7604ef3 Compare February 28, 2026 12:59
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Feb 28, 2026
Copy link
Member Author

overlookmotel commented Feb 28, 2026

Merge activity

  • Feb 28, 12:59 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Feb 28, 1:05 PM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Feb 28, 1:22 PM UTC: The Graphite merge queue couldn't merge this PR because it had merge conflicts.
  • Feb 28, 1:23 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Feb 28, 1:29 PM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Feb 28, 1:36 PM UTC: Merged by the Graphite merge queue.

@graphite-app graphite-app bot changed the base branch from om/02-22-fix_linter_plugins_decode_escapes_in_identifier_tokens to graphite-base/19839 February 28, 2026 13:02
@overlookmotel overlookmotel marked this pull request as draft February 28, 2026 13:15
@overlookmotel overlookmotel marked this pull request as ready for review February 28, 2026 13:16
@graphite-app graphite-app bot changed the base branch from graphite-base/19839 to main February 28, 2026 13:21
@graphite-app graphite-app bot requested a review from camc314 as a code owner February 28, 2026 13:21
@overlookmotel overlookmotel force-pushed the om/02-22-refactor_estree_tokens_move_logic_for_jsx_identifiers_into_jsxstate_struct branch from 7604ef3 to 0778205 Compare February 28, 2026 13:23
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Feb 28, 2026
…e` struct (#19839)

Refactor. Move all state required to track when identifier tokens should be output as `Identifier` or `JSXIdentifier` tokens into a `JSXState` struct.
@graphite-app graphite-app bot force-pushed the om/02-22-refactor_estree_tokens_move_logic_for_jsx_identifiers_into_jsxstate_struct branch from 0778205 to fd73e84 Compare February 28, 2026 13:30
@graphite-app graphite-app bot merged commit fd73e84 into main Feb 28, 2026
21 checks passed
@graphite-app graphite-app bot deleted the om/02-22-refactor_estree_tokens_move_logic_for_jsx_identifiers_into_jsxstate_struct branch February 28, 2026 13:36
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 28, 2026
This was referenced Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins A-parser Area - Parser C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants