A production-ready, performance-focused demo application showcasing React Compiler's automatic memoization capabilities. This app demonstrates senior-level frontend engineering with advanced React 19 features, TypeScript rigor, performance profiling, and real-world optimizations.
- Demonstrate React Compiler Benefits: Showcase automatic memoization, reduced re-renders, and performance improvements
- Senior-Level Engineering: Advanced React patterns, strict TypeScript, accessibility, and best practices
- GitHub-Ready: Professional UI, comprehensive documentation, and deployment-ready setup
- 2026 Best Practices: Modern React Compiler integration and optimization techniques
- React Compiler Integration: Automatic memoization of components and functions
- Virtualized Lists: TanStack Virtual for efficient rendering of 10k+ items
- Performance Metrics: Real-time render counts, FPS, and render time tracking
- Benchmarking Tools: Compare performance with compiler enabled vs disabled
- Home: Overview and feature showcase
- List Demo: Large virtualized list with search and filtering (10k items)
- Chart Demo: Dynamic charts with real-time updates
- Benchmark: Performance metrics and heavy component demos
- Modern Design: Clean, professional interface with shadcn/ui components
- Dark/Light Mode: System preference detection with manual toggle
- Responsive: Mobile-first design that works on all screen sizes
- Accessibility: ARIA labels, semantic HTML, keyboard navigation
- React 19+ - Latest React with experimental Compiler support
- React Compiler - Automatic memoization via
babel-plugin-react-compiler - TypeScript - Strict mode, no
anytypes, full type safety - Vite - Fast development and optimized builds
- Tailwind CSS v4 - Utility-first styling
- shadcn/ui - Beautiful, accessible component library
- TanStack Query - Powerful data fetching and caching
- TanStack Virtual - Efficient virtual scrolling
- Recharts - Responsive chart visualizations
- React Router - Client-side routing
- Vitest - Fast unit testing
Screenshots will be added after deployment
- Home page with feature overview
- List demo with 10k virtualized items
- Chart demo with real-time updates
- Benchmark page with performance metrics
- Node.js 18+ and npm/yarn/pnpm
- Git
-
Clone the repository
git clone https://github.com/yourusername/react-compiler-optimized-app.git cd react-compiler-optimized-app -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
Edit
.envto enable React Compiler:VITE_ENABLE_COMPILER=true
-
Start development server
npm run dev
The app will open at
http://localhost:3000
npm run build
npm run previewReact Compiler is configured via environment variable and Babel plugin:
-
Enable in
.env:VITE_ENABLE_COMPILER=true
-
Configuration (already set up in
vite.config.ts):- Babel plugin:
babel-plugin-react-compiler - Runtime module:
react-compiler-runtime - Conditional loading based on env var
- Babel plugin:
-
Verify Compiler Status:
- Check the badge in the header (shows "Compiler: ON/OFF")
- Compare render counts in benchmark page
- β Automatic memoization of expensive computations
- β Reduced re-renders (visible in component render counts)
- β Improved FPS in benchmark tests
- β Lower average render times
- Manual optimization required (useMemo, useCallback)
- More re-renders for unchanged props
- Higher render times for heavy components
Run tests with Vitest:
# Run tests
npm test
# Run tests with UI
npm run test:uireact-compiler-optimized-app/
βββ src/
β βββ app/ # App entry point
β βββ components/
β β βββ ui/ # shadcn/ui components
β β βββ demo/ # Demo components
β β βββ layout/ # Layout components
β βββ hooks/ # Custom hooks
β βββ lib/ # Utilities, types, API
β βββ pages/ # Route pages
β βββ test/ # Test setup
βββ public/ # Static assets
βββ .env.example # Environment variables template
βββ vite.config.ts # Vite configuration
βββ tsconfig.json # TypeScript configuration
βββ tailwind.config.js # Tailwind configuration
-
Push to GitHub
git push origin main
-
Import to Vercel
- Go to vercel.com
- Import your GitHub repository
- Add environment variable:
VITE_ENABLE_COMPILER=true - Deploy!
-
Environment Variables in Vercel
VITE_ENABLE_COMPILER: Set totrueto enable React CompilerVITE_API_BASE_URL: API base URL (optional)
The app can be deployed to any static hosting service:
- Netlify
- GitHub Pages
- Cloudflare Pages
- AWS Amplify
- Automatic Memoization: No need for manual
useMemo/useCallbackin most cases - Reduced Re-renders: Components only re-render when props actually change
- Better Performance: Especially noticeable with heavy computations and large lists
- Cleaner Code: Less boilerplate, more readable components
- Strict TypeScript configuration
- Component composition and reusability
- Performance profiling and monitoring
- Accessibility (ARIA, semantic HTML)
- Responsive design patterns
- Error boundaries and loading states
- React Team for React Compiler
- shadcn for beautiful UI components
- TanStack for excellent React libraries
- Vite for the amazing build tool
- telegram: https://t.me/qahtan_n
- twitter: https://x.com/qahtann_