refactor(estree/tokens): move JSON-related code into subdirectory#19869
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors oxc_estree_tokens to better scope JSON-only helpers by moving TokenType and U32String into the json/ submodule, reflecting that they are only used during JSON serialization.
Changes:
- Remove top-level module declarations for
token_typeandu32_string. - Add
json/token_type.rsandjson/u32_string.rsand wire them intojson/mod.rs. - Update
json/mod.rsimports to use the new submodule locations.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/oxc_estree_tokens/src/lib.rs | Stops declaring JSON-only helper modules at the crate root. |
| crates/oxc_estree_tokens/src/json/mod.rs | Declares and imports token_type / u32_string as JSON-internal submodules. |
| crates/oxc_estree_tokens/src/json/token_type.rs | Adds TokenType wrapper colocated with JSON serialization code. |
| crates/oxc_estree_tokens/src/json/u32_string.rs | Adds U32String wrapper colocated with JSON serialization code. |
Merging this PR will not alter performance
Comparing Footnotes
|
13e7557 to
3226c14
Compare
6d0e686 to
229a1e9
Compare
8c93213 to
700f55e
Compare
229a1e9 to
6ef7e2f
Compare
Merge activity
|
6ef7e2f to
4636d4f
Compare

Pure refactor.
After #19867,
TokenTypeis only used in JSON serialization. Create a subdirectory to contain JSON-related code and types, and movetoken_type.rsandu32_string.rsinto it, since they're not used in raw transfer conversion.