Problem
The public docs site server-actions page (docs/app/docs/server-actions/page.ts, served at https://docs.webjs.dev/docs/server-actions) documents only the original POST-only surface: the 'use server' two-marker convention, the import-rewrite/RPC stub, full-stack type safety, the wire format, CSRF, the route.ts / route() REST adapter, and validate (#245). It is MISSING the entire HTTP-verb action surface and its siblings that shipped later:
So the docs materially undersell server actions (they are more than Next's POST-only Server Actions), and a user reading only the site would not know GET caching, streaming, or cancellation exist.
Design / approach
Add a new section to the docs page covering the verb config exports and their semantics, with shorter subsections for streaming, cancellation, and SSR seeding. The framework AGENTS.md already has the authoritative prose for all of this (the "HTTP-verb actions via config exports (#488)" paragraph in the root AGENTS.md, plus packages/server/AGENTS.md actions.js / action-stream.js / action-seed.js module entries); mirror it into user-facing docs-site prose (do not just copy the agent docs verbatim, write it for a developer reading the site). Match the existing page's voice and structure (plain HTML in an html\...`template,
/
/
/
`).
Keep the GET-cache and invalidates SAFETY note prominent: public: true / a cached GET shares the response across users keyed by URL + args, so it is only for data identical for every visitor (the same rule as a page's export const revalidate).
Implementation notes (for the implementing agent)
- Where to edit:
docs/app/docs/server-actions/page.ts. Current <h2>/<h3> structure (for placement): "Defining a Server Action" (L10), "How the Import Rewrite Works" (L68), "Full-Stack Type Safety" (L107), "The Wire Format" (L140), "CSRF Protection" (L157), "REST Endpoints from Server Actions" (L166, with route() adapter L194 + Validating the Input L210 + CORS L246), "ActionResult Envelope" (L251), "Error Sanitisation" (L274), "Complete Example" (L282), "Plain HTML forms" (L367). A good home for the new section is AFTER "The Wire Format" / before "CSRF" (verbs + caching are core mechanics), or a dedicated "HTTP verbs, caching, and streaming" <h2> after the import-rewrite section.
- Source of truth to mirror (do NOT invent semantics): root
AGENTS.md section "HTTP-verb actions via config exports (#488)" and the "Streaming results (#489)" / "Cancellation (#492)" / SSR-seeding (#472) prose; packages/server/AGENTS.md actions.js, action-stream.js, action-seed.js, action-route.js module-map entries.
- The sidebar already lists the page (
docs/app/docs/layout.ts L44 { href: '/docs/server-actions', label: 'Server Actions' }), so no nav change is needed unless the section warrants its own page (it does not; keep it on the server-actions page).
- Landmines:
- Invariants to respect: docs-site pages are
.ts returning html\...` (not markdown). Keep light DOM + the page's existing Tailwind/section conventions (docs/AGENTS.md`).
- Tests + docs surfaces: docs pages have content tests under
test/docs/ (e.g. docs-pages-well-formed.test.js, llms.test.mjs); ensure the page still parses/renders (the in-repo docs app boot + the test/docs/* suite). No framework-code change, so no unit/e2e beyond the docs render. Also confirm /docs/server-actions/llms.txt (the per-page llms route) still generates.
Acceptance criteria
Problem
The public docs site server-actions page (
docs/app/docs/server-actions/page.ts, served at https://docs.webjs.dev/docs/server-actions) documents only the original POST-only surface: the'use server'two-marker convention, the import-rewrite/RPC stub, full-stack type safety, the wire format, CSRF, theroute.ts/route()REST adapter, andvalidate(#245). It is MISSING the entire HTTP-verb action surface and its siblings that shipped later:export const method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'(verb selector; absent = POST) (feat: HTTP-verb server actions via config exports (GET/POST/PUT/PATCH/DELETE) [epic] #488)export const cache = 60/{ maxAge, swr, public }for a GET, plusexport const tagsand a mutation'sexport const invalidates(GET response caching + tag invalidation) (feat: HTTP-verb server actions via config exports (GET/POST/PUT/PATCH/DELETE) [epic] #488)export const middleware = [...](per-action middleware,actionContext()) (feat: composable per-action middleware with typed context #490)ReadableStream/ async iterable / async generator, consumed withfor await(feat: streaming RPC results (return a ReadableStream/AsyncIterable from an action) #489)AbortSignalviaactionSignal(); superseded client renders abort the in-flight fetch (feat: AbortSignal cancellation for RPC, wired to async-render supersede #492)'use server'result invoked during SSR is serialized and the stub reads it on first client call instead of re-fetching on hydration (feat: seed SSR action results into hydration so async render does not re-fetch (follow-up to #469) #472).server.tswith more than one callable is awebjs checkerror)So the docs materially undersell server actions (they are more than Next's POST-only Server Actions), and a user reading only the site would not know GET caching, streaming, or cancellation exist.
Design / approach
Add a new section to the docs page covering the verb config exports and their semantics, with shorter subsections for streaming, cancellation, and SSR seeding. The framework
AGENTS.mdalready has the authoritative prose for all of this (the "HTTP-verb actions via config exports (#488)" paragraph in the rootAGENTS.md, pluspackages/server/AGENTS.mdactions.js/action-stream.js/action-seed.jsmodule entries); mirror it into user-facing docs-site prose (do not just copy the agent docs verbatim, write it for a developer reading the site). Match the existing page's voice and structure (plain HTML in anhtml\...`template,///docs/app/docs/server-actions/page.ts. Current<h2>/<h3>structure (for placement): "Defining a Server Action" (L10), "How the Import Rewrite Works" (L68), "Full-Stack Type Safety" (L107), "The Wire Format" (L140), "CSRF Protection" (L157), "REST Endpoints from Server Actions" (L166, withroute()adapter L194 + Validating the Input L210 + CORS L246), "ActionResult Envelope" (L251), "Error Sanitisation" (L274), "Complete Example" (L282), "Plain HTML forms" (L367). A good home for the new section is AFTER "The Wire Format" / before "CSRF" (verbs + caching are core mechanics), or a dedicated "HTTP verbs, caching, and streaming"<h2>after the import-rewrite section.AGENTS.mdsection "HTTP-verb actions via config exports (#488)" and the "Streaming results (#489)" / "Cancellation (#492)" / SSR-seeding (#472) prose;packages/server/AGENTS.mdactions.js,action-stream.js,action-seed.js,action-route.jsmodule-map entries.docs/app/docs/layout.tsL44{ href: '/docs/server-actions', label: 'Server Actions' }), so no nav change is needed unless the section warrants its own page (it does not; keep it on the server-actions page).html\...`template body (the page is one bightml``); escape or avoid backticks in code samples (the page already uses.claude/hooks/block-prose-punctuation.shhook blocks new content with these.?a=) with a POST fallback over a 4KB cap, is CSRF-exempt, carriesCache-Control+ a weak ETag (304 onIf-None-Match) andX-Webjs-Tags, and reads the SSR seed first; a mutation sends the rich body (DELETE rides the URL), is CSRF-protected, and emitsX-Webjs-Invalidate. A mismatched request method is a 405 +Allow.X-Webjs-Invalidate..tsreturninghtml\...`(not markdown). Keep light DOM + the page's existing Tailwind/section conventions (docs/AGENTS.md`).test/docs/(e.g.docs-pages-well-formed.test.js,llms.test.mjs); ensure the page still parses/renders (the in-repo docs app boot + thetest/docs/*suite). No framework-code change, so no unit/e2e beyond the docs render. Also confirm/docs/server-actions/llms.txt(the per-page llms route) still generates.Acceptance criteria
export const methodand the GET vs mutation transport differences.export const cache/tags/invalidateswith the shared-cache SAFETY note forpublic/cached GETs.export const middleware(#490), streaming results (#489), cancellation viaactionSignal()(#492), and SSR action-result seeding (#472), at least briefly with a code sample for streaming.test/docs/*suite passes.AGENTS.mdso the docs and the agent docs agree (no contradictions).