feat: implement performance optimizations
- Add database indexes for frequently queried fields (listId, completed, priority, dueDate, createdAt) - Add compound indexes for common query patterns (listId+completed, listId+priority) - Implement pagination support in getItemsByFilter with configurable page size (default 50) - Optimize components with React.memo (ItemCard, ListCard, FilterPanel, SearchBar, SearchResults, EmptyState) - Configure Next.js for better bundle optimization: - Enable optimizePackageImports for lucide-react - Enable SWC minification - Remove console logs in production (except errors/warnings) - Optimize images with AVIF/WebP formats - Enable compression - Disable production source maps for smaller bundles - Loading states already implemented to prevent layout shift Task 18 complete - all performance optimizations implemented
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import { memo } from 'react'
|
||||
import Link from 'next/link'
|
||||
import { Calendar, Tag, AlertCircle } from 'lucide-react'
|
||||
import ToggleItemButton from './ToggleItemButton'
|
||||
@@ -19,7 +20,7 @@ interface ItemCardProps {
|
||||
listId: string
|
||||
}
|
||||
|
||||
export default function ItemCard({ item, listId }: ItemCardProps) {
|
||||
function ItemCard({ item, listId }: ItemCardProps) {
|
||||
const tags = Array.isArray(item.tags) ? item.tags : []
|
||||
const isOverdue = item.dueDate && new Date(item.dueDate) < new Date() && !item.completed
|
||||
|
||||
@@ -104,3 +105,5 @@ export default function ItemCard({ item, listId }: ItemCardProps) {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default memo(ItemCard)
|
||||
|
||||
Reference in New Issue
Block a user