Skip to content

Commit bedb3cd

Browse files
committed
Update README.md
1 parent 74d971d commit bedb3cd

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

README.md

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@ Blaze supercharges your Blade components by compiling them into direct PHP funct
1313

1414
Blaze is designed as a drop-in replacement for anonymous Blade components. It supports all essential features including props, slots, attributes, and `@aware`. The HTML output is identical to standard Blade rendering.
1515

16-
> [!IMPORTANT]
17-
> When using `@aware`, both the parent and child components must use Blaze for values to propagate correctly.
16+
### Limitations
17+
18+
Blaze focuses on anonymous components. The following are not supported:
19+
20+
- Class-based components
21+
- The `$component` variable
22+
- `View::share()` variables
23+
- View composers / creators
24+
- Component lifecycle events
1825

1926
## Installation
2027

@@ -46,9 +53,6 @@ This optimizes all [anonymous component paths](https://laravel.com/docs/12.x/bla
4653
php artisan view:clear
4754
```
4855

49-
> [!NOTE]
50-
> Blaze focuses on anonymous components. Class-based components, the `$component` variable, `View::share()` variables, view composers, and component lifecycle events are not supported.
51-
5256
## Configuration
5357

5458
### Directory-Based Optimization
@@ -91,6 +95,13 @@ Optimization strategies can be specified directly:
9195

9296
Component-level directives override directory-level settings.
9397

98+
### Using @aware
99+
100+
Blaze fully supports the `@aware` directive for sharing data between parent and child components.
101+
102+
> [!IMPORTANT]
103+
> When using `@aware`, both the parent and child components must use Blaze for values to propagate correctly.
104+
94105
## Optimization Strategies
95106

96107
Blaze offers three optimization strategies, each suited to different use cases:
@@ -178,11 +189,25 @@ If `<x-icon name="check" />` appears 50 times on a page, it renders once and reu
178189

179190
### Compile-Time Folding
180191

181-
Compile-time folding is Blaze's most aggressive optimization. It pre-renders components during compilation, embedding the HTML directly into your template. The component no longer exists at runtime.
192+
Compile-time folding is Blaze's most aggressive optimization. It pre-renders components during compilation, embedding the HTML directly into your template. The component ceases to exist at runtime - there is no function call, no variable resolution, no overhead whatsoever.
193+
194+
#### Benchmark Results
195+
196+
Because folded components are rendered at compile-time, the runtime cost is effectively zero. The rendering time remains constant regardless of how many components you use:
197+
198+
| Components | Blade | Blaze (folded) |
199+
|------------|-------|----------------|
200+
| 25,000 | 500ms | 0.68ms |
201+
| 50,000 | 1,000ms | 0.68ms |
202+
| 100,000 | 2,000ms | 0.68ms |
203+
204+
The time doesn't grow because there are no components to render - just static HTML.
182205

183206
> [!CAUTION]
184207
> Folding requires careful consideration. Used incorrectly, it can cause subtle bugs that are difficult to diagnose. Review the [Folding](#folding) section before enabling.
185208
209+
#### How It Works
210+
186211
```blade
187212
@blaze(fold: true)
188213

0 commit comments

Comments
 (0)