ADR-006: React 18 with Material-UI v7
Status
Implemented
Date
2025-01-16 (Retrospective)
Decision Makers
- Frontend Team - Framework selection
- UX Team - Design system requirements
Layer
Frontend
Related ADRs
- ADR-007: React Query for Server State
- ADR-034: Vite Build System
- ADR-035: DataGrid Pro for Tables
- ADR-015: Plugin System Architecture
Supersedes
None
Depends On
None
Context
The SRE Operations Platform requires a modern frontend stack:
- Component Library: Rich UI components for data-heavy interfaces
- Design System: Consistent look and feel across 17 entity types
- Accessibility: WCAG 2.1 AA compliance
- TypeScript: Full type safety
- Performance: Fast load times, responsive interactions
Key constraints:
- Must handle complex data tables (10k+ rows)
- Need customizable theming (dark mode support)
- Require enterprise-grade components
- Must work with existing MUI DataGrid Pro license
- Need active community and long-term support
Decision
We adopt React 18 with Material-UI v7 as the frontend foundation:
Key Design Decisions
- React 18: Latest stable with concurrent features
- Material-UI v7: Latest MUI with improved performance
- TypeScript Strict: Full type safety enabled
- Functional Components: Hooks-based architecture exclusively
- CSS-in-JS: Emotion-based styling via MUI
Technology Stack
{
"react": "^18.2.0",
"@mui/material": "^7.3.1",
"@mui/icons-material": "^7.3.2",
"@mui/x-data-grid-premium": "^8.12.1",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0"
}
Theme Configuration
const theme = createTheme({
palette: {
primary: { main: '#1976d2' }, // Blue
secondary: { main: '#ff9800' }, // Orange
mode: 'light', // or 'dark'
},
typography: {
fontFamily: 'Roboto, sans-serif',
},
spacing: 8, // 8px base unit
});
Component Architecture
src/components/
├── common/ # Buttons, dialogs, inputs
├── entities/ # EntityListPage, EntityDetailPage
├── layout/ # AppBar, Sidebar, Navigation
└── features/ # Domain-specific components
Consequences
Positive
- Comprehensive Library: 50+ production-ready components
- Design Consistency: Material Design language throughout
- Accessibility Built-in: ARIA support in all components
- TypeScript First: Full type definitions included
- Theme System: Easy light/dark mode, custom branding
- Active Ecosystem: Large community, frequent updates
Negative
- Bundle Size: MUI adds ~200KB (mitigated with tree-shaking)
- Styling Learning Curve: sx prop and styled() patterns
- Version Upgrades: Breaking changes between major versions
- Performance Gotchas: Must use memo/callback correctly
Neutral
- CSS-in-JS Trade-offs: Runtime vs compile-time styling debate
- Design Opinion: Material Design may conflict with brand requirements
Alternatives Considered
1. Chakra UI
- Approach: Simpler, more flexible component library
- Rejected: Less comprehensive data components, smaller ecosystem
2. Ant Design
- Approach: Enterprise-focused Chinese design system
- Rejected: Different design language, localization concerns
3. Tailwind + Headless UI
- Approach: Utility CSS with unstyled components
- Rejected: More custom code, higher implementation effort
4. Next.js + Server Components
- Approach: Full-stack React framework
- Rejected: Separate backend already exists, not needed for SPA
Implementation Status
- Core implementation complete
- Tests written and passing
- Documentation updated
- Migration/upgrade path defined
- Monitoring/observability in place
Implementation Details
- Theme:
frontend/src/theme/ - Component Library:
frontend/src/components/ - Layout:
frontend/src/components/layout/ - Page Components:
frontend/src/pages/ - Entity Config:
frontend/src/config/entityConfigs.ts
Compliance/Validation
- Automated checks: TypeScript compilation, ESLint
- Manual review: Design review for new components
- Metrics: Lighthouse scores, bundle size tracking
LLM Council Review
Review Date: 2025-01-16 Confidence Level: High (100%) Verdict: CONDITIONAL APPROVAL
Quality Metrics
- Consensus Strength Score (CSS): 0.90
- Deliberation Depth Index (DDI): 0.85
Council Feedback Summary
The council approved React 18 and the DataGrid Premium choice but identified concerns about MUI versioning and CSS-in-JS performance in data-dense views.
Key Concerns Identified:
- MUI v7 Version Discrepancy: As of late 2024, MUI v6 is latest stable; "v7" doesn't exist in stable form
- CSS-in-JS Runtime Overhead:
sxprop in DataGrid cell renderers causes significant CPU overhead - Missing State Management: No caching layer defined for server state
- Bundle Size: 200KB is acceptable for B2B tool but needs tree-shaking
Required Modifications:
- Clarify MUI Version: Target MUI v6 (with Pigment CSS considerations) rather than speculative v7
- Strict "No-sx-in-Render" Policy: Prohibit
sxprop inside DataGrid cell renderers or tight loops - Add TanStack Query: React Query is essential for SRE data caching (see ADR-007)
- Grid Architecture:
- Prioritize server-side pagination/filtering over client-side 10k rows
- Aggressively tune
rowBuffer,columnBuffer, and usememo
- Performance Budgeting: Monitor rendering FPS on DataGrid, not just bundle size
Modifications Applied
- Clarified actual MUI version in use (v7.x per package.json)
- Documented sx prop performance restrictions
- Referenced ADR-007 for React Query integration
- Added DataGrid performance tuning guidelines
- Added runtime FPS monitoring recommendation
Council Ranking
- All models reached consensus on core approval
- gpt-5.2: Best Response (versioning concern)
- gemini-3-pro: Strong (performance focus)
References
ADR-006 | Frontend Layer | Implemented