Skip to content

ui: Enable React compiler and fix compiler lint violations#6289

Open
yomete wants to merge 5 commits intomainfrom
react-compiler-lint-violation
Open

ui: Enable React compiler and fix compiler lint violations#6289
yomete wants to merge 5 commits intomainfrom
react-compiler-lint-violation

Conversation

@yomete
Copy link
Copy Markdown
Contributor

@yomete yomete commented Apr 1, 2026

This enables React Compiler for the Parca web app and updates the codebase to satisfy the new compiler-aware React rules.

Changes

  • switch Vite from @vitejs/plugin-react-swc to @vitejs/plugin-react
  • enable babel-plugin-react-compiler targeting React 18 with compilationMode: 'infer'
  • add babel-plugin-react-compiler and react-compiler-runtime
  • upgrade eslint-plugin-react-hooks from 4.6.2 to 7.0.1

Some components are intentionally opted out because they rely on DOM measurement or third-party APIs that are not good compiler candidates right now. Those components/hooks are marked with "use no memo", so React Compiler is enabled for the app but not every component is compiled.

I was worried about build time increasing because of the switch to the Babel plugin, but that does not appear to be the case on Vercel.

Follow ups for this would be:

  • reducing the current "use no memo" opt-out list where safe
  • remove the usage of useMemo, useCallback, memo hooks.
  • Add eslint rules to discourage writing new manual memoization usage

yomete added 2 commits March 31, 2026 22:33
Ensure URL state syncs correctly with the React Compiler enabled. Navbar now reads URL params via useLocation() instead of window.location.search, and Profiles opts out of memoization so URLStateProvider's sync-from-URL effect fires on navigation.
@yomete yomete requested a review from a team as a code owner April 1, 2026 11:41
@alwaysmeticulous
Copy link
Copy Markdown

alwaysmeticulous bot commented Apr 1, 2026

✅ Meticulous spotted 0 visual differences across 338 screens tested: view results.

Meticulous evaluated ~4 hours of user flows against your PR.

Expected differences? Click here. Last updated for commit 72add67 fix lint errors. This comment will update as new commits are pushed.

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