FW Frontend Philosophy: API-First, Agent-Driven
FW is fundamentally an API-first framework. However, the modern web requires more than just JSON. To support SEO, high-performance initial loads, and AI agents that need to "see" and "render" UI, FW provides a Compiled View Engine.
The "Compiled Shell" Approach
Traditional PHP frameworks (Laravel, Symfony) use runtime template engines (Blade, Twig, Smarty). These engines perform filesystem lookups, parsing, and compilation on every request (or use a runtime cache).
FW differs by moving all view logic to the build step.
- Zero Runtime Filesystem Lookups: All views are compiled into static-like PHP string buffers or lightweight objects during the
php fw buildprocess. - Sub-Millisecond Rendering: Because the HTML is already "mostly rendered" at build time, FW can serve a full HTML shell as fast as a JSON response.
- No Dynamic Logic in Templates: We discourage complex logic in views. Views are "Shells." Dynamic data should be hydrated via the API or passed as simple variables.
AI-First UI Generation
Autonomous agents excel at structural generation. By using declarative YAML, an agent can:
- Define a new UI component shell.
- Link it to an API endpoint.
- Generate the necessary DTOs and Handlers.
FW serves as the "Nervous System" that translates agent-generated concepts into high-performance web reality.
Comparison: FW vs traditional Monoliths
| Feature | FW (API-First + Shells) | Traditional Monolith (Blade/Twig) |
|---|---|---|
| Parsing | Done once at Build Time | Done at Runtime (with caching) |
| Logic | Decoupled (Handlers/DTOs) | Often mixed in Templates |
| SEO | Fast Static Shells | SSR (can be slow) |
| Agent Control | High (YAML-driven) | Low (Template-logic driven) |
| Latency | < 1ms | 10ms - 100ms |
Flash: "The frontend of the future belongs to the agents. We give them the fastest tools to build it."