This pull request introduces several optimizations and improvements across the codebase, focusing on performance, user experience, and maintainability. Key changes include adding a service worker for offline support and caching, enhancing the AniList page with dynamic loading and improved pagination, optimizing Next.js configuration for better performance, and tightening linting rules. The AniList API route is also updated for more efficient caching and support for paginated requests.
Performance and Caching Improvements
- Added a new service worker (
public/sw.js) to enable offline support and implement cache-first and network-first strategies for static assets and API requests, improving load times and resilience.
- Updated the AniList API route (
src/app/api/anilist/route.ts) to support pagination via offset and limit parameters, separated full data caching, and increased cache TTL for better performance. [1] [2] [3]
AniList Page Enhancements
- Refactored
src/app/anilist/page.tsx to use dynamic imports for AnimeCard (enabling code splitting), implemented paginated loading with "Load More" functionality per status, added background refresh, improved group sorting, and enhanced state management for a smoother user experience. [1] [2] [3] [4] [5] [6] [7] [8]
Next.js Configuration and Build Tools
- Enhanced
next.config.ts to enable compression, advanced image optimization, experimental features, conditional bundle analysis, and standalone output for improved performance and deployment flexibility.
- Added
webpack-bundle-analyzer as a dependency and introduced a build:analyze script in package.json for easier bundle analysis. [1] [2]
Linting and Code Quality
- Strengthened linting rules in
biome.json by enabling additional performance, correctness, and style checks, helping to prevent common bugs and enforce best practices.
This pull request introduces several optimizations and improvements across the codebase, focusing on performance, user experience, and maintainability. Key changes include adding a service worker for offline support and caching, enhancing the AniList page with dynamic loading and improved pagination, optimizing Next.js configuration for better performance, and tightening linting rules. The AniList API route is also updated for more efficient caching and support for paginated requests.
**Performance and Caching Improvements**
- Added a new service worker (`public/sw.js`) to enable offline support and implement cache-first and network-first strategies for static assets and API requests, improving load times and resilience.
- Updated the AniList API route (`src/app/api/anilist/route.ts`) to support pagination via `offset` and `limit` parameters, separated full data caching, and increased cache TTL for better performance. [[1]](diffhunk://#diff-45dd75ae65a800ea175ffac223c54ed5c338f44ec173761469f22981bee83be7R9-R10) [[2]](diffhunk://#diff-45dd75ae65a800ea175ffac223c54ed5c338f44ec173761469f22981bee83be7L101-R104) [[3]](diffhunk://#diff-45dd75ae65a800ea175ffac223c54ed5c338f44ec173761469f22981bee83be7R180-R181)
**AniList Page Enhancements**
- Refactored `src/app/anilist/page.tsx` to use dynamic imports for `AnimeCard` (enabling code splitting), implemented paginated loading with "Load More" functionality per status, added background refresh, improved group sorting, and enhanced state management for a smoother user experience. [[1]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddL3-R18) [[2]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddR59-R61) [[3]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddR70-R204) [[4]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddL105-R217) [[5]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddL132-R243) [[6]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddL141-R283) [[7]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddL180-R294) [[8]](diffhunk://#diff-00ff31de54fff4ce8beb9d4770c10bc2ffeb5b1364169bfae36450bbc88e46ddL196-R314)
**Next.js Configuration and Build Tools**
- Enhanced `next.config.ts` to enable compression, advanced image optimization, experimental features, conditional bundle analysis, and standalone output for improved performance and deployment flexibility.
- Added `webpack-bundle-analyzer` as a dependency and introduced a `build:analyze` script in `package.json` for easier bundle analysis. [[1]](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R8) [[2]](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L24-R26)
**Linting and Code Quality**
- Strengthened linting rules in `biome.json` by enabling additional performance, correctness, and style checks, helping to prevent common bugs and enforce best practices.