Skip to content

Commit ad12336

Browse files
committed
docs: server function validation api reference
1 parent a345961 commit ad12336

3 files changed

Lines changed: 33 additions & 18 deletions

File tree

docs/src/lib/api-reference.mjs

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,21 @@ const pages = [
148148
description:
149149
"Partial pre-rendering controls: `usePrerender` to mark a component for build-time rendering, and the `withPrerender` HOC wrapper.",
150150
},
151+
{
152+
slug: "function",
153+
title: "Function",
154+
importPath: "@lazarv/react-server/function",
155+
dts: "server/function.d.ts",
156+
order: 9,
157+
description:
158+
'Server-function validation: `createFunction` wraps a `"use server"` handler with a per-arg parse/validate spec, plus the wire-aware helpers (`formData`, `file`, `blob`, `arrayBuffer`, `typedArray`, `map`, `set`, `stream`, `asyncIterable`, `iterable`, `promise`) for the rest of the Flight protocol surface.',
159+
},
151160
{
152161
slug: "memory-cache",
153162
title: "Memory Cache",
154163
importPath: "@lazarv/react-server/memory-cache",
155164
dts: ["cache/index.d.ts", "cache/client.d.ts"],
156-
order: 9,
165+
order: 10,
157166
description:
158167
"Default in-memory cache provider. Exposes `useCache`, `invalidate`, and the client-side helpers used when the runtime's built-in cache is active.",
159168
},
@@ -162,7 +171,7 @@ const pages = [
162171
title: "Storage Cache",
163172
importPath: "@lazarv/react-server/storage-cache",
164173
dts: "cache/storage-cache.d.ts",
165-
order: 10,
174+
order: 11,
166175
description:
167176
"Durable cache backend built on [unstorage](https://unstorage.unjs.io/). Supports any unstorage driver — Redis, Cloudflare KV, Upstash, filesystem, etc.",
168177
},
@@ -171,7 +180,7 @@ const pages = [
171180
title: "RSC",
172181
importPath: "@lazarv/react-server/rsc",
173182
dts: "cache/rsc.d.ts",
174-
order: 11,
183+
order: 12,
175184
description:
176185
"Low-level RSC serialization helpers — serialize and deserialize React server component payloads directly. Most apps should not need these.",
177186
},
@@ -180,7 +189,7 @@ const pages = [
180189
title: "Worker",
181190
importPath: "@lazarv/react-server/worker",
182191
dts: "worker/index.d.ts",
183-
order: 12,
192+
order: 13,
184193
description:
185194
'Helpers for modules marked with the `"use worker"` directive. On the server runs in a Node Worker Thread; on the client runs in a Web Worker.',
186195
},
@@ -189,7 +198,7 @@ const pages = [
189198
title: "MCP",
190199
importPath: "@lazarv/react-server/mcp",
191200
dts: "server/mcp.d.ts",
192-
order: 13,
201+
order: 14,
193202
description:
194203
"Model Context Protocol primitives. Build typed tools, resources, and prompts, then expose them through an MCP server route handler.",
195204
},
@@ -198,7 +207,7 @@ const pages = [
198207
title: "HTTP",
199208
importPath: "@lazarv/react-server/http",
200209
dts: "lib/http/index.d.ts",
201-
order: 14,
210+
order: 15,
202211
description:
203212
"Low-level HTTP context types shared across middleware, route handlers, and server functions.",
204213
},
@@ -207,7 +216,7 @@ const pages = [
207216
title: "Config",
208217
importPath: "@lazarv/react-server/config",
209218
dts: ["config/index.d.ts", "config/schema.d.ts"],
210-
order: 15,
219+
order: 16,
211220
description:
212221
"Configuration schema and helpers. Import `ReactServerConfig` for typed `react-server.config.mjs` files and `generateJsonSchema` to emit the JSON Schema consumed by editors.",
213222
},
@@ -216,7 +225,7 @@ const pages = [
216225
title: "Adapters",
217226
importPath: "@lazarv/react-server/adapters/*",
218227
dts: ["adapters/core.d.ts", "adapters/adapter.d.ts"],
219-
order: 16,
228+
order: 17,
220229
description:
221230
"Shared types and helpers for building deploy adapters. The same surface is re-exported from every `@lazarv/react-server/adapters/<target>` subpath — each concrete adapter is a thin wrapper around `createAdapter`.",
222231
},
@@ -225,7 +234,7 @@ const pages = [
225234
title: "Node",
226235
importPath: "@lazarv/react-server/node",
227236
dts: "lib/start/node.d.ts",
228-
order: 17,
237+
order: 18,
229238
description:
230239
"Mount the runtime inside an existing Node.js HTTP server (Express, Fastify, NestJS, raw `http`). Used in middleware mode and custom server setups.",
231240
},
@@ -234,7 +243,7 @@ const pages = [
234243
title: "Dev",
235244
importPath: "@lazarv/react-server/dev",
236245
dts: "lib/dev/index.d.ts",
237-
order: 18,
246+
order: 19,
238247
description:
239248
"Programmatic entry point to the development server. Equivalent to invoking the `react-server` CLI without arguments.",
240249
},
@@ -243,7 +252,7 @@ const pages = [
243252
title: "Build",
244253
importPath: "@lazarv/react-server/build",
245254
dts: "lib/build/index.d.ts",
246-
order: 19,
255+
order: 20,
247256
description:
248257
"Programmatic build entry point. Equivalent to the `react-server build` CLI command — useful for custom build pipelines.",
249258
},
@@ -252,7 +261,7 @@ const pages = [
252261
title: "DevTools",
253262
importPath: "@lazarv/react-server/devtools",
254263
dts: "devtools/index.d.ts",
255-
order: 20,
264+
order: 21,
256265
description:
257266
"Configuration surface for the in-browser DevTools panel. Opt the panel in and out per environment and tune what it tracks.",
258267
},
@@ -261,19 +270,19 @@ const pages = [
261270
title: "Telemetry",
262271
importPath: "@lazarv/react-server/telemetry",
263272
dts: "telemetry/index.d.ts",
264-
order: 21,
273+
order: 22,
265274
description:
266275
"OpenTelemetry integration. Safe no-op when OpenTelemetry packages are not installed — import `getTracer`, `getMeter`, `withSpan`, and friends directly without guarding.",
267276
},
268277
];
269278

