Skip to content

feat(client): dynamic imports for large components and performance metrics#36

Open
cto-new[bot] wants to merge 1 commit intomainfrom
feat-code-splitting-dynamic-imports-perf-metrics
Open

feat(client): dynamic imports for large components and performance metrics#36
cto-new[bot] wants to merge 1 commit intomainfrom
feat-code-splitting-dynamic-imports-perf-metrics

Conversation

@cto-new
Copy link
Contributor

@cto-new cto-new bot commented Nov 20, 2025

Summary

This PR introduces dynamic imports for large client components to improve initial load performance and adds a comprehensive performance monitoring suite.

Details

  • Route-based and component-level lazy loading using createLazyComponent
  • Enhanced code splitting with vendor and feature chunks
  • Prefetching strategies (idle, hover, viewport) to improve perceived performance
  • Core Web Vitals, memory usage, bundle analysis, and API timing monitoring
  • New utilities/hooks: bundleAnalyzer.ts, useAdvancedPerformance.ts, PerformanceWidget.tsx
  • Preload critical components on startup and through hover/viewport cues
  • Adjusted exports/imports for lazy-loading consistency

…performance monitoring

This adds code-splitting via dynamic imports, route-based chunks, prefetching, and a performance monitoring suite that tracks Core Web Vitals, memory usage, bundles, and API timings.

- Introduce route-based and component lazy loading with createLazyComponent
- Update build to support feature-based and vendor chunks with manualChunks
- Implement prefetching strategies (idle time, hover, viewport)
- Add performance monitoring: Core Web Vitals (LCP, FID, CLS, FCP, TTFB), memory usage alerts, bundle analysis, and API metrics
- Create utilities/hooks: bundleAnalyzer.ts, useAdvancedPerformance.ts, PerformanceWidget.tsx
- Integrate preloading in App and extend LazyComponents with preloads
- Align defaults for some lazy-loaded pages to support dynamic imports

BREAKING CHANGE: some modules switched to default exports to support dynamic imports; update imports accordingly if you reference these modules directly.
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.

0 participants