Repository navigation
feat(web): actually run the React Compiler - #14730
Conversation
vite.config.ts passed babel-plugin-react-compiler through the `babel` option of @vitejs/plugin-react-swc, which never runs Babel, so the compiler has been a no-op on web. Switch to @vitejs/plugin-react so the plugin runs in dev and production builds. Production build: 2,128 compiled memo caches (was 0), entry bundle +63 KB gzipped, build time about 35s -> 65s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Dependency limit exceeded — report not shown. This pull request scan exceeded the 10,000-dependency limit applied to this scan, so the results are incomplete and may be inaccurate. To avoid reporting false positives, Socket has not posted a report. Upgrade your plan to raise the dependency limit and get complete reports, or view the partial scan in the dashboard. Socket is always free for open source. If this is a non-commercial open source project, contact us to request a free Team account. |
Removes babel-plugin-react-compiler from the web Vite config while we investigate likes, reposts and comments not persisting on web after #14730 reached production. Keeps @vitejs/plugin-react so package.json and package-lock.json are unchanged, which keeps the mobile workflow (and its automatic OTA on main) from running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
packages/web/vite.config.tspassedbabel-plugin-react-compilerthrough thebabeloption of@vitejs/plugin-react-swc. That plugin never runs Babel, so the React Compiler has been a no-op on web. The production bundle on audius.co has no compiler output (0memo_cache_sentinelmarkers in the app bundle). Mobile compiles fine through Metro's Babel config.This switches web to
@vitejs/plugin-react5.1.1, the same version distro already uses with Vite 7, so the existing compiler config takes effect in dev and production builds.Impact
vite buildtime (local)Lockfile: SWC is removed and web gets its own Babel copies. The only shared change is a patch bump of
@babel/helper-string-parser(7.29.7 → 7.29.11).New build warning: a duplicate
classNamekey in harmony'sTextInput. The source already destructuresclassNametwice (classNameandclassName: inputClassName), and the compiler keeps that destructure as is, so behaviour is unchanged.Testing
tscclean; all 204 web tests pass (vitest now compiles through the plugin too)/trending(including the Underground tab),/explore, search, a profile, a track page, sign-in and sign-up forms, and playback from both the track page and a list. No React errors or render loops./trendingrenders cleanly— 💍 Frodo
🤖 Generated with Claude Code