Aios Bundle 效能修復 Codex 提示詞 2026-08-08 的副本
由 陳柏能 分享的筆記
` 包住了 ` `,所以 5 個頁面改成 lazy 後會自動吃到這個 Suspense boundary。 ### Step 3: 重型元件動態 import(預估減少 ~60KB gzip) **修改 `client/src/app/AppShell.tsx`**: ```typescript // 移除頂部的靜態 import: // import from "../components/NotificationSettings"; // import from "../feedback/FeedbackWidget"; // import from "../components/FloatingDmBubble"; // 改用 lazyWithRetry: const NotificationSettingsDialog = lazyWithRetry( () => import("../components/NotificationSettings").then(m => ( )) ); const PushSubscriptionSync = lazyWithRetry( () => import("../components/NotificationSettings").then(m => ( )) ); const FeedbackWidget = lazyWithRetry( () => import("../feedback/FeedbackWidget").then(m => ( )) ); const FloatingDmBubble = lazyWithRetry( () => import("../components/FloatingDmBubble").then(m => ( )) ); ``` 使用處保持不變——AppShell 外層已經有…