plugin-bundle-size
OfficialReduce Grafana plugin startup with code splitting
System Documentation
What problem does it solve?
Grafana app plugins often ship a large, render-blocking module.js that slows Grafana startup and increases perceived latency for users. This Skill provides a step-by-step approach to identify eager imports, convert the entry point to a lazy-loaded root, and apply route- and extension-level code splitting so feature code loads on demand.
Core Features & Use Cases
- Entry-point refactor: Rename module.ts to module.tsx and ensure the entry imports only lightweight wrappers while feature code is loaded with React.lazy and Suspense.
- Route and extension splitting: Convert route components and plugin extensions to lazy-loaded chunks to reduce the initial payload and defer heavy code until needed.
- CI and measurement: Add bundle-size CI reporting to capture PR diffs, measure module.js and chunk counts, and verify targets (module.js < ~200 KB; 15–25 chunks).
- Troubleshooting and safety: Guidance on extracting singletons (e.g., Faro), grouping chunks with webpack magic comments, and common fixes for Suspense boundaries and chunk loading issues.
Quick Start
Diagnose and reduce your plugin's module.js by converting the entry to module.tsx, wrapping routes and extensions with React.lazy and Suspense, and running a production build to verify module.js and chunk counts.
Dependency Matrix
Required Modules
None requiredComponents
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: plugin-bundle-size Download link: https://github.com/grafana/skills/archive/main.zip#plugin-bundle-size Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.