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
Copy file name to clipboardExpand all lines: docs/product/requirements.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ language references, compiler docs, and examples.
26
26
27
27
| ID | Requirement | Priority | Status | Notes |
28
28
| --- | --- | --- | --- | --- |
29
-
| PRD-001 | Compile portable package-peer `.gwdk` files that declare `package`, optional `page`, `route`, `guard`, `layout`, blocks, and endpoints. | High | Partial | Discovery, package parsing, metadata parsing, parser syntax validation, filename-derived page IDs, default build discovery, route shape/conflict validation, required page-view and page-guard validation, explicit component-file build input, typed GOWDK AST, AST analyzer, versioned compiler IR, endpoint comment discovery, and endpoint conflict diagnosticsare implemented; full downstream migration to the IR remains planned. |
29
+
| PRD-001 | Compile portable package-peer `.gwdk` files that declare `package`, optional `page`, `route`, `guard`, `layout`, blocks, and endpoints. | High | Partial | Discovery, package parsing, metadata parsing, parser syntax validation, filename-derived page IDs, default build discovery, route shape/conflict validation, required page-view and page-guard validation, explicit component-file build input, typed GOWDK AST, AST analyzer, versioned compiler IR, endpoint comment discovery, endpoint conflict diagnostics, and mandatory typed `view {}` IR nodes for supported view bodies are implemented; full downstream migration to typed IR for every semantic block remains planned. |
30
30
| PRD-002 | Default render mode must be `spa`. | High | Implemented | Root `RenderConfig.DefaultMode()` defaults to `gowdk.SPA`. |
31
31
| PRD-003 | Support render modes `spa`, `hybrid`, and `ssr`. | High | Implemented | Root `RenderMode` constants exist. Actions are endpoint capability, not a render mode. |
32
32
| PRD-004 | Reject request-time page behavior unless the SSR feature is enabled in config or CLI options. | High | Implemented |`internal/compiler.ValidatePage` emits `missing_ssr_addon`. |
@@ -45,7 +45,7 @@ language references, compiler docs, and examples.
45
45
| PRD-017 | Define cache and revalidation behavior for static files, SPA routes, backend endpoints, partial responses, SSR routes, and hybrid pages. | Medium | Implemented | Generated binaries apply asset-manifest cache policies for generated assets, default SPA HTML to `no-cache`, default request-time handlers to `no-store`, and apply explicit page `cache` policies to successful generated static SPA, SSR, and hybrid HTML responses. `revalidate` accepts positive second or duration values, requires `cache`, and compiles into a `stale-while-revalidate=<seconds>` Cache-Control directive for successful generated static SPA, SSR, and hybrid HTML. Safety responses for actions, APIs, fragments, guard failures, load redirects, generated errors, and CSRF-mutated HTML remain no-store. |
46
46
| PRD-018 | Escape generated HTML by default and require any raw HTML escape hatch to be explicit. | High | Implemented | Rendering escapes text and attributes by default. `g:unsafe-html={Expr}` is the single explicit raw HTML escape hatch: attributes stay escaped, markup children are rejected, and it is refused on void elements, in stateful/island/loop contexts, and for route-param-tainted values. Foreign raw HTML syntax such as `{@html}` fails loudly and points at `g:unsafe-html`. URL-bearing attributes reject active-content schemes, protocol-relative URLs, and control characters; raw `on*` handlers, `srcdoc`, and literal `<script>` tags are rejected in `view {}`. See `docs/language/markup.md`. |
47
47
| PRD-019 | Provide optional rate limiting for request-time handlers without making it core. | Medium | Implemented |`FeatureRateLimit` and `addons/ratelimit` enable generated rate-limit hooks; `runtime/ratelimit` exposes HTTP middleware, fixed-window decisions, an in-memory store, and a Redis-backed store adapter. Generated action, API, fragment, SSR, and split-backend proxy handlers expose `RegisterRateLimiter(*ratelimit.Limiter)` when the addon is enabled and call the registered limiter before guards and user logic. Docs include an in-memory registration example and a concrete go-redis adapter. |
48
-
| PRD-020 | Allow generated apps and binaries to package selected configured modules. | High | Implemented |`Build.Targets` statically declares module sets, output dirs, generated app dirs, and binaries. `gowdk build` runs all configured targets, `--target` selects named targets, and ad hoc repeated or comma-separated `--module` flags remain supported. |
48
+
| PRD-020 | Allow generated apps and binaries to package selected configured modules. | High | Implemented |`Build.Targets` statically declares module sets, output dirs, generated app dirs, and binaries. `gowdk build` runs all configured targets, `--target` selects named targets, and ad hoc repeated or comma-separated `--module` flags remain supported. Generated frontend/backend apps under `.gowdk/` build as packages inside the application module, while explicit legacy app dirs and worker/cron role apps keep nested generated modules. |
49
49
| PRD-021 | Provide a dependency-free fast local development loop. | High | Implemented |`gowdk dev` polls discovered inputs without production dependencies, compares content hashes, caches watched input snapshots between ticks, rebuilds only on real input changes, incrementally renders page/component/layout affected SPA output when possible, falls back to full builds for config/CSS/source-set/app/binary/WASM changes, serves the generated output, live reloads browsers after successful rebuilds, keeps the last successful output after failed rebuilds, and can build/restart generated app targets. SPA/app generation skips identical file writes. |
50
50
| PRD-022 | Allow generated app output to compile to a WASM deploy artifact. | Medium | Partial |`gowdk build --wasm <file>` and `Build.Targets[].WASM` compile the generated app with `GOOS=js GOARCH=wasm`. CI verifies the emitted artifact is a real WASM module by checking the WebAssembly magic header. This remains separate from component-level browser island assets emitted for `wasm` components; host runtime/loader integration is deploy-platform owned. |
51
51
| PRD-023 | Keep current documentation aligned with implemented CLI, config, compiler, language, routing, deployment, and examples. | High | Implemented |`README.md`, `docs/getting-started.md`, `docs/cookbook/README.md`, reference docs, language docs, compiler docs, and `examples/README.md` describe current support, link to the right source of truth, and call out planned behavior. |
@@ -74,7 +74,7 @@ implemented.
74
74
| Hybrid | Keep hybrid request-time page behavior explicit through config-selected effective render mode and the integrated SSR-gated request-time lane; keep streaming, browser-owned server-data refresh, non-HTTP revalidation, and implicit action invalidation unsupported until a future source contract exists. | Implemented for the current bounded contract — see [Hybrid Lifecycle Contract](hybrid-lifecycle-spec.md). |
75
75
| Hooks | Compose app-wide hooks as `net/http` middleware plus explicit generated registration points and generated-binary lifecycle services; defer route rewriting and fetch interception. | Partial — generated embedded and backend-only apps expose `RegisterMiddleware(runtime/app.Middleware)` for ordered app-wide middleware, `gowdkapp.App()` for generated-binary startup, and `runtime/app.Service` lifecycle hooks for app-owned workers or extra servers. Route rewriting, response transformation, fetch/navigation interception, and protocol-specific built-ins such as MCP remain out of core. |
76
76
| Errors | Keep `error` for route-local SSR and action/API boundaries; define expected error types and layout boundaries without leaking internals. | Partial — typed expected errors map to 404, 403, 422, and 500 for generated boundaries, SSR load errors honor `response.HandlerStatus` instead of forcing 500, and layout-level `error` pages compose with SSR route boundaries for HTTP 500 handling. Templated error regions and component/fragment-specific boundaries remain planned. |
77
-
| Dev server | Keep dependency-free live reload as baseline; add browser error overlay before component-aware HMR. | Partial — `gowdk dev` polls without production dependencies, skips no-op rebuilds, supports incremental SPA rebuilds, runs generated app targets, prints stable change/rebuild/runtime-proxy log lines, shows browser overlays for SPA/static serving, generated-app rebuild failures, and generic generated-app runtime 5xx failures through a dev-only proxy bridge, skips live-reload/initial-overlay injection for proxied HTML over the documented dev-only size limit without full buffering, sends successful rebuilds through versioned `dev-update` v1 payloads, route-scopes layout-only reloads to affected pages, and hot-swaps changed JS island component roots when the dependency graph maps the change to the current page. Page/source-set/runtime changes, unmatched component roots, WASM islands, unsupported dev-update protocol versions, and broader state-preserving HMR fall back to full reload or remain deferred to [#424](https://github.com/cssbruno/GoWDK/issues/424). |
77
+
| Dev server | Keep dependency-free live reload as baseline; add browser error overlay before component-aware HMR. | Partial — `gowdk dev` polls without production dependencies, skips no-op rebuilds, supports incremental SPA rebuilds, runs generated app targets, prints stable change/rebuild/runtime-proxy log lines, shows browser overlays for SPA/static serving, generated-app rebuild failures, and generic generated-app runtime 5xx failures through a dev-only proxy bridge, skips live-reload/initial-overlay injection for proxied HTML over the documented dev-only size limit without full buffering, sends successful rebuilds through versioned `dev-update` v1 payloads, route-scopes layout-only reloads to affected pages, hot-swaps changed JS island component roots when the dependency graph maps the change to the current page, and preserves island state only when deterministic state-shape markers match. Page/source-set/runtime changes, unmatched component roots, incompatible state shapes, WASM islands, unsupported dev-update protocol versions, and broader page/layout DOM patching fall back to full reload or remain deferred to [#424](https://github.com/cssbruno/GoWDK/issues/424). |
78
78
| Playground | Own playground onboarding in website/docs first with local preview commands and static examples; keep hosted code execution optional, sandboxed, and exportable as a normal GOWDK app. | Partial — [playground.md](playground.md) defines the onboarding path, sandbox rules, export contract, and non-goals. `gowdk playground policy/export/run` implements local policy inspection, normal source archive export, and an opt-in staged build bridge for future hosted runners; production hosted execution remains app-owned infrastructure. |
79
79
| Routing | Add rest params and trailing-slash policy first while keeping explicit route declarations; defer optional params, route groups, and same-path page/API negotiation. | Partial — rest params `{name...}` are supported as the final segment of SSR page routes (string-only, one or more segments joined with `/`) with duplicate/ambiguity validation, and the trailing-slash policy is explicit (canonical declarations; GET/HEAD trailing-slash requests 308-redirect to the canonical path). Optional params, route groups, and same-path negotiation remain deferred with explicit diagnostics; see `docs/reference/routing.md`. |
80
80
| Typed generated APIs | Generate typed route-param accessors first; add typed SSR load data before broader action result contracts. | Partial — generated SSR and fragment request-time handlers attach raw route params through `app.Params(ctx)` and decoded typed params through `app.TypedParams(ctx)`; SSR load handlers can return exported typed result structs whose declared `server {}` fields are compiler-checked and lowered into generated adapter glue. Per-route param structs and typed action-result accessors remain planned. |
0 commit comments