Skip to content

Commit 512d588

Browse files
committed
Update README.md
1 parent 28dcb4e commit 512d588

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Optimization strategies can be specified directly:
131131

132132
Component-level directives override directory-level settings.
133133

134-
## Optimization Strategies
134+
# Optimization Strategies
135135

136136
By default Blaze uses **Function Compilation**, which works for virtually all components and provides significant performance improvements — this is sufficient for most use cases.
137137

@@ -144,7 +144,7 @@ To go even further, you can consider the other strategies that require additiona
144144
| Compile-Time Folding | `fold` | Maximum performance | 100% |
145145

146146

147-
## Function Compilation
147+
# Function Compilation
148148

149149
This strategy transforms your components into optimized PHP functions, bypassing the entire component rendering pipeline while maintaining identical behavior to standard Blade.
150150

@@ -164,7 +164,7 @@ The following benchmarks represent 25,000 components rendered in a loop:
164164

165165
> These numbers reflect rendering pipeline overhead. If your components execute expensive operations internally, that work will still affect performance when using this strategy.
166166
167-
### How It Works
167+
## How It Works
168168

169169
When you enable Blaze, components are compiled into direct function calls:
170170

@@ -200,7 +200,7 @@ Becomes:
200200
_c4f8e2a1(['type' => 'submit'], ['default' => 'Send']);
201201
```
202202

203-
## Runtime Memoization
203+
# Runtime Memoization
204204

205205
Runtime memoization caches component output during a single request. When a component renders with the same props multiple times, it only executes once. This strategy is ideal for components like icons and avatars that appear many times with identical values:
206206

@@ -223,11 +223,11 @@ Because there might be multiple tasks with the same status, we don't need to re-
223223
> [!NOTE]
224224
> Memoization only works for components without slots.
225225
226-
## Compile-Time Folding
226+
# Compile-Time Folding
227227

228228
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.
229229

230-
### Benchmark Results
230+
## Benchmark Results
231231

232232
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:
233233

@@ -453,7 +453,7 @@ For more precision, target specific attributes:
453453

454454
Now `<x-alert :variant="$type">` aborts folding, but `<x-alert :class="$classes">` still folds.
455455

456-
### Global State
456+
## Global State
457457

458458
Folded components are rendered at compile-time. Any global state is captured at compilation, not runtime:
459459

@@ -480,7 +480,7 @@ If a logged-in user triggers compilation, the "Welcome" message gets permanently
480480
| Time | `now()`, `Carbon::now()` |
481481
| Security | `@csrf` |
482482

483-
### The Unblaze Directive
483+
## The Unblaze Directive
484484

485485
When a component is mostly foldable but needs a dynamic section, use `@unblaze` to exclude that section:
486486

@@ -505,7 +505,7 @@ The label and input are folded. Error handling remains dynamic.
505505

506506
Variables from the component scope must be passed explicitly using the `scope` parameter.
507507

508-
## Reference
508+
# Reference
509509

510510
### Directive Parameters
511511

0 commit comments

Comments
 (0)