refactor(estree/tokens): break up into multiple files#19850
Merged
graphite-app[bot] merged 1 commit intomainfrom Feb 28, 2026
Merged
Conversation
This was referenced Feb 28, 2026
Member
Author
This was referenced Feb 28, 2026
Merging this PR will not alter performance
Comparing Footnotes
|
Contributor
There was a problem hiding this comment.
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.rsandu32_string.rs. - Extracted JSX token-state tracking into
jsx_state.rsand wired modules fromlib.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. |
This was referenced Feb 28, 2026
c2eaf64 to
928f1e3
Compare
b9c94e6 to
72fb59c
Compare
Contributor
Merge activity
|
928f1e3 to
a996b9e
Compare
Pure refactor. Just break up implementation of tokens serialization into multiple files.
a996b9e to
d7a1be8
Compare
This was referenced Feb 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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