Skip to content

chore: upgrade Vite to v8 and enable React Compiler#5639

Merged
therealemjy merged 1 commit into
mainfrom
chore/react-compiler
Jun 22, 2026
Merged

chore: upgrade Vite to v8 and enable React Compiler#5639
therealemjy merged 1 commit into
mainfrom
chore/react-compiler

Conversation

@therealemjy

Copy link
Copy Markdown
Member

Jira ticket(s)

VPD-1406

Changes

  • upgrade Vite to v8 and enable React Compiler

@changeset-bot

changeset-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a827267

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

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dapp-preview Ready Ready Preview Jun 18, 2026 10:54am
dapp-testnet Ready Ready Preview Jun 18, 2026 10:54am
venus.io Ready Ready Preview Jun 18, 2026 10:54am

Request Review

@greptile-apps

greptile-apps Bot commented Jun 18, 2026

Copy link
Copy Markdown

Greptile Summary

This PR upgrades Vite from v6 to v8 (which uses Rolldown as its bundler), enables the React Compiler, and performs the prerequisite refactor of all Zustand stores to make them React Compiler–compatible.

  • Vite v8 / Rolldown migration: replaces @rollup/plugin-inject (Buffer injection) and @vitejs/plugin-react v4 with their Rolldown-native equivalents (@rolldown/plugin-babel, @vitejs/plugin-react v6); adds jsxImportSource: '@emotion/react' so the React Compiler understands Emotion's JSX transform.
  • React Compiler: enabled via babel-plugin-react-compiler + reactCompilerPreset scoped to apps/evm/src/**, with compilationMode: 'infer' and panicThreshold: 'none' for a safe first adoption; disabled in test mode to avoid vitest interference.
  • Store hook refactor: all Zustand stores rename their export from store to useStore and switch call sites from store.use.xxx() (which the React Compiler cannot recognise as a hook) to useStore(state => state.xxx) (the standard, compiler-visible selector pattern); tests updated accordingly.

Confidence Score: 4/5

Safe to merge; the Vite upgrade, React Compiler setup, and store refactor are all consistent and well-contained.

The createStoreSelectors utility still runs in every store file and adds a .use property that nothing in the codebase reads anymore — a straightforward cleanup left behind by the selector migration. The Buffer polyfill is now assigned in index.tsx's module body rather than injected per-file at build time, which means any dependency that reads globalThis.Buffer at module-evaluation time (before index.tsx runs) would see undefined; in practice wallet SDK code accesses Buffer inside function calls made well after startup, so this is unlikely to bite, but it's a behavioural difference from the old inject approach worth tracking.

apps/evm/src/index.tsx (Buffer polyfill timing) and apps/evm/src/store/index.ts (unused createStoreSelectors .use accessor)

Important Files Changed

Filename Overview
apps/evm/vite.config.mts Vite v8 / Rolldown migration: replaces @rollup/plugin-inject with @rolldown/plugin-babel, enables React Compiler via reactCompilerPreset scoped to apps/evm/src, adds jsxImportSource for Emotion compatibility, disables React Compiler in test mode.
apps/evm/package.json Upgrades vite from ^6.2.5 to ^8.0.16 and @vitejs/plugin-react from ^4.3.3 to ^6.0.2; adds @rolldown/plugin-babel, babel-plugin-react-compiler, and @babel/core; removes @rollup/plugin-inject.
apps/evm/src/index.tsx Replaces the rollup-level Buffer injection with an explicit globalThis.Buffer polyfill in the entry module body; the assignment runs after all static imports are initialized, so module-level Buffer access in transitively imported dependencies would still be undefined.
apps/evm/src/store/index.ts Renames internal useStore to store and exports createStoreSelectors result as useStore, making the hook-naming convention consistent; all consumers updated accordingly.
apps/evm/src/hooks/useSendTransaction/tests/index.gaslessTransactions.spec.tsx Updates mock to use function-based useStore selector pattern instead of store.use.openModal; test logic unchanged.
apps/evm/src/libs/notifications/utilities/tests/index.spec.ts Updates vi.mock to expose useStore.getState instead of store.getState; utility functions only use .getState() (not the hook form), so the plain-object mock is appropriate.

Reviews (1): Last reviewed commit: "chore: upgrade Vite to v8 and enable Rea..." | Re-trigger Greptile

Comment thread apps/evm/src/index.tsx
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for ./apps/evm

Status Category Percentage Covered / Total
🔵 Lines 81.49% 47549 / 58347
🔵 Statements 81.49% 47549 / 58347
🔵 Functions 62.29% 656 / 1053
🔵 Branches 73% 5430 / 7438
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/evm/src/index.tsx 0% 100% 100% 0% 2-17
apps/evm/src/components/Icon/icons/index.ts 99% 0% 100% 99% 1
apps/evm/src/containers/Layout/index.tsx 0% 0% 0% 0% 1-92
apps/evm/src/containers/Layout/store.ts 0% 0% 0% 0% 1-19
apps/evm/src/containers/Layout/NavBar/Settings/GaslessTransactionSetting/index.tsx 0% 0% 0% 0% 1-46
apps/evm/src/containers/Layout/ScrollToTop/index.tsx 0% 0% 0% 0% 1-28
apps/evm/src/containers/ResendPayingGasModal/index.tsx 0% 0% 0% 0% 1-12
apps/evm/src/containers/ResendPayingGasModal/Modal/index.tsx 0% 0% 0% 0% 1-67
apps/evm/src/containers/ResendPayingGasModal/store/index.ts 75% 50% 0% 75% 1, 10
apps/evm/src/hooks/useSendTransaction/index.ts 90.56% 80.76% 50% 90.56% 5, 126-129, 161, 169, 195-197
apps/evm/src/hooks/useUserChainSettings/index.tsx 93.33% 60% 100% 93.33% 1, 25
apps/evm/src/libs/notifications/NotificationCenter/index.tsx 98.38% 62.5% 100% 98.38% 31
apps/evm/src/libs/notifications/store/index.ts 96.96% 92.85% 100% 96.96% 1
apps/evm/src/libs/notifications/utilities/index.ts 97.43% 83.33% 100% 97.43% 1
apps/evm/src/pages/Dashboard/Guide/index.tsx 79% 62.5% 0% 79% 47-48, 53-58, 90-104
apps/evm/src/pages/Dashboard/Overview/index.tsx 97.27% 75% 66.66% 97.27% 196, 227, 231, 262, 271-274
apps/evm/src/pages/Trade/index.tsx 94.11% 89.28% 100% 94.11% 61-69
apps/evm/src/pages/Trade/Banner/index.tsx 0% 0% 0% 0% 1-46
apps/evm/src/pages/Trade/Banner/store/index.ts 95.45% 80% 100% 95.45% 1
apps/evm/src/pages/Trade/ClosePositionModal/index.tsx 100% 75% 100% 100%
apps/evm/src/pages/Trade/ClosePositionModal/Form/index.tsx 0% 0% 0% 0% 1-22
apps/evm/src/pages/Trade/ClosePositionModal/store/index.ts 93.75% 83.33% 100% 93.75% 1
apps/evm/src/pages/Trade/PairInfo/index.tsx 95.85% 75% 100% 95.85% 145-146, 155-158, 191, 198
apps/evm/src/pages/Trade/Positions/PositionList/index.tsx 100% 93.33% 100% 100%
apps/evm/src/pages/Trade/ReduceForm/index.tsx 98.29% 96.34% 100% 98.29% 77, 322-325
apps/evm/src/store/index.ts 98.36% 90% 100% 98.36% 1
Generated in workflow #13670 for commit a827267 by the Vitest Coverage Report Action

@cuzz-venus cuzz-venus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks good to me.

@therealemjy therealemjy merged commit 197ae33 into main Jun 22, 2026
5 checks passed
@therealemjy therealemjy deleted the chore/react-compiler branch June 22, 2026 13:45
therealemjy added a commit that referenced this pull request Jun 23, 2026
Revert "chore: upgrade Vite to v8 and enable React Compiler (#5639)"

This reverts commit 197ae33.
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.

2 participants