Skip to content

refactor(ast_tools): remove special-case logic for NodeId from ESTree generator#21678

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_estree_generator
Apr 23, 2026
Merged

refactor(ast_tools): remove special-case logic for NodeId from ESTree generator#21678
graphite-app[bot] merged 1 commit intomainfrom
om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_estree_generator

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Apr 23, 2026

Simplify ESTree generator in ast_tools.

Previously it had "special case" code for NodeId. Instead, add a #[estree(skip)] attr to NodeId type, and then node_id: Cell<NodeId> fields can be treated the same as any other field.

Does not alter generated code, only the means by which it's generated.

Copy link
Copy Markdown
Member Author

overlookmotel commented Apr 23, 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 changes, fast-track this PR to the front of the merge queue

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
Copy Markdown

codspeed-hq Bot commented Apr 23, 2026

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_estree_generator (1a9e967) with om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_contenteq_generator (aad7d98)

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 self-assigned this Apr 23, 2026
@overlookmotel overlookmotel marked this pull request as ready for review April 23, 2026 13:00
Copilot AI review requested due to automatic review settings April 23, 2026 13:00
Copy link
Copy Markdown
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

This PR simplifies the ESTree generator logic in tasks/ast_tools by removing a hard-coded “skip node_id by name” special case and instead relying on schema-driven #[estree(skip)] metadata attached to the NodeId type.

Changes:

  • Removed the field.name() == "node_id" special-case from should_skip_field.
  • Marked oxc_syntax::node::NodeId with #[estree(skip)] so any fields containing NodeId are skipped via the existing type-based skip path.

Reviewed changes

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

File Description
tasks/ast_tools/src/derives/estree.rs Removes the node_id name-based skip and relies on existing “innermost type has #[estree(skip)]” logic.
crates/oxc_syntax/src/node.rs Adds #[estree(skip)] to NodeId so Cell<NodeId> (and other wrappers) are skipped consistently by generators using should_skip_field.

@overlookmotel overlookmotel added C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior A-ast-tools Area - AST tools labels Apr 23, 2026
@overlookmotel overlookmotel force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_contenteq_generator branch from a30b94f to 786fcd5 Compare April 23, 2026 13:56
@overlookmotel overlookmotel force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_estree_generator branch from 89eeb44 to 6c09f85 Compare April 23, 2026 13:56
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app Bot commented Apr 23, 2026

Merge activity

@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_contenteq_generator branch from 786fcd5 to ed660cf Compare April 23, 2026 15:37
graphite-app Bot pushed a commit that referenced this pull request Apr 23, 2026
…ree` generator (#21678)

Simplify `ESTree` generator in `ast_tools`.

Previously it had "special case" code for `NodeId`. Instead, add a `#[estree(skip)]` attr to `NodeId` type, and then `node_id: Cell<NodeId>` fields can be treated the same as any other field.

Does not alter generated code, only the means by which it's generated.
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_estree_generator branch from 6c09f85 to 459e860 Compare April 23, 2026 15:37
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_contenteq_generator branch from ed660cf to f30e3c2 Compare April 23, 2026 15:47
graphite-app Bot pushed a commit that referenced this pull request Apr 23, 2026
…ree` generator (#21678)

Simplify `ESTree` generator in `ast_tools`.

Previously it had "special case" code for `NodeId`. Instead, add a `#[estree(skip)]` attr to `NodeId` type, and then `node_id: Cell<NodeId>` fields can be treated the same as any other field.

Does not alter generated code, only the means by which it's generated.
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_estree_generator branch from 459e860 to 545209c Compare April 23, 2026 15:48
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_contenteq_generator branch from f30e3c2 to ea3bfd8 Compare April 23, 2026 17:21
graphite-app Bot pushed a commit that referenced this pull request Apr 23, 2026
…ree` generator (#21678)

Simplify `ESTree` generator in `ast_tools`.

Previously it had "special case" code for `NodeId`. Instead, add a `#[estree(skip)]` attr to `NodeId` type, and then `node_id: Cell<NodeId>` fields can be treated the same as any other field.

Does not alter generated code, only the means by which it's generated.
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_estree_generator branch from 545209c to 6adf026 Compare April 23, 2026 17:22
…ree` generator (#21678)

Simplify `ESTree` generator in `ast_tools`.

Previously it had "special case" code for `NodeId`. Instead, add a `#[estree(skip)]` attr to `NodeId` type, and then `node_id: Cell<NodeId>` fields can be treated the same as any other field.

Does not alter generated code, only the means by which it's generated.
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_contenteq_generator branch from ea3bfd8 to aad7d98 Compare April 23, 2026 17:29
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_estree_generator branch from 6adf026 to 1a9e967 Compare April 23, 2026 17:30
Base automatically changed from om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_contenteq_generator to main April 23, 2026 18:43
@graphite-app graphite-app Bot merged commit 1a9e967 into main Apr 23, 2026
37 checks passed
@graphite-app graphite-app Bot deleted the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_estree_generator branch April 23, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast-tools Area - AST tools 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