Skip to content

feat(web): actually run the React Compiler - #14730

Merged
dylanjeffers merged 1 commit into
mainfrom
feat/web-react-compiler
Nov 3, 2026
Merged

dylanjeffers merged 1 commit into
mainfrom
feat/web-react-compiler

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Summary

packages/web/vite.config.ts passed babel-plugin-react-compiler through the babel option 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 (0 memo_cache_sentinel markers in the app bundle). Mobile compiles fine through Metro's Babel config.

This switches web to @vitejs/plugin-react 5.1.1, the same version distro already uses with Vite 7, so the existing compiler config takes effect in dev and production builds.

Impact

Before After
Compiled memo caches in prod build 0 2,128
Entry bundle (gzip) 632 KB 696 KB
vite build time (local) ~35s ~65s

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 className key in harmony's TextInput. The source already destructures className twice (className and className: inputClassName), and the compiler keeps that destructure as is, so behaviour is unchanged.

Testing

  • tsc clean; all 204 web tests pass (vitest now compiles through the plugin too)
  • Production build served locally: /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.
  • Dev server: modules are served compiled and /trending renders cleanly
  • Not covered: signed-in pages (Feed, Library, Messages, Wallet, Upload, settings), checkout, and SSR. The compiler silently skips functions it can't compile (about 1 in 5 on mobile), so please click through those before approving the Production deploy.

— 💍 Frodo

🤖 Generated with Claude Code

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>
@changeset-bot

changeset-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d684926

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security

Copy link
Copy Markdown

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.

@dylanjeffers
dylanjeffers merged commit de38f3d into main Nov 3, 2026
33 checks passed
@dylanjeffers
dylanjeffers deleted the feat/web-react-compiler branch November 3, 2026 19:21
dylanjeffers added a commit that referenced this pull request Nov 5, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant