From c3d88bb972d1f44bdfa06c2bfeee15655f3ec593 Mon Sep 17 00:00:00 2001 From: yiling Date: Thu, 9 Jul 2026 15:32:15 +0800 Subject: [PATCH] docs: add concise route code-splitting guideline to AGENTS.md --- AGENTS.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 09532d01..0ac7406e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -197,10 +197,15 @@ The frontend is built with: - **Prefer System Colors**: Always prefer using semantic system color design tokens (e.g., `bg-background`, `text-foreground`, `text-sidebar-primary`, `text-muted-foreground`, etc.) over hardcoded color utilities (e.g., `bg-blue-50`, `text-emerald-600`, `bg-emerald-500`). This ensures seamless compatibility with light and dark themes. +### Route Code-Splitting + +To optimize initial bundle size, all routes must be code-split into `[route].tsx` (lightweight route definition and loaders) and `[route].lazy.tsx` (UI component and heavy imports). + ### Development - **Run Dev**: `bun run dev` (Runs on port 3000) + ## Testing We use **Vitest** for testing (via `bun run test`). **Do not use `bun test`** as it uses Bun's native test runner which is not compatible with this project's test suite.