From 30cd59495d5faf98f351f349f1e0dc4e279e624f Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Wed, 16 Sep 2026 19:02:03 +0200 Subject: [PATCH] perf(bundler-plugins): Use fast component annotation for all Rollup and Vite versions (#24437) Until now, only Vite 8 used the fast (non-Babel) React component annotation transform. Rollup and Vite 5-7 always went through Babel. This PR moves every Rollup and Vite version to the fast path, as a first step toward removing Babel. Rollup's own `parseAstAsync`, which Vite 5-7 re-export, can't parse TypeScript, and the Vite plugin runs with `enforce: 'pre'`, so it sees raw `.tsx`. So this adds `oxc-parser` as a dependency for those versions. Vite 8 keeps using its own parser. `oxc-parser` needs `preserveParens: false` to give the same AST as Vite 8. It also returns syntax errors instead of throwing them, so the adapter throws on errors, and those files still fall back to Babel. Babel also stays as the fallback on platforms without an `oxc-parser` native binding. The walker's parity tests with Babel previously ran only on the Babel parser's AST. They now also run on `oxc-parser` output, which matches what Vite 8 produces. Ref #24415