Commit Graph

6 Commits

Author SHA1 Message Date
27c4898706 follow PugJs 2026-01-24 23:53:19 +05:30
654b45ee10 Compiled temapltes.
Benchmark cleanup
2026-01-22 11:10:47 +05:30
0bccce8bf9 Add configurable max_file_size option
- Default 5 MB for template files
- Configurable via ViewEngine.init options
2026-01-18 00:05:16 +05:30
458de03c02 Add README and simplify ViewEngine API
- ViewEngine.init() no longer requires allocator
- render() and renderTpl() accept allocator parameter
- Remove deinit() - no resources to clean up
- Remove unused parse/renderDoc methods
- Add memory management guidance to runtime.zig
- Clean up unused imports and options
2026-01-18 00:05:16 +05:30
1fff91d7d9 Add string concatenation in attributes, lazy mixin loading, and benchmarks
Features:
- Fix string concatenation in attribute values (e.g., class="btn btn-" + type)
- Lexer now properly captures full expressions with operators
- Runtime evaluates expressions for class attributes

ViewEngine improvements:
- Change mixin loading from eager to lazy (on-demand)
- Mixins are now loaded from mixins directory only when first called
- Template-defined mixins take precedence over directory mixins

Benchmarks:
- Add src/benchmark.zig with three template complexity levels
- Simple: ~150k renders/sec, 6KB memory
- Medium: ~70k renders/sec, 45KB memory
- Complex: ~32k renders/sec, 94KB memory
- Memory leak detection confirms no leaks

Documentation:
- Update CLAUDE.md with lazy mixin loading details
- Document mixin resolution order
2026-01-18 00:05:16 +05:30
4538b17f0a Add ViewEngine for easy server integration
- ViewEngine manages views directory with path resolution
- Auto-loads mixins from views/mixins/ directory
- Simplifies template paths (relative to views dir, auto-adds extension)
- Updated example app to use ViewEngine
- Added example mixins (buttons.pug, cards.pug)
- Updated CLAUDE.md with ViewEngine documentation
2026-01-18 00:05:16 +05:30