CONCEPTS FEATURE
Region Contract
A region is a resource with a pipeline, not a partial with lucky context. Each region has its own handler flow, render context and asset collection.
Connecting to the server stream…
Region Contract
Navigation, sidebars, widgets and footers are usually "just includes" — partials handed whatever context happens to be in scope at the call site. That ambient context is a hidden data dependency: it works until someone renders the partial from a page that didn't prepare the right variables, and then it breaks in a way nobody can trace.
Semitexa promotes every region to a first-class slot resource. Declared with #[AsSlotResource], a region has its own resolve pipeline, its own render context, and its own asset collection — rendered through the same Twig as the page, but never depending on the page's ambient variables.
Why a region needs a contract
When regions are real resources, the page composes from independent, inspectable units instead of a web of include-and-pray partials. You can always tell where a region's data comes from and how it refreshes, because it is declared.
It is also the precondition for the next two pillars: only a region with its own pipeline can be deferred (Late HTML) or re-rendered on its own (Live HTML) without dragging the whole page with it. The deferred region in the live demo above is exactly such a resource.
How it works
A region is declared with #[AsSlotResource]: its own resolve pipeline, its own render context, and its own asset collection, rendered through the same Twig as the page. You can always tell where a region's data comes from and how it refreshes, because it is declared — not improvised from ambient template variables. The deferred region below is exactly such a resource.
Why it matters
When regions are real resources, the page composes from independent, inspectable units instead of a web of include-and-pray partials. It is the precondition for Late HTML and Live HTML: only a region with its own pipeline can be deferred or re-rendered on its own, without dragging the whole page with it.