Skip to content

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

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/03-01-refactor_estree_tokens_break_up_into_multiple_files
Mar 1, 2026
Merged

refactor(estree/tokens): break up into multiple files#19865
graphite-app[bot] merged 1 commit intomainfrom
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


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
@overlookmotel overlookmotel added the A-parser Area - Parser label 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 (43875e0) with om/02-28-feat_estree_tokens_add_function_to_update_tokens_in_place (32675fd)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 (017de5d) during the generation of this report, so 56af3e1 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@graphite-app
Copy link
Contributor

graphite-app bot commented Mar 1, 2026

Merge activity

@graphite-app graphite-app bot force-pushed the om/02-28-feat_estree_tokens_add_function_to_update_tokens_in_place branch from 32675fd to a3b01a2 Compare March 1, 2026 16:45
graphite-app bot pushed a commit that referenced this pull request 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.
@graphite-app graphite-app bot force-pushed the om/03-01-refactor_estree_tokens_break_up_into_multiple_files branch from 43875e0 to 53af931 Compare March 1, 2026 16:45
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.
@graphite-app graphite-app bot force-pushed the om/02-28-feat_estree_tokens_add_function_to_update_tokens_in_place branch from a3b01a2 to 25c2e25 Compare March 1, 2026 16:48
@graphite-app graphite-app bot force-pushed the om/03-01-refactor_estree_tokens_break_up_into_multiple_files branch from 53af931 to 442b0b9 Compare March 1, 2026 16:49
Base automatically changed from om/02-28-feat_estree_tokens_add_function_to_update_tokens_in_place to main March 1, 2026 16:55
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 1, 2026
@graphite-app graphite-app bot merged commit 442b0b9 into main Mar 1, 2026
22 checks passed
@graphite-app graphite-app bot deleted the om/03-01-refactor_estree_tokens_break_up_into_multiple_files branch March 1, 2026 16:56
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