Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Blaze Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • Blaze is a compile-time view-layer optimizer, not a runtime service. It hooks the Blade component compilation pipeline and emits optimized PHP functions in place of the standard render path. This means it slots into the Laravel request lifecycle with no new infrastructure, no queue, no external dependency, and no data-store changes.
  • It targets anonymous Blade components exclusively — the <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.
  • Three tiers with materially different risk profiles: Function Compiler (safe default, drop-in), Memoization (cache keyed on component + props, slotless only), Folding (pre-renders to static HTML at compile time, component ceases to exist at runtime). The TPM framing should treat these as three separate adoption decisions, not one.
  • Official affinity with Flux UI is a significant signal: if the org is on Flux, install alone yields gains with zero configuration, which de-risks the first step considerably.

Integration feasibility

  • Very low effort to enable: 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.
  • Enablement is granular by directory and per file (compile: false exclusions), which maps well to the common "optimize the design system, leave legacy alone" pattern.
  • The bundled agent skill (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.
  • The compatibility check is expressible as concrete greps: class-based components in 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

  • Folding is the dominant risk. It bakes markup at compile time; any internal dependence on global state (auth, session, request, 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.
  • Memoization risks stale rendering when props include mutable objects or values that change mid-request, and is unavailable for components with slots — so it does not apply to the components most likely to be expensive.
  • Documented feature gaps are non-trivial for mature apps: no class-based components, no $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.
  • Framework coupling risk: the package reimplements Blade's compilation and a component/attribute bag. Every Laravel major version that touches the view compiler is a potential breaking surface, and the failure mode may be malformed output rather than a clean exception.
  • Adoption signal is thin: 757 stars, 0 dependents, maturity limited to README and releases, and a release date recorded as 2026-11-03 — a future date that suggests either a data-quality issue in the registry metadata or a pre-release/staged artifact. This should be verified before it is treated as production-stable.
  • The headline benchmark (25,000 components, 500ms → 13ms) is a synthetic micro-benchmark. It measures render pipeline overhead only; the README itself concedes that expensive work inside templates is unaffected. Real-world gain on a typical page may be a small single-digit percentage of total response time.

Key questions

  1. What is the actual bottleneck we are solving? If p95 latency is dominated by queries, N+1s, or external calls, Blaze will not move the metric. We need a profile before a decision.
  2. How many anonymous components exist, and what share of rendered output do they represent? Below a threshold, the payoff does not justify the verification effort.
  3. Do we use class-based components anywhere central, and is converting them to anonymous in scope?
  4. Do any component views have registered view composers/creators, or rely on View::share() variables? If so, those directories must be excluded or the code refactored — this is the most likely source of a broken deploy.
  5. Is @aware used across a Blade/Blaze boundary anywhere in the component tree?
  6. Does the org run Flux UI? If yes, this materially lowers the cost of a first, reversible experiment.
  7. Can we diff rendered HTML between Blade and Blaze across a representative route set in CI? Without that harness, every subsequent strategy is unverifiable.
  8. Who owns post-deploy verification, and what is the rollback? (Removing the optimize() call plus view:clear is the rollback — cheap, which is a genuine positive.)
  9. Is folding ever in scope? It should require an explicit per-component written justification and a slotless/global-state-free audit, not a directory-level flag.

Integration Approach

Stack fit

  • Requires Laravel with anonymous Blade components; Composer-installed; no runtime, queue, cache, or schema footprint.
  • Best fit: Laravel 11/12-era applications with a substantial in-house component library, design-system-heavy views, or Flux/Flux Pro. Also good fit for Livewire apps rendering many repeated presentational components per request.
  • Poor fit: apps dominated by class-based components, heavy reliance on view composers for component data, or components rendered through view() inside controllers and mailers.

Migration path

  • Stage 1 — Baseline and inventory: profile a small set of representative routes; count anonymous components and map the directory tree; identify any custom anonymousComponentPath/anonymousComponentNamespace registrations, since those also need explicit coverage.
  • Stage 2 — Compatibility sweep: run the README's limitation list and the skill's grep table against candidate directories. Produce an explicit exclude list (legacy, class-based, composer-dependent, view()-rendered, $component-using).
  • Stage 3 — Pilot in staging with @blaze only: enable on 5–10 leaf components (icon, button, badge) via the directive, avoiding a global provider change. Verify HTML parity and measure.
  • Stage 4 — Directory-level function compilation: promote the validated directories to Blaze::optimize()->in(...) in AppServiceProvider, with compile: false on anything excluded. This is the recommended steady state for most apps.
  • Stage 5 — Selective memoization: only for slotless, prop-stable repetition (icon sets, avatars). Requires confirming props are scalars/immutable.
  • Stage 6 — Folding: opt-in per component, never directory-wide, only for components with zero external state and a verified static output. Treat as an individual engineering review item, not a config default.

Compatibility

  • Hard blockers requiring refactor or exclusion: class-based components, $component, view composers/creators on component views, View::share() auto-injection, view('components.*') rendering, cross-boundary @aware.
  • Soft concerns: components with slots are ineligible for memoization; dynamic attributes bound to @props-declared names automatically abort folding and fall back to function compilation (safe, but the perf expectation should be adjusted).
  • Build and deployment compatibility is the sleeper issue: compiled views must be cleared on deploy, and any CI artifact or container image that ships pre-compiled views can pin stale folded HTML across a release.

Sequencing

  • Perf baseline → component inventory → compatibility grep → staging pilot with @blaze → HTML diff + measurement → directory promotion → advance strategies last.
  • Run the whole track behind a feature-flagged provider registration (or an env-gated optimize() call) so the change is a one-line toggle per environment.
  • Do not let an agent-driven blaze-optimize run touch a protected branch unreviewed; require the generated summary report and exclude list to be attached to the PR.

Operational Impact

Maintenance

  • Low ongoing code maintenance (one provider call, occasional @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.
  • The compatibility exclusion list is a living artifact. New component directories and any reintroduction of view composers require re-checking, otherwise behavior silently diverges between Blaze-compiled and non-compiled components.
  • Maturity is a maintenance factor: README-and-releases-only documentation, no published upgrade guide, no LTS commitment. Budget for reading source when behavior is ambiguous.

Support

  • MIT-licensed, Livewire-org-backed — reasonable expectation of stewardship, but no commercial support path, no SLA, and a small dependents footprint means limited community troubleshooting. Internal ownership should be assigned to one engineer on the platform team rather than distributed.
  • The agent skill is effective onboarding material but is not a substitute for a named owner; its "execute immediately" posture should be paired with a review requirement.

Scaling

  • Gains are CPU/render-time, roughly proportional to component count per request. They help most under high concurrency on component-heavy pages, where view rendering is a measurable share of request time. Folding makes cost essentially constant in component count.
  • No new scaling dimension is introduced — no cache server, no worker, no memory growth beyond a modest memo cache scoped to the request.
  • Beware the benchmark trap in capacity planning: a 97% reduction in render pipeline overhead is not a 97% reduction in response time. Model the delta against measured total request time, and re-measure after enabling rather than extrapolating from the README table.

Failure modes

  • Silent incorrect HTML from folding — highest severity, no exception, may only surface in a subset of call sites. Mitigation: no directory-wide folding; per-component audit; CI HTML snapshot diff.
  • Memo cache poisoning — wrong output when props are objects or mutate within a request. Mitigation: restrict memo to scalar-prop, slotless components.
  • Missing shared data / non-firing composers — components render with absent variables, producing blanks or errors only on the compiled path. Mitigation: the grep sweep and directory exclusions in Stage 2.
  • @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.
  • Stale compiled views after deploy — old folded HTML served post-release. Mitigation: mandatory view:clear in the deploy pipeline; never ship pre-compiled views.
  • Exception on detected global state — loud but recoverable; a hard 500 on a page that worked before enablement. This is the good failure mode; it should not be suppressed or blanket-rescued.
  • Environment drift — Blaze enabled in staging but not production, or with different directory scopes, causing perf and behavior divergence that is difficult to attribute. Mitigation: config in version control, identical scope per environment.

Ramp-up

  • Enabling via the function compiler is a sub-day effort for an engineer familiar with Blade; the drop-in claim holds for this tier.
  • Advanced strategies (memo, folding) require genuine conceptual ramp-up — folding's placeholder/attribute/slot semantics and the static-vs-pass-through attribute distinction are subtle and easy to misapply. Plan for a short internal write-up and a review checklist before folding is permitted.
  • The compatibility sweep is the real time sink and scales with component-library size and legacy surface area; budget it as the dominant cost, not the integration itself.
  • Overall recommendation posture: adopt the function compiler broadly after a staged pilot, treat memoization as a targeted optimization, and treat folding as an opt-in exception process — the perf ceiling is real, but the failure mode of the top tier is silent and product-visible, which argues for deliberately stopping short of it unless a specific page justifies the audit.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
adachsoft/php-code-style