Description
All 12 pages exceed the 200 kB first-load JS budget (gzip). The shared base alone is 252 kB across 19 chunks. Week-over-week increases of 17–87 kB on several pages (W19→W20) indicate growing bundle bloat. This affects initial page load time, especially on slower connections.
Source: metrics/weekly/2026-W20-perf.md
Acceptance Criteria
Dependencies
None
Technical Notes
- Current dynamic imports:
src/components/page-content-client.tsx, workspace-home-client.tsx, page-icon.tsx, landing-demo-editor.tsx, settings-page-content.tsx, danger-zone-settings.tsx, lazy-route-error.tsx, workspace-settings-form.tsx, page-view-client.tsx, settings-page-client.tsx
- Sentry already uses lazy capture (
src/lib/capture.ts) — verify no other files import @sentry/nextjs directly in client code
@lexical/* packages (12 packages) are the heaviest dependency group — ensure they only load on the editor page, not in shared chunks
- Use
npx @next/bundle-analyzer or Turbopack build output to identify chunk composition
- Reference
.agents/conventions.md for dynamic import patterns
Approval Required
This is a HIGH risk change:
- Modifying import structure across many files risks breaking code-splitting boundaries
- Dynamic imports change component loading behavior (loading states, hydration timing)
- Lexical editor chunk restructuring could affect editor initialization
- Requires careful verification that no functionality regresses
Comment "approved" to release this to the automation queue.
Description
All 12 pages exceed the 200 kB first-load JS budget (gzip). The shared base alone is 252 kB across 19 chunks. Week-over-week increases of 17–87 kB on several pages (W19→W20) indicate growing bundle bloat. This affects initial page load time, especially on slower connections.
Source:
metrics/weekly/2026-W20-perf.mdAcceptance Criteria
next/dynamicwithssr: falseto heavy client-only components not yet lazy-loaded (e.g., emoji picker, date picker, any remaining Lexical plugins loaded outside the editor page)lazyCaptureExceptionorinstrumentation-client.ts)lucide-reacticons use named imports (tree-shakeable) rather than barrel importspnpm lint && pnpm typecheck && pnpm testpassDependencies
None
Technical Notes
src/components/page-content-client.tsx,workspace-home-client.tsx,page-icon.tsx,landing-demo-editor.tsx,settings-page-content.tsx,danger-zone-settings.tsx,lazy-route-error.tsx,workspace-settings-form.tsx,page-view-client.tsx,settings-page-client.tsxsrc/lib/capture.ts) — verify no other files import@sentry/nextjsdirectly in client code@lexical/*packages (12 packages) are the heaviest dependency group — ensure they only load on the editor page, not in shared chunksnpx @next/bundle-analyzeror Turbopack build output to identify chunk composition.agents/conventions.mdfor dynamic import patternsApproval Required
This is a HIGH risk change:
Comment "approved" to release this to the automation queue.