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.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
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.