Skip to content

[6.x] Bundle Control Panel icons into a single chunk - #15112

Merged
jasonvarga merged 1 commit into
6.xfrom
bundle-cp-icons
Aug 4, 2026
Merged

[6.x] Bundle Control Panel icons into a single chunk#15112
jasonvarga merged 1 commit into
6.xfrom
bundle-cp-icons

Conversation

@duncanmcclean

@duncanmcclean duncanmcclean commented Aug 4, 2026

Copy link
Copy Markdown
Member

This pull request fixes an issue where the Control Panel makes far more HTTP requests than it needs to, which can trip Cloudflare rate limiting rules — like the ones enabled by default on Laravel Cloud.

This was happening because the icon registry loads icons with import.meta.glob, which emits one lazily-loaded chunk per icon. Since Icon.vue awaits a separate loader for each one, every distinct icon rendered on a page was its own request. The nav alone accounts for around 20 of them, on every page.

It wasn't a problem in v5 because the nav was rendered in Blade with its icons inlined server-side, and much less of the Control Panel was Vue.

This PR fixes it by grouping the icons into a single chunk. The chunk is still lazily loaded, so the icons stay out of the entry bundle, but they arrive in one request and are cached from then on.

The build now emits 143 assets instead of 690. Measured against a sandbox site with a cold cache:

Page Before After
Dashboard 51 24
Collections 53 25
Asset browser 62 27

Helps with #14711

`import.meta.glob` emitted one lazy chunk per icon, so every distinct icon
rendered on a page cost its own request. A cold-cache Control Panel page load
fired 30-40 of them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jasonvarga
jasonvarga merged commit de707de into 6.x Aug 4, 2026
24 checks passed
@jasonvarga
jasonvarga deleted the bundle-cp-icons branch August 4, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants