feat(performance): enhance application performance with optimizations and monitoring

- Updated package dependencies for improved localization support and performance.
- Introduced CSS performance optimizations to prevent layout shifts and enhance rendering efficiency.
- Implemented asset preloading and lazy loading strategies for critical components to improve load times.
- Enhanced translation loading with optimized caching and background loading strategies.
- Added performance monitoring utilities to track key metrics and improve user experience.
- Refactored task management components to utilize new performance features and ensure efficient rendering.
- Introduced new utility functions for asset and CSS optimizations to streamline resource management.
This commit is contained in:
chamiakJ
2025-07-10 20:39:15 +05:30
parent cf686ef8c5
commit 94977f7255
15 changed files with 3572 additions and 133 deletions

View File

@@ -19,6 +19,9 @@ import { Language } from './features/i18n/localesSlice';
import logger from './utils/errorLogger';
import { SuspenseFallback } from './components/suspense-fallback/suspense-fallback';
// Performance optimizations
import { CSSPerformanceMonitor, LayoutStabilizer, CriticalCSSManager } from './utils/css-optimizations';
// Service Worker
import { registerSW } from './utils/serviceWorkerRegistration';
@@ -84,6 +87,17 @@ const App: React.FC = memo(() => {
try {
// Initialize CSRF token immediately as it's needed for API calls
await initializeCsrfToken();
// Start CSS performance monitoring
CSSPerformanceMonitor.monitorLayoutShifts();
CSSPerformanceMonitor.monitorRenderBlocking();
// Preload critical fonts to prevent layout shifts
LayoutStabilizer.preloadFonts([
{ family: 'Inter', weight: '400' },
{ family: 'Inter', weight: '500' },
{ family: 'Inter', weight: '600' },
]);
} catch (error) {
if (isMounted) {
logger.error('Failed to initialize critical app functionality:', error);