12 lines
384 B
Text
12 lines
384 B
Text
|
|
---
|
||
|
|
description:
|
||
|
|
globs:
|
||
|
|
alwaysApply: true
|
||
|
|
---
|
||
|
|
This rule describes how to optimize the code for performance.
|
||
|
|
|
||
|
|
- Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC).
|
||
|
|
- Wrap client components in Suspense with fallback.
|
||
|
|
- Use dynamic loading for non-critical components.
|
||
|
|
- Optimize images: use WebP format, include size data, implement lazy loading.
|