Skip to content

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

Open
overlookmotel wants to merge 1 commit intoom/02-28-feat_estree_tokens_add_function_to_update_tokens_in_placefrom
om/03-01-refactor_estree_tokens_break_up_into_multiple_files
Open

refactor(estree/tokens): break up into multiple files#19865
overlookmotel wants to merge 1 commit intoom/02-28-feat_estree_tokens_add_function_to_update_tokens_in_placefrom
om/03-01-refactor_estree_tokens_break_up_into_multiple_files

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 1, 2026

Pure refactor. serialize.rs had got too big. Split it up into different files. Does not alter any of the code, just moves it into separate files.

@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Mar 1, 2026
Copy link
Member Author

overlookmotel commented Mar 1, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


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.

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 the oxc_estree_tokens crate by splitting the former monolithic serialize.rs into smaller, purpose-focused modules (JSON serialization, in-place raw transfer update, shared visitor/context utilities) while keeping the token-walking and emission logic equivalent.

Changes:

  • Split token serialization / update logic into json.rs, raw_transfer.rs, context.rs, and visitor.rs.
  • Reworked lib.rs to expose the same public entry points via re-exports.
  • Added/updated module-level documentation headers across the new/updated files.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/oxc_estree_tokens/src/visitor.rs New AST visitor module extracted from former serialize.rs.
crates/oxc_estree_tokens/src/context.rs New shared Context trait module used by both JSON and raw-transfer modes.
crates/oxc_estree_tokens/src/json.rs New JSON serialization implementation extracted from former serialize.rs.
crates/oxc_estree_tokens/src/raw_transfer.rs New in-place token kind update implementation extracted from former serialize.rs.
crates/oxc_estree_tokens/src/lib.rs Updates module structure and re-exports public API entry points.
crates/oxc_estree_tokens/src/options.rs Adjusts imports and adds module docs.
crates/oxc_estree_tokens/src/jsx_state.rs Adds module docs.
crates/oxc_estree_tokens/src/token_type.rs Adds module docs.
crates/oxc_estree_tokens/src/u32_string.rs Adds module docs.
crates/oxc_estree_tokens/src/serialize.rs Removed (functionality redistributed into new modules).

@overlookmotel overlookmotel self-assigned this Mar 1, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 1, 2026

Merging this PR will not alter performance

✅ 53 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/03-01-refactor_estree_tokens_break_up_into_multiple_files (8581850) with om/02-28-feat_estree_tokens_add_function_to_update_tokens_in_place (30d1d04)2

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.

  2. No successful run was found on om/02-28-feat_estree_tokens_add_function_to_update_tokens_in_place (4854bfd) during the generation of this report, so f4ea318 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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