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,7 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import { memo, useState } from 'react'
|
||||
import Link from 'next/link'
|
||||
import { useState } from 'react'
|
||||
import { Edit2 } from 'lucide-react'
|
||||
import Modal from './Modal'
|
||||
import ListForm from './ListForm'
|
||||
@@ -17,7 +17,7 @@ interface List {
|
||||
}>
|
||||
}
|
||||
|
||||
export default function ListCard({ list }: { list: List }) {
|
||||
function ListCard({ list }: { list: List }) {
|
||||
const [isEditModalOpen, setIsEditModalOpen] = useState(false)
|
||||
const completedCount = list.items.filter(item => item.completed).length
|
||||
const totalCount = list.items.length
|
||||
@@ -94,4 +94,6 @@ export default function ListCard({ list }: { list: List }) {
|
||||
</Modal>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default memo(ListCard)
|
||||
Reference in New Issue
Block a user