New advertisers: 50% off your first month with code FIRSTMONTHSee slots
mapbox avatar

Mapbox Web Performance Patterns

Performance patterns for Mapbox GL JS covering initialization waterfalls, bundle size, marker rendering, and memory.

skills.sh installs
2.6K
GitHub stars
87
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers parallel data loading, precise initial viewports, deferred non-critical layers, and external style hosting to cut load time
  • Includes before-and-after code for loading data alongside map init, using requestIdleCallback for terrain and 3D layers, and clustering markers
  • Gives marker-count thresholds: HTML markers under 100, symbol layers for 100 to 10,000, and clustering above 10,000 features
  • Designed for Mapbox GL JS developers whose web maps load slowly or stutter during pan and zoom

Install

$ npx -y skills add mapbox/mapbox-agent-skills --skill mapbox-web-performance-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Mapbox Performance Patterns Skill

This skill provides performance optimization guidance for building fast, efficient Mapbox applications. Patterns are prioritized by impact on user experience, starting with the most critical improvements.

Performance philosophy: These aren't micro-optimizations. They show up as waiting time, jank, and repeat costs that hit every user session.

Priority Levels

Performance issues are prioritized by their impact on user experience:

  • 🔴 Critical (Fix First): Directly causes slow initial load or visible jank
  • 🟡 High Impact: Noticeable delays or increased resource usage
  • 🟢 Optimization: Incremental improvements for polish

🔴 Critical: Eliminate Initialization Waterfalls

Problem: Sequential loading creates cascading delays where each resource waits for the previous one.

Note: Modern bundlers (Vite, Webpack, etc.) and ESM dynamic imports automatically handle code splitting and library loading. The primary waterfall to eliminate is data loading - fetching map data sequentially instead of in parallel with map initialization.

Anti-Pattern: Sequential Data Loading

Details

Repository
github.com/mapbox/mapbox-agent-skills
Categories
Frontend & UI Code, Browser Automation & Scraping
First seen
Apr 16, 2026

More from mapbox/mapbox-agent-skills

All 18

Similar to Mapbox Web Performance Patterns

More Frontend & UI Code