GOWDK has separate build-time, request-time page, and endpoint data lanes. Generated JavaScript does not own page loading policy.
Lane Summary
| Construct | Runs | Owns | Current contract |
|---|---|---|---|
paths {} | build time | concrete dynamic SPA routes | Literal records only. Required for dynamic SPA pages unless the page uses request-time rendering. |
build {} | build time | static page data | Literal records plus imported or same-package no-argument Go functions. |
load {} | request time | SSR page data | One same-package Load<PageID> function returns map[string]any data. |
act | request time | POST/action endpoint behavior | Same-package Go handler returns runtime/response.Response. |
api | request time | API endpoint behavior | Same-package Go handler returns runtime/response.Response. |
fragment | request time | partial endpoint behavior | Same-package Go hook or static generated fragment body. |
Current Rules
build {}data is rendered into generated static output. It must not depend on the incoming HTTP request.load {}selects request-time SSR and requires the SSR addon.- Generated SSR calls one same-package function named
Load<PageID>. - Supported load signatures are:
func LoadDashboard(ssr.LoadContext) map[string]any
func LoadDashboard(ssr.LoadContext) (map[string]any, error)
- One
load {}block can declare multiple fields. They come from the single returned map, including dotted paths such asuser.name. - Layouts do not have independent
load {}data yet. Request-time layout data composition is planned. - Load redirects use
ssr.RedirectTo("/path")orssr.Redirect("/path", status). Redirect targets must be local absolute paths. - Not-found, forbidden, validation, and typed expected-error helpers for load are planned. Today, guards handle guarded access and other load errors use the generated SSR error-page path.
- Generated load data is map-based today. Typed load data accessors are planned after the load result contract is stable.
Invalidation And Refresh
- Full POST actions and enhanced POST actions share the same user Go handler ownership. The handler response decides redirect, HTML, JSON, or fragment behavior.
- GOWDK does not automatically rerun
load {}after an action today. - Partial updates use explicit fragment responses or standalone fragment endpoints. Fragments own their request-time data through the fragment Go hook.
- Fragments do not declare compiler-tracked data dependencies today.
- Generated client navigation does not prefetch or reuse
load {}data today. Any future prefetch or reuse must be an explicit generated-client feature, not hidden browser-owned loading policy.
Boundaries
- User Go owns auth, business validation, storage, service calls, and response semantics.
- Generated Go owns adapter glue: decode, dispatch, context metadata, response writing, guards, CSRF checks, panic boundaries, and cache defaults.
- Generated JavaScript may enhance form submissions, fragments, islands, and static SPA navigation. It must not become the authority for routes, auth, validation, server data, action behavior, cache, or page loading policy.
- Actions do not invalidate
load {}data implicitly. Use redirects, fragments, JSON, orresponse.ReloadPage()to make the lifecycle visible in the action result.