Keep all.css under a gzip size budget, no Node required

Measured the way the showcase and the error page's fallback actually serve
it — Stylesheets::bundle() in PHP, then PHP's own gzencode() — so CI holds
the line with no Node build. Currently 106,838 bytes gzipped; the budget is
120,000, about 10% of headroom for organic growth before the failure
message points a maintainer at what grew.

Plan step 42 (Phase F), Part A.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
Andreas Reinhold / reini
2026-09-15 09:34:27 +02:00
co-authored by Claude Sonnet 5
parent 6efb0b5a30
commit 4cf0997712
+17
View File
@@ -3,6 +3,7 @@
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\File;
use NoNameWeb\LivewireMaterial\Support\Layout;
use NoNameWeb\LivewireMaterial\Support\Stylesheets;
use NoNameWeb\LivewireMaterial\Testing\DesignGuard;
/**
@@ -772,3 +773,19 @@ it('shapes showcase.css like a package stylesheet, with its documented unlayered
}
}
});
it('keeps all.css under a gzip size budget, measured through Stylesheets::bundle()', function () {
// 106,838 bytes gzipped today (2026-09-15), rounded up by about 10% to a number CI can hold
// to without Node: PHP's own gzencode() on the same bytes Stylesheets::bundle() serves the
// showcase and the error page's fallback. A little organic growth should not retrigger this
// on every commit; a real jump means look at what grew since the budget was last raised.
$budget = 120_000;
$gzipped = strlen((string) gzencode(Stylesheets::bundle([stylesheetPath('all.css')]), 9));
expect($gzipped)->toBeLessThanOrEqual($budget, sprintf(
'all.css now gzips to %s bytes, over the %s-byte budget — see what grew, and raise the budget deliberately if it should have.',
number_format($gzipped),
number_format($budget),
));
});