Skip to content

refactor(estree/tokens): break up into multiple files#19850

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

refactor(estree/tokens): break up into multiple files#19850
graphite-app[bot] merged 1 commit intomainfrom
om/02-22-refactor_estree_tokens_break_up_into_multiple_files

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Feb 28, 2026

Pure refactor. Just break up implementation of tokens serialization into multiple files.

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.

@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_break_up_into_multiple_files (a996b9e) with main (4b0611a)

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 marked this pull request as ready for review February 28, 2026 14:57
Copilot AI review requested due to automatic review settings February 28, 2026 14:57
@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 oxc_estree_tokens token serialization by extracting previously inlined implementation details from lib.rs into focused modules, keeping the public API surface (to_estree_tokens_json / to_estree_tokens_pretty_json and options) intact.

Changes:

  • Moved token serialization visitor + helpers into serialize.rs.
  • Extracted small “compile-time length guarantee” helpers into token_type.rs and u32_string.rs.
  • Extracted JSX token-state tracking into jsx_state.rs and wired modules from lib.rs.

Reviewed changes

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

Show a summary per file
File Description
crates/oxc_estree_tokens/src/lib.rs Reduced to public entrypoints + serializer config; wires new internal modules.
crates/oxc_estree_tokens/src/serialize.rs Houses the token-walking visitor and token serialization logic previously in lib.rs.
crates/oxc_estree_tokens/src/jsx_state.rs Contains JSX state trait + JS/TS implementations previously in lib.rs.
crates/oxc_estree_tokens/src/token_type.rs Extracted TokenType wrapper with max-length guarantee.
crates/oxc_estree_tokens/src/u32_string.rs Extracted U32String wrapper for bounded u32 formatting.

@overlookmotel overlookmotel force-pushed the om/02-22-refactor_estree_tokens_break_up_into_multiple_files branch from c2eaf64 to 928f1e3 Compare February 28, 2026 16:06
@overlookmotel overlookmotel force-pushed the om/02-22-perf_estree_tokens_introduce_estreetokenconfig_trait branch from b9c94e6 to 72fb59c Compare February 28, 2026 16:06
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Feb 28, 2026
@graphite-app graphite-app bot changed the base branch from om/02-22-perf_estree_tokens_introduce_estreetokenconfig_trait to graphite-base/19850 February 28, 2026 16:13
@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 28, 2026

Merge activity

@graphite-app graphite-app bot changed the base branch from graphite-base/19850 to main February 28, 2026 16:19
@graphite-app graphite-app bot requested a review from camc314 as a code owner February 28, 2026 16:19
@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI labels Feb 28, 2026
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 28, 2026
@overlookmotel overlookmotel force-pushed the om/02-22-refactor_estree_tokens_break_up_into_multiple_files branch from 928f1e3 to a996b9e Compare February 28, 2026 16:46
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Feb 28, 2026
Pure refactor. Just break up implementation of tokens serialization into multiple files.
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