1 import { createRoot } from "react-dom/client";
2 import App from "./App";
3 import "./index.css";
4
5 // Create root and render app immediately for faster startup
6 const root = createRoot(document.getElementById("root")!);
7 root.render(<App />);
8
9 // Load PWA functionality and performance optimizations after app renders (non-blocking)
10 Promise.all([
11 import("./pwa-utils"),
12 import("./utils/performance")
13 ]).then(([pwaUtils, perfUtils]) => {
14 // PWA setup
15 pwaUtils.registerServiceWorker();
16 pwaUtils.setupOfflineDetection();
17
18 // Performance optimizations
19 perfUtils.preloadCriticalRoutes();
20 perfUtils.setupImageOptimization();
21 perfUtils.setupPreconnects();
22 perfUtils.setupPerformanceMonitoring();
23 }).catch(console.error);