-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
5 / 55 of 5 issues completedClosed
5 / 55 of 5 issues completed
Copy link
Labels
componentsChanges to React componentsChanges to React componentsenhancementNew feature or requestNew feature or requestfrontendgood first issueGood for newcomersGood for newcomersperformancePerformance improvements and monitoringPerformance improvements and monitoring
Milestone
Description
Overview
This is the main tracking issue for implementing the bundle optimization strategies outlined in #355. Our goal is to reduce the react-vendor bundle from 1.3MB to under 500KB through systematic optimizations.
Current State
- React vendor bundle: 1.3MB
- Major contributors:
- 30 Radix UI components
- Dual charting libraries (Recharts + Nivo)
- Dual icon libraries (react-icons + lucide-react)
- React 18.3.1 core
Target State
- Target bundle size: <500KB initial load
- Maintain: All current functionality
- Improve: Lighthouse performance scores
Implementation Phases
Phase 1: Analysis & Quick Wins (Week 1)
Must be completed first:
- π Bundle Analysis: Identify exact component sizes and dependenciesΒ #357 - Bundle analysis and dependency audit
Can be done in parallel after analysis:
- π¨ Icon Consolidation: Replace dual icon libraries with SVG sprites (370KB savings)Β #358 - Icon consolidation to SVG sprites
- Remove unused dependencies
Phase 2: Major Library Optimizations (Weeks 2-3)
Can be done independently:
- π Chart Library Migration: Replace Recharts + Nivo with uPlot (550KB savings)Β #359 - Replace dual charting libraries with uPlot
- β‘ Safe Vite Build Optimizations: 50-100KB savings without risking stabilityΒ #361 - Implement Vite build optimizations
Phase 3: Code Splitting (Weeks 3-4)
Can be done independently:
- π Route-Based Code Splitting: Reduce initial load by 400-650KBΒ #360 - Implement route-based code splitting
- Component-level lazy loading (included in π Route-Based Code Splitting: Reduce initial load by 400-650KBΒ #360)
Phase 4: Component Optimization (Week 5+)
Depends on Phase 1 analysis:
- π Radix UI Optimization: Tree-shake and replace simple components (100-150KB savings)Β #362 - Radix UI tree-shaking and optimization
- Replace simple Radix components with Floating UI (included in π Radix UI Optimization: Tree-shake and replace simple components (100-150KB savings)Β #362)
Expected Outcomes
Strategy | Bundle Savings | Priority | Issue |
---|---|---|---|
Chart library consolidation | 550KB | IMMEDIATE | #359 |
Icon consolidation | 370KB | IMMEDIATE | #358 |
Route code splitting | 400-650KB* | HIGH | #360 |
Vite build config | 150-200KB | HIGH | #361 |
Radix optimization | 100-150KB | MEDIUM | #362 |
*Initial load reduction
Implementation Order
Can be done in parallel (after #357):
- π¨ Icon Consolidation: Replace dual icon libraries with SVG sprites (370KB savings)Β #358 - Icon consolidation
- π Chart Library Migration: Replace Recharts + Nivo with uPlot (550KB savings)Β #359 - Chart library migration
- π Route-Based Code Splitting: Reduce initial load by 400-650KBΒ #360 - Route-based code splitting
- β‘ Safe Vite Build Optimizations: 50-100KB savings without risking stabilityΒ #361 - Vite build optimization
Must wait for #357 completion:
- π Radix UI Optimization: Tree-shake and replace simple components (100-150KB savings)Β #362 - Radix UI optimization (needs bundle analysis data)
Success Criteria
- React vendor bundle reduced to <500KB
- No runtime errors from missing dependencies
- All existing functionality maintained
- Lighthouse performance score improved by 10+ points
References
- Original research issue: Research: Reduce React vendor bundle size (1.3MB) - explore smaller alternatives and Preact compatibilityΒ #355
- Performance docs: /docs/performance/BUNDLE_OPTIMIZATION_2025.md
- Performance checklist: /docs/performance/PERFORMANCE_CHECKLIST.md
Notes
- Preact migration considered but deferred due to Radix UI compatibility issues
- Custom component implementation has low ROI for this project
- Focus on proven, low-risk optimizations first
- Issues π¨ Icon Consolidation: Replace dual icon libraries with SVG sprites (370KB savings)Β #358, π Chart Library Migration: Replace Recharts + Nivo with uPlot (550KB savings)Β #359, π Route-Based Code Splitting: Reduce initial load by 400-650KBΒ #360, and β‘ Safe Vite Build Optimizations: 50-100KB savings without risking stabilityΒ #361 can be worked on independently and in parallel
- Issue π Radix UI Optimization: Tree-shake and replace simple components (100-150KB savings)Β #362 is blocked until π Bundle Analysis: Identify exact component sizes and dependenciesΒ #357 provides bundle analysis data
Sub-issues
Metadata
Metadata
Assignees
Labels
componentsChanges to React componentsChanges to React componentsenhancementNew feature or requestNew feature or requestfrontendgood first issueGood for newcomersGood for newcomersperformancePerformance improvements and monitoringPerformance improvements and monitoring