React and Next.js performance optimization guidelines from Vercel Engineering. Use when writing, reviewing, or refactoring React/Next.js code in StarMapper — especially MapLibre components, data fetching, and bundle optimization.
التثبيت
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
React and Next.js performance optimization guidelines from Vercel Engineering. Use when writing, reviewing, or refactoring React/Next.js code in StarMapper — especially MapLibre components, data fetching, and bundle optimization.
js-early-exit — Return early from geocoding functions
StarMapper-Specific Notes
MapLibre GL bundle (~900KB) is the single biggest bundle concern. Dynamic import with ssr:false is mandatory and already in place via stargazer-map-dynamic.tsx.
Chunk loop state accumulates progressively — setPoints(prev => [...prev, ...newPoints]) is correct functional setState pattern.
GeoJSON construction is O(n) with n=stars — useMemo on points array is important for large repos.
Vercel free = no Edge Runtime needed — standard Node.js serverless functions work fine.