270279
const landingSections = [
271280
{ label: "Runtime", from: 1, to: 4 },
272-
{ label: "Data, rendering, resiliency", from: 5, to: 8 },
273-
{ label: "Caching", from: 9, to: 11 },
274-
{ label: "Advanced", from: 12, to: 14 },
275-
{ label: "Config, build, deploy", from: 15, to: 19 },
276-
{ label: "Observability & tooling", from: 20, to: 99 },
281+
{ label: "Data, rendering, resiliency", from: 5, to: 9 },
282+
{ label: "Caching", from: 10, to: 12 },
283+
{ label: "Advanced", from: 13, to: 15 },
284+
{ label: "Config, build, deploy", from: 16, to: 20 },
285+
{ label: "Observability & tooling", from: 21, to: 99 },
277286
];
278287

279288
// ─────────────────────────────────────────────────────────────────────────────

docs/src/pages/en/api.(index).mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ Within each page, symbols are sorted alphabetically inside their group (Function
4545

4646
<dt>[Prerender](/api/prerender) &nbsp;·&nbsp; `@lazarv/react-server/prerender`</dt>
4747
<dd>Partial pre-rendering controls: `usePrerender` to mark a component for build-time rendering and the `withPrerender` HOC.</dd>
48+
49+
<dt>[Function](/api/function) &nbsp;·&nbsp; `@lazarv/react-server/function`</dt>
50+
<dd>Server-function validation: `createFunction` for per-arg parse/validate, with wire-aware helpers (`formData`, `file`, `blob`, `arrayBuffer`, `typedArray`, `map`, `set`, `stream`, `asyncIterable`, `iterable`, `promise`) covering the full Flight protocol surface.</dd>
4851
</dl>
4952

5053
## Caching

docs/src/pages/ja/api.(index).mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ Within each page, symbols are sorted alphabetically inside their group (Function
4545

4646
<dt>[Prerender](/api/prerender) &nbsp;·&nbsp; `@lazarv/react-server/prerender`</dt>
4747
<dd>Partial pre-rendering controls: `usePrerender` to mark a component for build-time rendering and the `withPrerender` HOC.</dd>
48+
49+
<dt>[Function](/api/function) &nbsp;·&nbsp; `@lazarv/react-server/function`</dt>
50+
<dd>Server-function validation: `createFunction` for per-arg parse/validate, with wire-aware helpers (`formData`, `file`, `blob`, `arrayBuffer`, `typedArray`, `map`, `set`, `stream`, `asyncIterable`, `iterable`, `promise`) covering the full Flight protocol surface.</dd>
4851
</dl>
4952

5053
## Caching

0 commit comments

Comments
 (0)