refactor(react_compiler): switch ContextIdentifierVisitor to VisitJs#24513
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via 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. |
26fc3ab to
2ad4d45
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
2ad4d45 to
8caccc1
Compare
77a3414 to
f41062e
Compare
Merge activity
|
…24513) ## What First consumer of the `VisitJs` trait from #24499: switches `ContextIdentifierVisitor` (`react_compiler_lowering/find_context_identifiers.rs`) from `impl Visit` to `impl VisitJs`. ## Changes - `impl Visit` → `impl VisitJs`; direct `walk::walk_*` calls → `walk_js::walk_*`. - Deletes the six hand-written `visit_ts_*` skip-stubs (`visit_ts_type`, `visit_ts_type_annotation`, `visit_ts_type_parameter_instantiation`/`_declaration`, `visit_ts_type_alias_declaration`, `visit_ts_interface_declaration`) — `VisitJs` prunes type-space natively, and these methods no longer exist on the trait. - Keeps the empty `visit_ts_enum_declaration` / `visit_ts_module_declaration` overrides: enum initializers and namespace bodies are runtime JS which `VisitJs` *does* walk, while the original Babel walker treated them as opaque RawNodes — the stubs preserve exact parity. - Drops two `visit_ts_this_parameter(...)` calls that were always no-ops (their walk only descended into the type annotation, which the deleted stub discarded). Behavior is unchanged; the visitor just no longer monomorphizes any TS type-grammar walks. Existing `oxc_react_compiler` tests cover the pruned/kept boundary directly (`typescript_only_constructs_round_trip`, `type_query_casts_are_renamed_with_value_bindings`, `ts_wrapped_assignment_targets_do_not_panic`). --- 🤖 This PR was written with the assistance of Claude Code (Claude Fable 5).
66f745c to
d05224d
Compare
f41062e to
639665b
Compare

What
First consumer of the
VisitJstrait from #24499: switchesContextIdentifierVisitor(react_compiler_lowering/find_context_identifiers.rs) fromimpl Visittoimpl VisitJs.Changes
impl Visit→impl VisitJs; directwalk::walk_*calls →walk_js::walk_*.visit_ts_*skip-stubs (visit_ts_type,visit_ts_type_annotation,visit_ts_type_parameter_instantiation/_declaration,visit_ts_type_alias_declaration,visit_ts_interface_declaration) —VisitJsprunes type-space natively, and these methods no longer exist on the trait.visit_ts_enum_declaration/visit_ts_module_declarationoverrides: enum initializers and namespace bodies are runtime JS whichVisitJsdoes walk, while the original Babel walker treated them as opaque RawNodes — the stubs preserve exact parity.visit_ts_this_parameter(...)calls that were always no-ops (their walk only descended into the type annotation, which the deleted stub discarded).Behavior is unchanged; the visitor just no longer monomorphizes any TS type-grammar walks. Existing
oxc_react_compilertests cover the pruned/kept boundary directly (typescript_only_constructs_round_trip,type_query_casts_are_renamed_with_value_bindings,ts_wrapped_assignment_targets_do_not_panic).🤖 This PR was written with the assistance of Claude Code (Claude Fable 5).