diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 1bb5810..17cc135 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -3,19 +3,24 @@ import { Routes, Route, Navigate } from 'react-router-dom'; import { useAuth } from '@/hooks/useAuth'; import LockScreen from '@/components/auth/LockScreen'; import AppLayout from '@/components/layout/AppLayout'; -import DashboardPage from '@/components/dashboard/DashboardPage'; -import TodosPage from '@/components/todos/TodosPage'; -import CalendarPage from '@/components/calendar/CalendarPage'; -import RemindersPage from '@/components/reminders/RemindersPage'; -import ProjectsPage from '@/components/projects/ProjectsPage'; -import ProjectDetail from '@/components/projects/ProjectDetail'; -import PeoplePage from '@/components/people/PeoplePage'; -import LocationsPage from '@/components/locations/LocationsPage'; -import SettingsPage from '@/components/settings/SettingsPage'; -import NotificationsPage from '@/components/notifications/NotificationsPage'; +// AS-2: Lazy-load all route components to reduce initial bundle parse time +const DashboardPage = lazy(() => import('@/components/dashboard/DashboardPage')); +const TodosPage = lazy(() => import('@/components/todos/TodosPage')); +const CalendarPage = lazy(() => import('@/components/calendar/CalendarPage')); +const RemindersPage = lazy(() => import('@/components/reminders/RemindersPage')); +const ProjectsPage = lazy(() => import('@/components/projects/ProjectsPage')); +const ProjectDetail = lazy(() => import('@/components/projects/ProjectDetail')); +const PeoplePage = lazy(() => import('@/components/people/PeoplePage')); +const LocationsPage = lazy(() => import('@/components/locations/LocationsPage')); +const SettingsPage = lazy(() => import('@/components/settings/SettingsPage')); +const NotificationsPage = lazy(() => import('@/components/notifications/NotificationsPage')); const AdminPortal = lazy(() => import('@/components/admin/AdminPortal')); +const RouteFallback = () => ( +
+ {format(now, 'h:mm a')} + | + {format(now, 'EEEE, MMMM d, yyyy')} +
+ {updatedAgo && ( + <> + · + Updated {updatedAgo} + + > + )} +- {format(clockNow, 'h:mm a')} - | - {format(clockNow, 'EEEE, MMMM d, yyyy')} -
- {updatedAgo && ( - <> - · - Updated {updatedAgo} - - > - )} -