Skip to content

refactor(react_compiler): switch ContextIdentifierVisitor to VisitJs#24513

Merged
graphite-app[bot] merged 1 commit into
mainfrom
react-compiler-visit-js
Jul 14, 2026
Merged

refactor(react_compiler): switch ContextIdentifierVisitor to VisitJs#24513
graphite-app[bot] merged 1 commit into
mainfrom
react-compiler-visit-js

Conversation

@Boshen

@Boshen Boshen commented Jul 14, 2026

Copy link
Copy Markdown
Member

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 Visitimpl 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).

Boshen commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

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

codspeed-hq Bot commented Jul 14, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 10 untouched benchmarks
⏩ 61 skipped benchmarks1


Comparing react-compiler-visit-js (f41062e) with main (ca4a4a7)2

Open in CodSpeed

Footnotes

  1. 61 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 visit-js (66f745c) during the generation of this report, so main (ca4a4a7) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Boshen
Boshen force-pushed the react-compiler-visit-js branch from 2ad4d45 to 8caccc1 Compare July 14, 2026 15:02
@Boshen
Boshen force-pushed the react-compiler-visit-js branch 3 times, most recently from 77a3414 to f41062e Compare July 14, 2026 15:28
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jul 14, 2026

Boshen commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

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).
@graphite-app
graphite-app Bot requested a review from overlookmotel as a code owner July 14, 2026 16:01
@graphite-app
graphite-app Bot force-pushed the react-compiler-visit-js branch from f41062e to 639665b Compare July 14, 2026 16:01
Base automatically changed from visit-js to main July 14, 2026 16:06
@graphite-app
graphite-app Bot merged commit 639665b into main Jul 14, 2026
31 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jul 14, 2026
@graphite-app
graphite-app Bot deleted the react-compiler-visit-js branch July 14, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant