You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**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).
94
92
95
93
**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.
96
94
@@ -262,18 +260,15 @@ While our benchmark shows up to 17x improvement for rendering thousands of compo
262
260
- Dashboard grids with repeated cards
263
261
- Any page with significant component repetition
264
262
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
-
269
263
## Debugging
270
264
271
265
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.
272
266
273
267
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:
274
268
275
269
```php
276
-
// In a service provider or debug environment
270
+
// In a service provider or debug environment...
271
+
277
272
app('blaze')->debug();
278
273
```
279
274
@@ -284,24 +279,6 @@ When debug mode is enabled:
284
279
- Invalid prop types (e.g., passing a string to a date formatter expecting a Carbon instance)
285
280
- Missing required props
286
281
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
-
305
282
## AI assistant integration
306
283
307
284
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