Weave Code
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 speeds up Laravel Blade anonymous components by compiling templates into optimized PHP functions. Drop-in replacement with no code changes. Optional memoization and folding for extra gains. Enable via @blaze directive or optimize directories.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Performance-Critical UI Components: Justify investment in optimizing high-traffic or frequently rendered components (e.g., dashboards, modals, or lists) where rendering speed directly impacts user experience (UX) or scalability.
  • Build vs. Buy: Replace custom caching solutions or third-party optimizers (e.g., Vite plugins, Alpine.js) for Blade components, reducing technical debt and vendor lock-in.
  • Roadmap Prioritization:
    • Phase 1: Adopt @blaze for anonymous components in performance-critical sections (e.g., tables, cards) with minimal risk (default function compilation).
    • Phase 2: Gradually enable memoization for static components (e.g., icons, avatars) to reduce redundant renders.
    • Phase 3: Experiment with folding for highly repetitive, static-heavy components (e.g., utility buttons, placeholders) after validating compatibility.
  • Feature Expansion: Enable new features like real-time updates (e.g., Livewire + Blaze) or server-side rendering (SSR) for SEO without sacrificing performance.
  • Cost Optimization: Reduce server load for high-traffic pages, potentially lowering cloud infrastructure costs (e.g., AWS Lambda, Vercel Edge Functions).

When to Consider This Package

Adopt Blaze if:

  • Your app uses Laravel Blade components (anonymous or named) and suffers from slow rendering times (e.g., >100ms for complex pages).
  • You render thousands of identical components in loops (e.g., product grids, chat messages, analytics charts).
  • Your team is already using Livewire or Flux UI, as Blaze integrates seamlessly.
  • You prioritize performance over dynamic flexibility (e.g., static content, utility UI).

Look elsewhere if:

  • Your components rely heavily on global state (e.g., database queries, auth checks, session data) and cannot be refactored for folding.
  • You use class-based components or view composers/creators, which Blaze doesn’t support.
  • Your app requires runtime dynamic behavior (e.g., components that change based on user input or external APIs) that folding cannot handle.
  • You lack developer bandwidth to test and validate optimizations incrementally (Blaze requires careful rollout).
  • You’re using alternative templating engines (e.g., Inertia.js, React/Vue SSR) where Blade isn’t the bottleneck.

How to Pitch It (Stakeholders)

For Executives: *"Blaze is a drop-in performance booster for Laravel apps that can cut rendering time by 90–97% for Blade components—think of it as a turbocharger for your UI. For example, a page with 25,000 components drops from 500ms to 13ms with zero code changes. This directly improves:

  • User experience (faster load times, smoother interactions).
  • Scalability (handles more traffic without upgrading servers).
  • Cost savings (reduces cloud infrastructure expenses). We’ll start with low-risk optimizations (e.g., buttons, icons) and expand to high-impact areas like dashboards. The MIT license and Livewire backing make it a safe bet."*

For Engineering Teams: *"Blaze replaces Blade’s rendering pipeline with pre-compiled PHP functions, eliminating overhead while keeping Blade syntax intact. Key benefits:

  • Zero refactoring: Add @blaze to components or optimize directories via Blaze::optimize().
  • Three optimization tiers:
    1. Default (Function Compiler): 90%+ speedup, supports all Blade features.
    2. Memoization: Caches repeated components (e.g., icons) to render once.
    3. Folding: Pre-renders static components into HTML (near-instant, but requires validation).
  • Limitations: Avoid folding for dynamic components (e.g., those using auth(), now(), or DB queries). Proposal: Pilot on 5–10 high-traffic components, measure impact, then scale. Tools like Blackfire can quantify gains before full rollout."*

For Developers: *"Blaze lets you optimize Blade components without rewriting them. Here’s how to start:

  1. Install: composer require livewire/blaze.
  2. Test: Add @blaze to a simple component (e.g., <x-button>), clear views (php artisan view:clear), and verify speed.
  3. Scale: Use Blaze::optimize() in AppServiceProvider for bulk optimization. Caveats:
  • Folding breaks if components use global state (e.g., Auth::user()). Use memo for safer caching.
  • Debugging folded components requires checking compiled views (bootstrap/cache/). Win: Faster pages, less server load, and no major code changes."*
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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui