livewire/blaze
Blaze is a drop-in replacement for anonymous Blade components, compiling templates into optimized PHP functions and eliminating 91–97% of rendering overhead. Optional memoization and folding deliver even faster repeated renders.
Architecture fit
<x-...> pattern most design systems, icon sets, and UI kits are built on. Apps with a large shared component library (buttons, badges, icons, cards) are the natural fit; apps with mostly page-level Blade and few components will see little benefit.Integration feasibility
composer require livewire/blaze:^1.0, a single Blaze::optimize()->in(...) call in AppServiceProvider::boot(), and php artisan view:clear. Per-component opt-in via @blaze is available for a trial run.compile: false exclusions), which maps well to the common "optimize the design system, leave legacy alone" pattern.skills/blaze-optimize/SKILL.md) encodes a sensible sequence — install, scan, compatibility grep, enable, debug, report — and is genuinely useful as a repeatable checklist. However, it explicitly instructs an agent to execute steps 1–5 without confirmation. That is a governance flag: automated edits to AppServiceProvider and .env on a production-adjacent branch need a human review gate in any regulated or high-traffic codebase.app/View/Components/, $component, View::composer(/View::creator( scoped to component views, View::share(, and view('components....') calls. This makes the assessment auditable rather than judgment-based.Technical risk
now(), $errors, @csrf, DB reads) produces silently wrong HTML. Blaze attempts to detect this and throws, but the README is explicit that detection is incomplete — and it cannot detect it when state enters via attributes or slots. Silent-wrong-output is the worst failure class for a product; it degrades trust without an error signal.$component, view composers/creators/lifecycle events do not fire, no auto-injected View::share() data, @aware breaks across the Blade/Blaze boundary, and Blaze components cannot be rendered via view(). Any of these silently changing behavior is a migration cost that must be inventoried up front.Key questions
View::share() variables? If so, those directories must be excluded or the code refactored — this is the most likely source of a broken deploy.@aware used across a Blade/Blaze boundary anywhere in the component tree?optimize() call plus view:clear is the rollback — cheap, which is a genuine positive.)Stack fit
view() inside controllers and mailers.Migration path
anonymousComponentPath/anonymousComponentNamespace registrations, since those also need explicit coverage.view()-rendered, $component-using).@blaze only: enable on 5–10 leaf components (icon, button, badge) via the directive, avoiding a global provider change. Verify HTML parity and measure.Blaze::optimize()->in(...) in AppServiceProvider, with compile: false on anything excluded. This is the recommended steady state for most apps.Compatibility
$component, view composers/creators on component views, View::share() auto-injection, view('components.*') rendering, cross-boundary @aware.@props-declared names automatically abort folding and fall back to function compilation (safe, but the perf expectation should be adjusted).Sequencing
@blaze → HTML diff + measurement → directory promotion → advance strategies last.optimize() call) so the change is a one-line toggle per environment.blaze-optimize run touch a protected branch unreviewed; require the generated summary report and exclude list to be attached to the PR.Maintenance
@blaze annotations) but non-trivial upgrade maintenance: the package is coupled to Blade's compiler internals and its own attribute-bag implementation. Every Laravel major upgrade needs a Blaze verification pass in the release checklist, and the upgrade should be sequenced with — not after — the framework bump.Support
Scaling
Failure modes
@aware boundary breakage — partial component trees render with default/empty values, often subtly, when parent and child are on different compilation paths. Mitigation: keep related component families on the same side of the boundary.view:clear in the deploy pipeline; never ship pre-compiled views.Ramp-up
How can I help you explore Laravel packages today?