Skip to content

Commit ca9e952

Browse files
committed
wip
1 parent cfbf206 commit ca9e952

File tree

1 file changed

+4
-27
lines changed

1 file changed

+4
-27
lines changed

README.md

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ Blaze will automatically optimize it during compilation, pre-rendering the stati
5959

6060
- [When to use @pure](#when-to-use-pure)
6161
- [Performance expectations](#performance-expectations)
62-
- [Error detection](#error-detection)
6362
- [Debugging](#debugging)
64-
- [Performance benchmarks](#performance)
6563
- [AI assistant integration](#ai-assistant-integration)
6664

6765
## When to use @pure
@@ -86,11 +84,11 @@ Ask yourself these questions about your component:
8684
Think of `@pure` components as **"design system" components** - they're the building blocks that:
8785
- Look the same for everyone
8886
- Only change based on props you explicitly pass
89-
- Could be shown in a component library or Storybook without any application context
87+
- Could be shown in a component library without any application context
9088

9189
Examples: buttons, cards, badges, icons, layout grids, typography components
9290

93-
**Not** pure: anything that's "smart" or "connected" - forms (CSRF), navigation (active states), user avatars (auth), timestamps (time), paginated tables (request state).
91+
**Not pure** : anything that's "smart" or "connected" - forms (CSRF), navigation (active states), user avatars (auth), timestamps (time), paginated tables (request state).
9492

9593
**For developers familiar with functional programming**: Think of `@pure` components like pure functions - they always produce the same output for the same input, with no side effects or dependencies on external state.
9694

@@ -262,18 +260,15 @@ While our benchmark shows up to 17x improvement for rendering thousands of compo
262260
- Dashboard grids with repeated cards
263261
- Any page with significant component repetition
264262

265-
### Error detection
266-
267-
When you add `@pure` to a component with runtime dependencies, Blaze will detect common unsafe patterns and show helpful error messages during compilation. This prevents broken components and guides you toward the correct implementation.
268-
269263
## Debugging
270264

271265
Blaze is designed to fail gracefully - when it encounters an error during component folding, it automatically falls back to normal Blade rendering. This ensures your application never breaks due to optimization attempts.
272266

273267
However, when debugging why a component isn't being optimized, you might want to see the actual error that's causing Blaze to skip folding:
274268

275269
```php
276-
// In a service provider or debug environment
270+
// In a service provider or debug environment...
271+
277272
app('blaze')->debug();
278273
```
279274

@@ -284,24 +279,6 @@ When debug mode is enabled:
284279
- Invalid prop types (e.g., passing a string to a date formatter expecting a Carbon instance)
285280
- Missing required props
286281

287-
## Performance
288-
289-
Blaze delivers significant performance improvements by eliminating the overhead of component rendering, prop parsing, and slot handling at runtime.
290-
291-
### Performance characteristics
292-
293-
- **Compilation overhead**: Minimal (~2-5ms per foldable component during first compile)
294-
- **Memory usage**: Reduced at runtime (pre-rendered HTML uses less memory than component objects)
295-
- **Cache efficiency**: Better template cache utilization due to fewer dynamic parts
296-
- **Scaling**: Performance gains increase with component usage frequency
297-
298-
### When you'll see the biggest impact
299-
300-
- **Component-heavy applications** with lots of reusable UI elements
301-
- **High-traffic sites** where every millisecond of render time matters
302-
- **Dashboard/admin interfaces** with many repeated components
303-
- **Design systems** with consistent, pure UI components
304-
305282
## AI assistant integration
306283

307284
This repository includes an [`AGENTS.md`](AGENTS.md) file specifically designed for AI assistants (like GitHub Copilot, Cursor, or Claude). If you're using an AI tool to help with your Laravel project:

0 commit comments

Comments
 (0)