@nifrajs/cli 5.10.0 → 5.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +10 -13
  4. package/dist/cli.js.map +1 -1
  5. package/dist/doctor.js +2 -2
  6. package/dist/doctor.js.map +1 -1
  7. package/dist/load.d.ts +2 -2
  8. package/dist/load.d.ts.map +1 -1
  9. package/dist/load.js +1 -1
  10. package/dist/load.js.map +1 -1
  11. package/dist/mcp-delegate.d.ts +17 -3
  12. package/dist/mcp-delegate.d.ts.map +1 -1
  13. package/dist/mcp-delegate.js +24 -9
  14. package/dist/mcp-delegate.js.map +1 -1
  15. package/dist/mcp-http.js +1 -1
  16. package/dist/mcp-relay.d.ts +37 -0
  17. package/dist/mcp-relay.d.ts.map +1 -0
  18. package/dist/mcp-relay.js +129 -0
  19. package/dist/mcp-relay.js.map +1 -0
  20. package/dist/mcp.d.ts.map +1 -1
  21. package/dist/mcp.js +55 -1
  22. package/dist/mcp.js.map +1 -1
  23. package/dist/migrate-layout.d.ts.map +1 -1
  24. package/dist/migrate-layout.js +45 -33
  25. package/dist/migrate-layout.js.map +1 -1
  26. package/dist/recipes/5.10.0.d.ts +3 -2
  27. package/dist/recipes/5.10.0.d.ts.map +1 -1
  28. package/dist/recipes/5.10.0.js +5 -4
  29. package/dist/recipes/5.10.0.js.map +1 -1
  30. package/dist/recipes/5.11.0.d.ts +10 -0
  31. package/dist/recipes/5.11.0.d.ts.map +1 -0
  32. package/dist/recipes/5.11.0.js +50 -0
  33. package/dist/recipes/5.11.0.js.map +1 -0
  34. package/dist/recipes/5.12.0.d.ts +9 -0
  35. package/dist/recipes/5.12.0.d.ts.map +1 -0
  36. package/dist/recipes/5.12.0.js +34 -0
  37. package/dist/recipes/5.12.0.js.map +1 -0
  38. package/dist/recipes/index.d.ts.map +1 -1
  39. package/dist/recipes/index.js +4 -0
  40. package/dist/recipes/index.js.map +1 -1
  41. package/dist/source-rewrites.d.ts +0 -5
  42. package/dist/source-rewrites.d.ts.map +1 -1
  43. package/dist/source-rewrites.js +232 -7
  44. package/dist/source-rewrites.js.map +1 -1
  45. package/dist/upgrade.d.ts +19 -1
  46. package/dist/upgrade.d.ts.map +1 -1
  47. package/dist/upgrade.js +55 -2
  48. package/dist/upgrade.js.map +1 -1
  49. package/docs/examples.json +38 -2
  50. package/docs/llms-full.txt +610 -221
  51. package/docs/types.json +362 -32
  52. package/package.json +11 -11
  53. package/src/cli.ts +10 -13
  54. package/src/doctor.ts +2 -2
  55. package/src/load.ts +6 -3
  56. package/src/mcp-delegate.ts +37 -11
  57. package/src/mcp-http.ts +1 -1
  58. package/src/mcp-relay.ts +155 -0
  59. package/src/mcp.ts +51 -1
  60. package/src/migrate-layout.ts +61 -29
  61. package/src/recipes/5.10.0.ts +5 -4
  62. package/src/recipes/5.11.0.ts +51 -0
  63. package/src/recipes/5.12.0.ts +35 -0
  64. package/src/recipes/index.ts +4 -0
  65. package/src/source-rewrites.ts +250 -8
  66. package/src/upgrade.ts +71 -3
@@ -295,13 +295,13 @@ to full-stack later without a rewrite.
295
295
  regex), but a real request also pays for middleware and validation,
296
296
  context, and serialization. In the current matrix Nifra runs **level with Elysia on Bun** -
297
297
  100% of Elysia on `GET /users/:id` and
298
- 102% on the validated `POST` - and
299
- **level with Fastify on Node** (102% of Fastify on GET,
300
- 99% on the validated `POST`), with Elysia, Hono,
301
- and Express behind. On **Deno** it runs at 98% of Elysia on
302
- GET and 118% on the validated `POST`. In the realistic shape (security headers + CORS +
303
- bearer auth + cookies + validated query/body + a ~2.4 KB JSON response, measured with
304
- `oha`) Nifra runs at **104% of Elysia on GET and 104% on POST**. Treat benchmark
298
+ 103% on the validated `POST` - and
299
+ **level with Fastify on Node** (108% of Fastify on GET,
300
+ 107% on the validated `POST`), with Elysia, Hono,
301
+ and Express behind. On **Deno** it runs at 107% of Elysia on
302
+ GET and 133% on the validated `POST`. In the realistic shape (security headers + CORS +
303
+ bearer auth + cookies + validated query/body + a ~2.4 KB JSON response, measured on
304
+ **Bun** with `oha`) Nifra runs at **109% of Elysia on GET and 113% on POST**. Treat benchmark
305
305
  rows as same-run evidence, not a permanent law of nature.
306
306
 
307
307
  -
@@ -472,8 +472,13 @@ the root one shows instead. A navigation that settles sooner (a prefetched link,
472
472
  loader) goes straight to the new page, as does one with no eligible
473
473
  `_loading`; a change of search on the same path and a form submit keep the
474
474
  page and report `pending`. The component receives `pending` and no
475
- `data`. It is a browser-only convention on every adapter - the first load of a
476
- URL is a server render, where `defer()` streams the slow part.
475
+ `data`. React's `NavLink` widens this to a per-link signal: its
476
+ `className`, `style` and `children` take functions over
477
+ `{ isActive, isPending }`, where `isPending` is
478
+ `true` while a navigation into that link's own target is in flight; the
479
+ other adapters expose the route-level `pending` described here only. It is a
480
+ browser-only convention on every adapter - the first load of a URL is a server render,
481
+ where `defer()` streams the slow part.
477
482
 
478
483
  -
479
484
  `_error.tsx` is the segment's **error boundary**. On the server - if a route's
@@ -976,6 +981,82 @@ The component renders the boundary itself: it reads `boundaries.<name>`
976
981
  from its props and calls the boundary's `render` with the data. Every
977
982
  adapter passes `boundaries` to the layouts and the page.
978
983
 
984
+ ### Independently navigable route slots
985
+
986
+ An intercepted route is useful for one modal over its owning page. A dashboard with several
987
+ panels that open, change route, and close independently uses route slots. The page declares
988
+ named slots and an allowlist of route patterns for each. A slot renders that target's full
989
+ layout and page chain in its own component tree; each slot has separate loading and error UI.
990
+
991
+ ```tsx
992
+ // routes/dashboard.tsx - name the only route identities this panel may display
993
+ import { href } from "@nifrajs/web"
994
+ import { RouteSlot, useRouteSlot } from "@nifrajs/web-react/router"
995
+
996
+ export const routeSlots = {
997
+ inspector: ["/users/:id"],
998
+ activity: ["/activity"],
999
+ } as const
1000
+
1001
+ export default function Dashboard() {
1002
+ const inspector = useRouteSlot("inspector")
1003
+ return (
1004
+ <>
1005
+ <button type="button" onClick={() => inspector.open(href({ to: "/users/:id", params: { id: "7" } }))}>
1006
+ Inspect user 7
1007
+ </button>
1008
+ <RouteSlot name="inspector" fallback={<p>Select a user.</p>} />
1009
+ <RouteSlot name="activity" fallback={<p>Activity is closed.</p>} />
1010
+ </>
1011
+ )
1012
+ }
1013
+
1014
+ // A shareable link can open more than one panel at once.
1015
+ const dashboard = href({
1016
+ to: "/dashboard",
1017
+ slots: {
1018
+ inspector: href({ to: "/users/:id", params: { id: "7" } }),
1019
+ activity: href({ to: "/activity" }),
1020
+ },
1021
+ })
1022
+ ```
1023
+
1024
+ -
1025
+ Generated route types constrain the slot name and target route passed to `href`.
1026
+ At runtime, the client checks slot-only navigation against the page's registration and
1027
+ route identity, and the server applies the same checks to direct requests. Malformed,
1028
+ duplicate, unknown, or oversized slot state is rejected before rendering; the server
1029
+ returns `400` for an invalid direct URL. The reserved flat query keys use the
1030
+ form `slot.<name>=<target>`, allow at most four targets, 1,024
1031
+ encoded characters per target, and 4,096 encoded characters total. They are removed before
1032
+ application search parsing, while unrelated query text stays intact.
1033
+
1034
+ -
1035
+ The server sends only the page shell. After hydration, each target loads through the normal
1036
+ same-origin route-data request, so its middleware, gates, and loader run with the current
1037
+ request's authorization. Target data is never embedded in the cached shell. Slot URLs
1038
+ are inputs, never authorization grants; keep sensitive values out because URLs can appear
1039
+ in `Referer` headers, logs, and analytics. Identity changes clear old data before
1040
+ reauthorization. Returning focus revalidates at most once per 30 seconds while keeping
1041
+ ready content visible, and navigation cancels stale work.
1042
+
1043
+ -
1044
+ Opening, changing, and closing a slot create history entries; Browser Back and Forward
1045
+ restore the previous slot URLs. Updating one slot retains sibling slots and the page's
1046
+ own loader data; changing slot state alone does not rerun that page loader. Up to four slot
1047
+ targets may be open at once, with bounded concurrent loading.
1048
+
1049
+ -
1050
+ Slot content is client-rendered in this first slice: server HTML contains the fallback,
1051
+ then hydration performs an authorized route-data fetch. This works well for overlays and
1052
+ modals; always-visible panels incur that post-hydration request.
1053
+
1054
+ -
1055
+ React, Preact, Solid, and Vue export `RouteSlot` and `useRouteSlot`
1056
+ from their `/router` entry. Svelte exports `useRouteSlot` from
1057
+ `@nifrajs/web-svelte/router` and the `RouteSlot` component from
1058
+ `@nifrajs/web-svelte/route-slot`.
1059
+
979
1060
  ### Guarding navigation
980
1061
 
981
1062
  A page with unsaved work shouldn't lose it to a stray click or the back button.
@@ -1323,6 +1404,24 @@ export const app = server()
1323
1404
  })
1324
1405
  ```
1325
1406
 
1407
+ ### Static bodyless responses
1408
+
1409
+ For a route whose response is always empty, use `staticResponse()` instead of
1410
+ creating a `Response` in a handler on every request. Pass fixed status and headers
1411
+ to the helper; caller-supplied `Content-Length` and `Transfer-Encoding`
1412
+ are rejected. On Bun, a plain literal-path GET or HEAD route can use Bun's static response
1413
+ table when no request policy, validation, response middleware, or app-wide
1414
+ `.responseHeaders(...)` defaults need to run. Null-body status codes use the
1415
+ regular handler path to preserve framing on Bun 1.3. Otherwise Nifra keeps the regular route
1416
+ pipeline. `app.fetch` and other runtimes also produce a fresh response per call.
1417
+
1418
+ ```ts
1419
+ import { server, staticResponse } from "@nifrajs/core/server"
1420
+
1421
+ export const app = server().get("/health", staticResponse())
1422
+ app.listen(3000)
1423
+ ```
1424
+
1326
1425
  Prefer `c.set` over returning a raw `Response`. A `Response`
1327
1426
  return makes the typed client infer `data: never`, so you silently lose drift
1328
1427
  detection for that route (`nifra check` flags it, NF-C007). `c.set`
@@ -4455,26 +4554,26 @@ left that lane. If a route looks like production, the contract costs nothing: de
4455
4554
 
4456
4555
  ### Bounded request bodies
4457
4556
 
4458
- Nifra caps the body of any **schema-validated** route at `maxBodyBytes` - an over-cap
4459
- `Content-Length` is rejected before buffering, and a chunked body is aborted mid-stream.
4460
- But a route that reads the body _directly_ (raw bodies, file uploads, your own validation)
4461
- bypasses that read path. `c.boundedBody(maxBytes?)` and
4462
- `c.boundedJson<T>(maxBytes?)` extend the **same** cap to those routes.
4557
+ Every HTTP route has a body limit, defaulting to `maxBodyBytes` (1,000,000 bytes).
4558
+ Nifra enforces it when the body is read, including direct `c.req`/`c.request` reads
4559
+ such as `json()`, `arrayBuffer()`, `text()`, and the raw stream. A route
4560
+ can explicitly opt out with `bodyLimit: "unlimited"`. Framework helpers, including
4561
+ `verifyWebhook` and `c.boundedBody(maxBytes?)`, read through their own bounded-reader
4562
+ paths. `verifyWebhook` defaults to 1 MiB, and an explicit `c.boundedBody(maxBytes)`
4563
+ value can exceed the route's `bodyLimit`. Set helper limits explicitly when the route-wide
4564
+ cap must apply to those reads. `c.boundedJson<T>(maxBytes?)` reads under that cap and parses JSON.
4463
4565
 
4464
4566
  ```ts
4465
4567
  import { server } from "@nifrajs/core/server"
4466
4568
 
4467
4569
  const app = server()
4468
4570
 
4469
- // A schema route is ALREADY bounded - the validated read enforces `maxBodyBytes`.
4470
- // But a raw-body / file / BYO-validation route reads the body directly, which
4471
- // `maxBodyBytes` does not cover. `c.boundedBody` caps that read:
4472
- app.post("/import", async (c) => {
4473
- const bytes = await c.boundedBody(5 * 1024 * 1024) // cap THIS route at 5 MiB
4474
- // Over-cap throws a flat 413; a malformed Content-Length a 400 - as control-flow
4475
- // Responses (caught by the lifecycle like `throw redirect()`), so a handler can't
4476
- // accidentally ignore the cap. The over-cap length is rejected BEFORE buffering;
4477
- // a chunked / length-less body is aborted mid-stream once it crosses the cap.
4571
+ // Every route is bounded, including raw-body / file / BYO-validation routes that
4572
+ // read c.req directly. Raise the route cap when this endpoint needs more than the default:
4573
+ app.post("/import", { bodyLimit: 5 * 1024 * 1024 }, async (c) => {
4574
+ const bytes = await c.req.arrayBuffer() // the direct read is capped at 5 MiB
4575
+ // An over-cap Content-Length is rejected BEFORE buffering; chunked bodies are
4576
+ // aborted mid-stream. Both answer a flat 413 through the request lifecycle.
4478
4577
  return { received: bytes.byteLength } // a returned object is serialized as JSON 200
4479
4578
  })
4480
4579
 
@@ -4485,10 +4584,10 @@ app.post("/rpc", async (c) => {
4485
4584
  })
4486
4585
  ```
4487
4586
 
4488
- Over-cap throws a flat `413`, a malformed `Content-Length` a `400`,
4489
- bad JSON a `400` - thrown as control-flow `Response`s the lifecycle catches,
4490
- so the cap can't be silently skipped. Pass a larger `maxBytes` for an upload route, a
4491
- smaller one to tighten an endpoint.
4587
+ An over-cap read is rejected with a flat `413`; a malformed
4588
+ `Content-Length` gets a `400`. `c.boundedJson` also returns
4589
+ `400` for malformed or rejected JSON. Set a larger finite route
4590
+ `bodyLimit` for an upload, or a smaller `maxBytes` to tighten an individual read.
4492
4591
 
4493
4592
  The cap is enforced on the bytes actually **delivered**, never on the number the caller wrote in
4494
4593
  `Content-Length`. That distinction is the whole defense: an adapter that rebuilds a
@@ -4511,12 +4610,16 @@ through the streaming guard.
4511
4610
 
4512
4611
  ### Prototype-poisoning defense
4513
4612
 
4514
- Every JSON body nifra parses - the schema-validated route and `c.boundedJson`
4515
- alike - is screened for the prototype-pollution shape: an own `__proto__` key, or
4516
- a `constructor` whose value carries a `prototype`. `JSON.parse`
4613
+ The schema body reader and `c.boundedJson` screen parsed JSON for the prototype-pollution
4614
+ shape: an own `__proto__` key, or a `constructor` whose value carries a
4615
+ `prototype`. `JSON.parse`
4517
4616
  creates these as ordinary data properties, and the damage lands later, when innocent code does
4518
4617
  `{ ...body }`, `Object.assign(target, body)`, or a deep merge and
4519
- walks that key onto a real prototype. The screen is on by default.
4618
+ walks that key onto a real prototype. This screen is on by default for those guarded readers.
4619
+
4620
+ Direct `c.req.json()` reads are still subject to the body-size cap, but do not apply the
4621
+ `protoPoisoning` policy. Treat their parsed object keys as untrusted before merging; use
4622
+ `c.boundedJson` when you want Nifra to apply that policy.
4520
4623
 
4521
4624
  ```ts
4522
4625
  import { server } from "@nifrajs/core/server"
@@ -4766,31 +4869,36 @@ size cap and sniffs the **real** type from magic bytes - never the client-set
4766
4869
  // doc-check: skip - fragment: `app`, `save`, `id`, and `env` are your application's.
4767
4870
  import { validateUpload, signDownloadUrl } from "@nifrajs/uploads"
4768
4871
 
4769
- app.post("/avatar", async (c) => {
4770
- const form = await c.req.formData()
4771
- const file = form.get("file")
4772
- if (!(file instanceof Blob)) { c.set.status = 400; return { ok: false, error: "no_file" } }
4773
-
4774
- // Size cap + REAL type by magic bytes - a .exe renamed .png (or a spoofed
4775
- // Content-Type) is caught, because the bytes win. An oversized Blob is rejected
4776
- // by its .size BEFORE it's buffered into memory.
4777
- const result = await validateUpload(file, {
4778
- maxBytes: 2_000_000,
4779
- accept: ["image/png", "image/jpeg"], // exact, or "image/*"
4780
- })
4781
- if (!result.ok) { c.set.status = 400; return { ok: false, error: result.reason } }
4782
- // reason: "too_large" | "empty" | "unrecognized" | "type_not_allowed"
4872
+ app.post(
4873
+ "/avatar",
4874
+ { bodyLimit: 2_100_000 }, // request cap includes multipart framing around a 2 MB file
4875
+ async (c) => {
4876
+ const form = await c.req.formData()
4877
+ const file = form.get("file")
4878
+ if (!(file instanceof Blob)) { c.set.status = 400; return { ok: false, error: "no_file" } }
4879
+
4880
+ // Size cap + REAL type by magic bytes - a .exe renamed .png (or a spoofed
4881
+ // Content-Type) is caught, because the bytes win. An oversized Blob is rejected
4882
+ // by its .size BEFORE it's buffered into memory.
4883
+ const result = await validateUpload(file, {
4884
+ maxBytes: 2_000_000,
4885
+ accept: ["image/png", "image/jpeg"], // exact, or "image/*"
4886
+ })
4887
+ if (!result.ok) { c.set.status = 400; return { ok: false, error: result.reason } }
4888
+ // reason: "too_large" | "empty" | "unrecognized" | "type_not_allowed"
4783
4889
 
4784
- await save(result.bytes, `${id}.${result.ext}`) // result.mime / .ext are trustworthy
4890
+ await save(result.bytes, `${id}.${result.ext}`) // result.mime / .ext are trustworthy
4785
4891
 
4786
- // Hand back a short-TTL, tamper-evident URL (HMAC over path + expiry):
4787
- const url = await signDownloadUrl(`/files/${id}`, env.FILE_SECRET, { expiresInSeconds: 300 })
4788
- return { ok: true, url } // a returned object is serialized as JSON 200
4789
- })
4892
+ // Hand back a short-TTL, tamper-evident URL (HMAC over path + expiry):
4893
+ const url = await signDownloadUrl(`/files/${id}`, env.FILE_SECRET, { expiresInSeconds: 300 })
4894
+ return { ok: true, url } // a returned object is serialized as JSON 200
4895
+ },
4896
+ )
4790
4897
  ```
4791
4898
 
4792
- Pair it with `c.boundedBody` to also bound the _read_: cap the read, then validate
4793
- the buffered bytes. The detection alone is `detectFileType(bytes)` from
4899
+ Direct request reads already follow the route's body limit. Use `c.boundedBody` to
4900
+ set an explicit cap for the bytes you pass to `validateUpload`. The detection alone is
4901
+ `detectFileType(bytes)` from
4794
4902
  `@nifrajs/core/file-type` (returns `{ mime, ext }` or `null`),
4795
4903
  covering common image / A-V / archive types.
4796
4904
 
@@ -4943,7 +5051,8 @@ const app = server()
4943
5051
  // X-Forwarded-For is never believed.
4944
5052
  .use(ipRestriction({ allow: ["10.0.0.0/8", "::1"] }))
4945
5053
  // Reject oversized bodies at the EDGE by Content-Length, before routing - fails closed (411) on a
4946
- // length-less body. (The schema / c.boundedBody cap is the read-time guard; this is the cheap pre-filter.)
5054
+ // length-less body. This is the cheap pre-filter; the route's cap on direct and
5055
+ // framework reads is the read-time guard.
4947
5056
  .use(bodyLimit({ maxBytes: 1_000_000 }))
4948
5057
  ```
4949
5058
 
@@ -4964,8 +5073,8 @@ trustworthy client IP can be derived, and never trusts `X-Forwarded-For` unless
4964
5073
 
4965
5074
  -
4966
5075
  `bodyLimit` - a cheap `Content-Length` pre-filter that rejects oversized
4967
- bodies before routing (fails closed with `411` on a length-less body). The read-time
4968
- guard above (`c.boundedBody` / schema cap) remains the source of truth.
5076
+ bodies before routing (fails closed with `411` on a length-less body). The route's
5077
+ read-time body limit applies to direct reads, schema validation, and bounded readers.
4969
5078
 
4970
5079
  ### Security response headers - `securityHeaders`
4971
5080
 
@@ -5195,6 +5304,91 @@ const app = server({
5195
5304
  // Add your own: { valuePatterns: [...commonSecretPatterns, /\bord_[a-z0-9]+/g] }
5196
5305
  ```
5197
5306
 
5307
+ ### Credentials that reach the browser - NF-C032
5308
+
5309
+ The zone rules keep `backend/` halves and server-only imports out of the browser
5310
+ bundle; the credential scan is the net under them - for a credential typed straight into
5311
+ browser code, one a dependency carries, and a server-only environment value that reached the
5312
+ output some other way (a `define`, a prerendered page, a copied
5313
+ `public/` file). `nifra check` (NF-C032, an error) scans each app's
5314
+ browser-zone modules and every file in `public/`; the build runs the same net on
5315
+ what it publishes - every emitted file with its inline source maps decoded, every
5316
+ `public/` copy, every prerendered page - and matches the values of the build
5317
+ environment's non-public variables there, raw and URL-, base64-, JSON- and
5318
+ HTML-encoded. A `PUBLIC_`-prefixed variable is public by declaration.
5319
+
5320
+ Five rules:
5321
+
5322
+ -
5323
+ **Known token formats** - AWS access keys, Stripe secret keys and webhook secrets,
5324
+ GitHub, Slack (tokens and webhook URLs), OpenAI, Anthropic, SendGrid, Twilio, Mailgun, npm,
5325
+ and a Supabase service-role JWT.
5326
+
5327
+ -
5328
+ **PEM private keys** - a block with a body present, not a parser's bare
5329
+ `-----BEGIN PRIVATE KEY-----` constant.
5330
+
5331
+ -
5332
+ **URLs with a password** - `postgres://user:password@host`, unless the
5333
+ password is a placeholder.
5334
+
5335
+ -
5336
+ **Assigned secrets** - a random literal given to a secret-like name, in first-party
5337
+ source only: `apiKey: "..."`, a quoted header name including its hyphens (
5338
+ `"x-api-key": "..."`), a header set by call (
5339
+ `headers.set("x-api-key", ...)`), a pair in
5340
+ `new Headers([...])`, and `Authorization` read into its
5341
+ `Bearer` token or `Basic` credentials.
5342
+
5343
+ -
5344
+ **Private env values** - the value of a build variable whose name says secret (
5345
+ `TOKEN`, `API_KEY`, `DATABASE_URL`, …) or that looks
5346
+ random, in any encoding above. A defined set of recognized ambient shell, OS and CI names
5347
+ is skipped unless the name itself looks secret-like. Other names are scanned when they
5348
+ look secret-like, contain a credential URL, or hold a random-looking value.
5349
+
5350
+ Deliberate skips: keys public by design (Stripe `pk_`, Google `AIza`,
5351
+ reCAPTCHA `6L`, `G-` and `UA-` ids), placeholders (
5352
+ `changeme`, `<your-key-here>`, a whole-value stand-in such as
5353
+ `your_signing_secret` or an interpolated shell value), low-entropy and word-shaped
5354
+ values, and labels inside a message catalog (`password: "Lykilorð"`). A
5355
+ finding never prints the value: the rule, the location, and a preview of the first few
5356
+ characters plus the length. When a match sits in a content-hashed output file, the build
5357
+ names the module it came from.
5358
+
5359
+ A reviewed false positive can be exempted in `nifra.config.ts`. A `file`
5360
+ exemption suppresses that rule throughout the named file, so the same credential in another
5361
+ file still fails. For `private-env-value`, an `env` exemption suppresses
5362
+ every finding from that variable anywhere in scanned output; use it only when publishing that
5363
+ value everywhere it appears is intended. Every exemption needs its rule and reason, or the
5364
+ build refuses:
5365
+
5366
+ ```ts
5367
+ // nifra.config.ts
5368
+ // doc-check: skip - exemptions name your own findings; there is nothing to run
5369
+ export const secretExemptions = [
5370
+ {
5371
+ rule: "key-format",
5372
+ file: "routes/docs.tsx",
5373
+ reason: "the sample literally spells an AWS access key id",
5374
+ },
5375
+ // A file exemption covers this rule throughout the named file. An env exemption covers every
5376
+ // finding from that variable anywhere in scanned output; use it only when that is intended.
5377
+ {
5378
+ rule: "private-env-value",
5379
+ env: "SIGNING_SALT",
5380
+ reason: "this value is intentionally published wherever it appears; it shapes a public nonce",
5381
+ },
5382
+ ]
5383
+ ```
5384
+
5385
+ The net is a heuristic, not a guarantee. A credential spelled inside a longer string - a
5386
+ URL's query (`https://api.example.com/v1?key=...`) or a cookie header's
5387
+ value - is seen by the known-format rules alone, and a random value given to a name the scan
5388
+ does not judge secret-like is not the `assigned-secret` rule's target. Keep
5389
+ credentials in a route's backend half or under `backend/`, and rotate any
5390
+ that were ever committed.
5391
+
5198
5392
  ## Nifra - Effect provenance
5199
5393
 
5200
5394
  > A route declares the effects it performs, and `nifra check` fails it for being able to reach further than it declared. How reach is computed, why that shapes your modules, and how the declaration turns into an enforced policy.
@@ -7196,7 +7390,7 @@ app.ws("/room/:id", {
7196
7390
 
7197
7391
  Bun, Deno, and Node are long-lived processes, so this works directly on a single instance.
7198
7392
  Across a load balancer, `app.publish` only reaches sockets on the same instance -
7199
- bridge an external fan-out (Redis pub/sub, NATS, a queue) to broadcast across all of them. On
7393
+ configure a `TopicAdapter` on `server()` to bridge a shared fan-out. On
7200
7394
  **Cloudflare Workers**, a stateless isolate can’t broadcast across connections,
7201
7395
  so Nifra ships a Durable Object hub: `createWebSocketHub(app)` holds the
7202
7396
  connections, and `toFetchHandler(app, { webSocketHub })` routes upgrades to it
@@ -7204,6 +7398,22 @@ connections, and `toFetchHandler(app, { webSocketHub })` routes upgrades to it
7204
7398
  upgrade request for a path with no WebSocket route still gets that path's HTTP answer, as on
7205
7399
  every other runtime.
7206
7400
 
7401
+ ```ts
7402
+ import { server } from "@nifrajs/core/server"
7403
+ import { websocket } from "@nifrajs/core/ws"
7404
+ import { sharedTopics } from "./shared-topics"
7405
+
7406
+ const app = server({ topicAdapter: sharedTopics })
7407
+ .use(websocket())
7408
+ .ws("/chat", { open: (ws) => ws.subscribe("room") })
7409
+
7410
+ await app.publish("room", "hello from any instance")
7411
+ ```
7412
+
7413
+ A `TopicAdapter` implements socket subscription cleanup and topic broadcasts. Its
7414
+ `publish` may return a promise; await `app.publish` when it does. The
7415
+ default in-process registry remains synchronous.
7416
+
7207
7417
  ```ts
7208
7418
  // doc-check: skip - Workers entry: a Durable Object hub holds the connections.
7209
7419
  import { toFetchHandler } from "@nifrajs/core/server"
@@ -8057,15 +8267,19 @@ library's `">=3.1.0"` floor never sets the version the upgrade
8057
8267
  starts from unless nothing else, installed or declared, names one.
8058
8268
 
8059
8269
  ```bash
8060
- nifra upgrade --list # the release targets this CLI knows
8061
- nifra upgrade 5.6.0 # dry-run: every planned edit, nothing written
8062
- nifra upgrade 5.6.0 --write # apply; it verifies with nifra check once the target is installed
8063
- bun install # install the new pins
8064
- nifra check # verify against them
8065
- nifra doctor # afterwards: no "mixed nifra versions" advisory left
8066
- ```
8067
-
8068
- It is a dry-run until `--write`, and the same run twice makes no further edits. An
8270
+ nifra upgrade --list # the release targets this CLI knows
8271
+ nifra upgrade 5.12.0 # dry-run: every planned edit, nothing written
8272
+ nifra upgrade 5.12.0 --write # apply; it verifies with nifra check once the target is installed
8273
+ # if pins were already bumped by hand, add --from <installed-version>
8274
+ bun install # install the new pins
8275
+ nifra check # verify against them
8276
+ nifra doctor # afterwards: no "mixed nifra versions" advisory left
8277
+ ```
8278
+
8279
+ It is a dry-run until `--write`, and the same run twice makes no further edits. Once
8280
+ the pins name the target, no recipe is left to apply: pass `--from <version>`
8281
+ with the version they were at to apply the ones they skipped. An option it does not know is
8282
+ refused rather than ignored. An
8069
8283
  unknown version or a target below what is installed is refused (`--allow-downgrade`
8070
8284
  when the rollback is intended); a target newer than the running CLI prints the command for
8071
8285
  that release's CLI. It edits files under the workspace root only: a symlinked package
@@ -13485,13 +13699,13 @@ each deploy adapter it uses.
13485
13699
 
13486
13700
  ## Nifra 5 upgrade guide - from 3.x, 4.x or an earlier 5.x
13487
13701
 
13488
- > Upgrade a Nifra 3.x or 4.x application to 5.0: the chained upgrade command, the frontend/backend layout move and its follow-ups, drafted output schemas, the backend's HTTP mount, the 5.0 defaults that changed, and the release gates. Then move a 5.x app to 5.6.
13702
+ > Upgrade a Nifra 3.x or 4.x application to 5.0, then move a 5.x app to the current Nifra release.
13489
13703
 
13490
13704
  Nifra 4.0 split every app into a frontend and a backend half, and 5.0 enforces the split and
13491
13705
  changes a handful of defaults. The upgrade command pins the packages and moves imports; the
13492
13706
  layout migration moves files; this guide covers what each leaves to you and how to tell a
13493
13707
  finished migration from one that needs a decision. An app already on 5.x skips to
13494
- [Moving to 5.6](#5-6).
13708
+ [The 5.6 migration details](#5-6).
13495
13709
 
13496
13710
  ### 1. Run the executable upgrade
13497
13711
 
@@ -13686,11 +13900,15 @@ If the project has `nifra.assurance.ts`, run `nifra assure --json`.
13686
13900
  Exercise the pages that load or post data, and every browser call to the backend, under
13687
13901
  `nifra dev` and against the production build.
13688
13902
 
13689
- ### Moving to 5.6
13903
+ ### The 5.6 migration details
13904
+
13905
+ An app already on 5.x moves to the current release with
13906
+ the command below, which runs every recipe since its installed version. The 5.6 recipe moves
13907
+ its imports and dependencies; the follow-up changes below need a hand.
13690
13908
 
13691
- An app already on 5.x moves with `nifra upgrade 5.6.0`, which prints every note
13692
- below with the rest of the release's. It moves the imports and dependencies itself; the
13693
- rest needs a hand:
13909
+ ```sh
13910
+ nifra upgrade 5.12.0
13911
+ ```
13694
13912
 
13695
13913
  -
13696
13914
  `@nifrajs/islets` and `@nifrajs/web/nano` merge into
@@ -13727,235 +13945,403 @@ tag name or inside `<script>`.
13727
13945
  A Svelte page receives `data` as the router published it, not a deep reactive
13728
13946
  proxy: copy what you edit into the page's own state.
13729
13947
 
13730
- ## Nifra - Migrating from Express, Hono, Fastify & Elysia
13948
+ ## Nifra - Migrating Express, Fastify, Hono & Elysia backends
13949
+
13950
+ > Move an Express, Fastify, Hono, or Elysia API to Nifra with direct route examples for routing, validation, responses, and deployment.
13731
13951
 
13732
- > Move a backend to Nifra: routing, middleware, validation, and body parsing map directly from Express, Hono, Fastify, and Elysia - and you gain a typed client, multi-runtime deploy, and optional SSR.
13952
+ Migrate an API from Express, Fastify, Hono, or Elysia. The route handlers become chainable
13953
+ Nifra routes; request validation becomes part of the route contract; and the same app can
13954
+ serve a typed client on Bun, Node, Deno, or an edge runtime.
13733
13955
 
13734
- Nifra's `server()` is a chainable, Web-standard router - the move from Express, Hono,
13735
- Fastify, or Elysia is mostly mechanical renames. What you gain: an end-to-end-typed client with
13736
- zero codegen, schema validation built into the route, the same app on Bun / Node / Deno / the
13737
- edge, and an SSR frontend whenever you want one.
13956
+ Keep your database, service layer, and domain logic. Move one endpoint at a time, translate
13957
+ its request and response shape, then point the existing frontend at the new endpoint. Nifra
13958
+ can stay backend-only or mount under a full-stack app. Use `t.looseObject` when
13959
+ you need to keep accepting undeclared body fields; `t.object` rejects them.
13738
13960
 
13739
- ### How the concepts map
13961
+ ### Map the backend primitives
13740
13962
 
13741
- Express / Hono / Fastify
13963
+ Express / Fastify / Hono / Elysia
13742
13964
  Nifra
13743
13965
 
13744
13966
  `app.get(path, handler)`
13967
+ `server().get(path, handler)`; path params are inferred from the path
13745
13968
 
13746
- `server().get(path, handler)` - chainable, fully type-inferred
13747
-
13748
- `req` / `res` · Hono `Context`
13969
+ `req` / `reply` / framework context
13970
+ `c`, with `c.params`, `c.query`, `c.body`, and the Web Request
13749
13971
 
13750
- `c` - `c.req`, `c.params`, `c.query`; **return** a value (JSON) or a
13751
- `Response`
13972
+ `res.json(x)`, `reply.send(x)`, `c.json(x)`
13973
+ Return `x` for JSON, or return a Web `Response`
13752
13974
 
13753
- `app.use(mw)` · Hono middleware
13975
+ JSON Schema, TypeBox, or validator middleware
13976
+ Declare `body`, `query`, or `params` with `t`; validated values are typed in the handler
13754
13977
 
13755
- `.use()` + the `@nifrajs/middleware` pack (CORS, auth, rate limit, …)
13978
+ Set a status or response header
13979
+ `c.set.status` and `c.set.headers`, or return a `Response`
13756
13980
 
13757
- `express.json()` / body parsing
13758
- built in - declare a schema and the parsed body is typed
13981
+ Middleware and plugins
13982
+ `.use()` and the optional `@nifrajs/middleware` packages
13759
13983
 
13760
- Fastify JSON schema · `zod` middleware · Elysia `t`
13984
+ Generated client types or a separate SDK
13985
+ `client<typeof app>()` from `@nifrajs/client`, no codegen
13761
13986
 
13762
- `{ body, query, params }` validated by `t` (TypeBox) or any
13763
- [Standard Schema](https://standardschema.dev)
13987
+ OpenAPI and interactive API docs
13988
+ Generate a document from the route schemas with `nifra openapi`
13764
13989
 
13765
- `res.json(x)` / `reply.send(x)` / `c.json(x)`
13990
+ ### Express to Nifra
13766
13991
 
13767
- `return x`
13992
+ Replace `req.params` with `c.params`, body-parser middleware with a
13993
+ route schema, and `res.status().json()` with `c.set.status` plus a
13994
+ returned value. Keep Express middleware only where it is still needed during a staged
13995
+ migration.
13768
13996
 
13769
- `app.listen(3000)`
13997
+ ```ts
13998
+ // Express
13999
+ import express from "express"
14000
+ const expressApp = express()
14001
+ expressApp.get("/users/:id", (req, res) => res.json({ id: req.params.id, name: "Ada" }))
14002
+ expressApp.post("/users", express.json(), (req, res) =>
14003
+ res.status(201).json({ id: crypto.randomUUID(), name: req.body.name }),
14004
+ )
13770
14005
 
13771
- `app.listen()` (Bun) · `@nifrajs/node` · `@nifrajs/deno` ·
13772
- `toFetchHandler` (edge)
14006
+ // Nifra
14007
+ import { server } from "@nifrajs/core/server"
14008
+ import { t } from "@nifrajs/schema"
13773
14009
 
13774
- OpenAPI plugins / swagger
13775
- generated from the same `t` schemas - no second source of truth
14010
+ export const app = server()
14011
+ .get("/users/:id", (c) => ({ id: c.params.id, name: "Ada" }))
14012
+ .post("/users", { body: t.looseObject({ name: t.string() }) }, (c) => {
14013
+ c.set.status = 201
14014
+ return { id: crypto.randomUUID(), name: c.body.name }
14015
+ })
14016
+ ```
13776
14017
 
13777
- ### Express → Nifra
14018
+ ### Fastify to Nifra
13778
14019
 
13779
- The handler returns its result instead of calling `res.json`, and validation moves
13780
- onto the route. The client then infers all of this for free.
14020
+ Move Fastify JSON Schema onto the route as Nifra's `body`,
14021
+ `query`, or `params` schema. Replace `reply.code().send()`
14022
+ with the response status and return value; move Fastify plugins to a Nifra plugin or
14023
+ `.use()` middleware where the behavior fits.
13781
14024
 
13782
14025
  ```ts
13783
- // Express
13784
- app.get("/users/:id", (req, res) => res.json({ id: req.params.id }))
13785
- app.post("/users", express.json(), (req, res) => res.status(201).json(create(req.body)))
14026
+ // Fastify
14027
+ import Fastify from "fastify"
14028
+ type UserParams = { id: string }
14029
+ type UserBody = { name: string }
14030
+ const fastify = Fastify()
14031
+ fastify.get<{ Params: UserParams }>("/users/:id", async (request, reply) =>
14032
+ reply.send({ id: request.params.id, name: "Ada" }),
14033
+ )
14034
+ fastify.post<{ Body: UserBody }>(
14035
+ "/users",
14036
+ {
14037
+ schema: {
14038
+ body: {
14039
+ type: "object",
14040
+ required: ["name"],
14041
+ properties: { name: { type: "string" } },
14042
+ },
14043
+ },
14044
+ },
14045
+ async (request, reply) =>
14046
+ reply.code(201).send({ id: crypto.randomUUID(), name: request.body.name }),
14047
+ )
13786
14048
 
13787
- // Nifra - return the value (or a Response); c is Web-standard; the body is parsed + validated
13788
- server()
13789
- .get("/users/:id", (c) => ({ id: c.params.id }))
13790
- .post("/users", { body: t.object({ name: t.string() }) }, (c) => create(c.body))
14049
+ // Nifra
14050
+ import { server } from "@nifrajs/core/server"
14051
+ import { t } from "@nifrajs/schema"
14052
+
14053
+ export const app = server()
14054
+ .get("/users/:id", (c) => ({ id: c.params.id, name: "Ada" }))
14055
+ .post("/users", { body: t.looseObject({ name: t.string() }) }, (c) => {
14056
+ c.set.status = 201
14057
+ return { id: crypto.randomUUID(), name: c.body.name }
14058
+ })
13791
14059
  ```
13792
14060
 
13793
- ### Hono → Nifra
14061
+ ### Hono to Nifra
13794
14062
 
13795
- The closest of the routers - `c.req.param("id")` becomes a typed
13796
- `c.params.id`, and you return the value rather than `c.json(...)`. Nifra
13797
- adds the typed client, schema validation, multi-runtime deploy, and (if you want it) SSR.
14063
+ The handler shape is close: `c.req.param("id")` becomes the typed
14064
+ `c.params.id`, and `c.json()` becomes a return. Move body parsing and
14065
+ validation into the route declaration so invalid input is rejected before the handler runs.
13798
14066
 
13799
14067
  ```ts
13800
14068
  // Hono
13801
- app.get("/users/:id", (c) => c.json({ id: c.req.param("id") }))
14069
+ import { Hono } from "hono"
14070
+ const legacy = new Hono()
14071
+ legacy
14072
+ .get("/users/:id", (c) => c.json({ id: c.req.param("id"), name: "Ada" }))
14073
+ .post("/users", async (c) => {
14074
+ const body = await c.req.json<{ name: string }>()
14075
+ return c.json({ id: crypto.randomUUID(), name: body.name }, 201)
14076
+ })
13802
14077
 
13803
- // Nifra - nearly identical; params are a typed object, you return the value
13804
- server().get("/users/:id", (c) => ({ id: c.params.id }))
14078
+ // Nifra
14079
+ import { server } from "@nifrajs/core/server"
14080
+ import { t } from "@nifrajs/schema"
14081
+
14082
+ export const app = server()
14083
+ .get("/users/:id", (c) => ({ id: c.params.id, name: "Ada" }))
14084
+ .post("/users", { body: t.looseObject({ name: t.string() }) }, (c) => {
14085
+ c.set.status = 201
14086
+ return { id: crypto.randomUUID(), name: c.body.name }
14087
+ })
13805
14088
  ```
13806
14089
 
13807
- ### Fastify & Elysia
14090
+ ### Elysia to Nifra
13808
14091
 
13809
- -
13810
- **Fastify** - its per-route JSON-schema validation maps directly to Nifra's
13811
- `{ body, query, params }`; plugins become Nifra plugins; `reply.send`
13812
- becomes a return.
14092
+ Both use a chainable route API and TypeBox-shaped schemas. In Nifra, import `t`
14093
+ from `@nifrajs/schema` and declare the schema beside the handler; the handler
14094
+ receives a typed context and returns its response. This keeps the route contract available
14095
+ to Nifra's inferred client and other adapters.
13813
14096
 
13814
- -
13815
- **Elysia** - the closest peer (Bun, typed, TypeBox `t`). The shapes are nearly
13816
- 1:1: `.get/.post` + a `t` schema, and an Eden-style typed client. You
13817
- gain Node / Deno / edge portability and an optional SSR frontend on five UI libraries.
14097
+ ```ts
14098
+ // Elysia
14099
+ import { Elysia, t as elysiaT } from "elysia"
14100
+ const legacy = new Elysia()
14101
+ .get("/users/:id", ({ params }) => ({ id: params.id, name: "Ada" }))
14102
+ .post(
14103
+ "/users",
14104
+ ({ body }) => ({ id: crypto.randomUUID(), name: body.name }),
14105
+ { body: elysiaT.Object({ name: elysiaT.String() }) },
14106
+ )
13818
14107
 
13819
- Then connect a database (Database) and, if you're going
13820
- full-stack, see Migrating a meta-framework.
14108
+ // Nifra
14109
+ import { server } from "@nifrajs/core/server"
14110
+ import { t } from "@nifrajs/schema"
13821
14111
 
13822
- ## Nifra - Migrating from Next.js, Nuxt, SvelteKit & SolidStart
14112
+ export const app = server()
14113
+ .get("/users/:id", (c) => ({ id: c.params.id, name: "Ada" }))
14114
+ .post("/users", { body: t.looseObject({ name: t.string() }) }, (c) => {
14115
+ return { id: crypto.randomUUID(), name: c.body.name }
14116
+ })
14117
+ ```
13823
14118
 
13824
- > Move from a meta-framework to Nifra: file routes, data loading, API routes, layouts, and SSG/ISR map across React (Next), Vue (Nuxt), Svelte (SvelteKit), and Solid (SolidStart).
14119
+ ### Connect the API to a frontend or another runtime
13825
14120
 
13826
- Nifra is framework-agnostic, so you keep your UI library and replace the meta-framework around
13827
- it: Next.js → Nifra + React, Nuxt → Nifra + Vue, SvelteKit → Nifra + Svelte, SolidStart → Nifra +
13828
- Solid. The concepts map one-to-one, and you can migrate incrementally - stand up Nifra's API
13829
- first, point your existing app at it, then move routes over.
14121
+ The backend app itself is fetch-compatible. A frontend can call it in-process during SSR
14122
+ with `inProcessClient(app)`, while `apiPrefix: "/api"` also mounts the
14123
+ routes at `/api/*` over HTTP. The prefix is passed through by default: set
14124
+ `apiStrip: true` to mount backend routes declared as `/users/*`, or
14125
+ declare their full `/api/users/*` paths. The same app can be served through Bun,
14126
+ `@nifrajs/node`, `@nifrajs/deno`, or an edge fetch handler.
13830
14127
 
13831
- ### How the concepts map
14128
+ For the UI migration, see
14129
+ Migrate a frontend. For route schemas,
14130
+ middleware, and deployment details, continue to
14131
+ API & typed client,
14132
+ Plugins & middleware, and
14133
+ Deployment.
13832
14134
 
13833
- Meta-framework concept
13834
- Nifra
14135
+ ## Nifra - Migrating React, Preact, Solid, Vue & Svelte apps
13835
14136
 
13836
- File routes (`pages/`, `app/`, `routes/`)
14137
+ > Migrate a Next.js, Remix, Preact, SolidStart, Nuxt, or SvelteKit frontend to Nifra while keeping React, Preact, Solid, Vue, or Svelte.
13837
14138
 
13838
- `routes/` - `.tsx` / `.vue` / `.svelte` / `.mdx`, same dynamic
13839
- `[param]` / `[...catch-all]` conventions
14139
+ Keep your UI framework and replace the meta-framework around it. Nifra has adapters for
14140
+ React, Preact, Solid, Vue, and Svelte; the routes, loaders, actions, and rendering features
14141
+ work the same across all five.
13840
14142
 
13841
- `getServerSideProps` · `load` · `createAsync` · `asyncData`
14143
+ This guide covers React apps from Next.js or Remix / React Router, Preact SSR apps, SolidStart,
14144
+ Nuxt, and SvelteKit. Move one route at a time: copy the view, move its server data work into
14145
+ the matching `.backend.ts` file, and let the loader schema define what reaches the
14146
+ browser.
13842
14147
 
13843
- `export async function loader()` in the route's `.backend.ts`
13844
- half - runs on the server, typed into the page through `loaderOutput`
14148
+ Scaffold the adapter you want with
14149
+ `bun create nifra my-app --framework react` (replace `react` with
14150
+ `preact`, `solid`, `vue`, or `svelte`). See
14151
+ Frameworks for adapter setup and file formats.
13845
14152
 
13846
- API routes (`pages/api`, `+server.ts`, route handlers)
14153
+ ### Map the route and data model
13847
14154
 
13848
- a `server()` backend + the typed client - no `fetch()` wrappers
14155
+ Starting point
14156
+ Nifra adapter and page
14157
+ Move server data to
13849
14158
 
13850
- Layouts (`layout.tsx`, `+layout`, `app.vue`)
14159
+ Next.js, Remix, React Router
14160
+ React, `routes/example.tsx`
14161
+ route `.backend.ts`
13851
14162
 
13852
- `_layout.tsx` - nested layout chains
14163
+ Preact SSR / Fresh
14164
+ Preact, `routes/example.tsx`
14165
+ route `.backend.ts`
13853
14166
 
13854
- Form actions / route handlers for mutations
14167
+ SolidStart
14168
+ Solid, `routes/example.tsx`
14169
+ route `.backend.ts`
13855
14170
 
13856
- `export async function action()` - typed, progressive-enhancement forms
14171
+ Nuxt
14172
+ Vue, `routes/example.vue`
14173
+ route `.backend.ts`
13857
14174
 
13858
- `getStaticProps` / `prerender` / `export const prerender`
14175
+ SvelteKit
14176
+ Svelte, `routes/example.svelte`
14177
+ route `.backend.ts`
13859
14178
 
13860
- `export const prerender = true` (SSG) + ISR via `withISR`
14179
+ A route is a view file plus its server half: for example
14180
+ `routes/users/[id].tsx` and `routes/users/[id].backend.ts`. Dynamic
14181
+ segments keep the `[param]` convention. Layouts move to
14182
+ `_layout.tsx` (or the matching adapter format); API handlers move to a
14183
+ `server()` backend and can be called in-process by loaders.
13861
14184
 
13862
- `<Link>` · `<NuxtLink>` · `<a data-sveltekit-preload>`
13863
- Nifra's client router - `Link` + hover/focus prefetch, scroll restoration
14185
+ ### Move data loading and mutations once
13864
14186
 
13865
- `next/image` · `nuxt/image`
14187
+ Replace `getServerSideProps`, route `loader` functions,
14188
+ `useAsyncData`, and `+page.server.ts` with the same Nifra loader. It
14189
+ runs on the server, calls your API in-process during SSR, and returns only fields allowed by
14190
+ `loaderOutput`. Put mutations in `action`; native forms still work
14191
+ without JavaScript and client submissions revalidate the page data.
13866
14192
 
13867
- `<Image>` from `@nifrajs/web-<fw>/image`
14193
+ ```ts
14194
+ // routes/users/[id].backend.ts - server-only data work, shared by every UI adapter
14195
+ import { t } from "@nifrajs/schema"
14196
+ import { notFound } from "@nifrajs/web"
14197
+ import type { Route } from "./+types/[id]"
13868
14198
 
13869
- `metadata` / `<Head>` / `definePageMeta`
14199
+ export const loaderOutput = t.object({ id: t.string(), name: t.string() })
14200
+ export const loader: Route.Loader = async ({ params, api }) => {
14201
+ const result = await api.users({ id: params.id }).get()
14202
+ if (!result.ok) {
14203
+ if (result.status === 404) throw notFound()
14204
+ throw new Error("User API request failed (" + result.status + ")")
14205
+ }
14206
+ return result.data
14207
+ }
14208
+ ```
13870
14209
 
13871
- `export const meta` (or a `meta()` function of the loader data)
14210
+ ### React - Next.js, Remix, and React Router
13872
14211
 
13873
- `revalidatePath` · `revalidateTag`
14212
+ Keep the React component. Move server fetching from a Next page, Server Component, or
14213
+ framework route loader into the paired backend file above. A route component receives typed
14214
+ `data` as a prop. Nifra does not require React Server Components; if you need them,
14215
+ they are an opt-in feature on the shared route model; see
14216
+ Server components.
13874
14217
 
13875
- an action's `revalidate(paths, data, { tags })`, or
13876
- `revalidateEndpoint` for a webhook - see
13877
- SSG & ISR
14218
+ ```tsx
14219
+ // routes/users/[id].tsx - React page, data is inferred from loaderOutput
14220
+ import type { Route } from "./+types/[id]"
13878
14221
 
13879
- Server Components · `"use client"`
14222
+ export default function User({ data }: Route.ComponentProps) {
14223
+ return <h1>{data.name}</h1>
14224
+ }
14225
+ ```
13880
14226
 
13881
- opt-in server components on all five adapters
14227
+ ### Preact - Preact SSR and Fresh
13882
14228
 
13883
- Partial prerendering (Cache Components)
14229
+ Keep Preact JSX and component state. Replace Fresh or custom SSR route data with the shared
14230
+ backend loader, then author the page as a `.tsx` route using the Preact adapter.
14231
+ Fresh-specific middleware and route conventions move to Nifra's backend and file routes.
13884
14232
 
13885
- a `shellLoader` and holes - see
13886
- Partial prerendering
14233
+ ```tsx
14234
+ /** @jsxImportSource preact */
14235
+ // routes/users/[id].tsx - Preact uses the same route and loader shape
14236
+ import type { Route } from "./+types/[id]"
13887
14237
 
13888
- Intercepting routes (`(.)photo`)
14238
+ export default function User({ data }: Route.ComponentProps) {
14239
+ return <h1>{data.name}</h1>
14240
+ }
14241
+ ```
13889
14242
 
13890
- a boundary with `{ intercept: "/photos/:id" }` - see
13891
- Opening a route in a modal
14243
+ ### Solid - SolidStart
13892
14244
 
13893
- `keepalive` in `definePageMeta`
14245
+ Keep Solid components and signals. Move SolidStart route data into the shared loader; the
14246
+ page stays a `.tsx` file, with the loader result passed through props.
13894
14247
 
13895
- `export const keepAlive = true` - see
13896
- Keep-alive
14248
+ ```tsx
14249
+ // routes/users/[id].tsx - keep Solid components and JSX
14250
+ import type { Route } from "./+types/[id]"
13897
14251
 
13898
- ### Data loading (Next.js → Nifra + React)
14252
+ export default function User(props: Route.ComponentProps) {
14253
+ return <h1>{props.data.name}</h1>
14254
+ }
14255
+ ```
13899
14256
 
13900
- The biggest change: data fetching becomes a typed `loader` that calls your backend
13901
- in-process during SSR - no `fetch` to your own API, no untyped JSON.
14257
+ ### Vue - Nuxt
13902
14258
 
13903
- ```tsx
13904
- // Next.js - app/users/[id]/page.tsx
13905
- export default async function Page({ params }) {
13906
- const res = await fetch(`https://api/users/${params.id}`)
13907
- const user = await res.json()
13908
- return <h1>{user.name}</h1>
13909
- }
14259
+ Move `useAsyncData` and server-only calls from Nuxt pages into the backend loader.
14260
+ Keep the template and author the Nifra route as a Vue Single-File Component. Its frontmatter
14261
+ exports live in the plain `<script>`; component props and markup live in
14262
+ `<script setup>` and `<template>`.
13910
14263
 
13911
- // Nifra - routes/users/[id].backend.ts: the loader, which never reaches the browser
13912
- export const loaderOutput = t.object({ name: t.string() }) // the only fields the page receives
13913
- export async function loader({ params, api }: Route.LoaderArgs) {
13914
- const res = await api.users({ id: params.id }).get() // typed, in-process during SSR
13915
- if (!res.ok) throw notFound()
13916
- return res.data
13917
- }
14264
+ ```vue
14265
+ <!-- routes/users/[id].vue - the view stays a Vue Single-File Component -->
14266
+ <script setup lang="ts">
14267
+ const props = defineProps<{ data: { id: string; name: string } }>()
14268
+ </script>
13918
14269
 
13919
- // Nifra - routes/users/[id].tsx: the page
13920
- export default function User({ data }: Route.ComponentProps) {
13921
- return <h1>{data.name}</h1>
13922
- }
14270
+ <template>
14271
+ <h1>{{ props.data.name }}</h1>
14272
+ </template>
13923
14273
  ```
13924
14274
 
13925
- ### Svelte / Solid / Vue
14275
+ ### Svelte - SvelteKit
13926
14276
 
13927
- Identical shape - only the page file's extension and component syntax change. The route's
13928
- `.backend.ts` half (`loader`, `action`,
13929
- `loaderOutput`) is the same file on every framework (that's Nifra's render seam).
13930
- SvelteKit's `+page.server.ts` maps onto it one to one:
14277
+ Move `+page.server.ts` data loading to the paired backend file. Keep the
14278
+ `+page.svelte` markup and component logic in a Nifra `.svelte` route;
14279
+ Svelte 5 receives route data through `$props()`.
13931
14280
 
13932
- ```ts
13933
- // SvelteKit - +page.server.ts + +page.svelte
13934
- export async function load({ params }) { return { post: await getPost(params.slug) } }
14281
+ ```svelte
14282
+ <!-- routes/users/[id].svelte - Svelte 5 props -->
14283
+ <script lang="ts">
14284
+ let { data }: { data: { id: string; name: string } } = $props()
14285
+ </script>
13935
14286
 
13936
- // Nifra - routes/blog/[slug].backend.ts + routes/blog/[slug].svelte
13937
- export const loaderOutput = t.object({ post: t.object({ title: t.string(), html: t.string() }) })
13938
- export async function loader({ params }: Route.LoaderArgs) { return { post: await getPost(params.slug) } }
14287
+ <h1>{data.name}</h1>
13939
14288
  ```
13940
14289
 
13941
- ### What Nifra adds
14290
+ ### Map the rest of your frontend
13942
14291
 
13943
- -
13944
- **One model, any UI library** - switch React→Solid later by changing one import, not your
13945
- app.
14292
+ Existing feature
14293
+ Nifra equivalent
13946
14294
 
13947
- -
13948
- **Much faster SSR** - the current dynamic-page snapshot reports Nifra at
13949
- 15× the throughput of Next.js, 7.2× Nuxt, and
13950
- 3.9× SvelteKit / 2.2× SolidStart, with a fraction
13951
- of the client JavaScript. See benchmarks.
14295
+ Nested layouts
14296
+ `_layout.tsx` or the adapter's layout format; parent data is shared with child routes
13952
14297
 
13953
- -
13954
- **End-to-end types with no codegen**, the same app on Bun / Node / Deno / the edge, and a
13955
- backend you can also ship on its own. Start with Getting started.
14298
+ API route handlers
14299
+ A `server()` backend; loaders can use its typed client directly during SSR
14300
+
14301
+ Form actions and mutations
14302
+ Route `action` plus native form POST; client submissions revalidate loader data
14303
+
14304
+ Static generation and ISR
14305
+ `prerender = true` for SSG; `withISR` for revalidation
14306
+
14307
+ Metadata and document head
14308
+ Named `meta` export, or a function of the loader data
14309
+
14310
+ Link prefetch and scroll restore
14311
+ Nifra's client router and `Link`, with hover/focus prefetch and scroll restoration
14312
+
14313
+ Image components
14314
+ `Image` from `@nifrajs/web-<framework>/image`
14315
+
14316
+ Tag or path revalidation
14317
+ An action's `revalidate(paths, data, { tags })` or `revalidateEndpoint` for a webhook
14318
+
14319
+ Partial prerendering
14320
+ `shellLoader` and boundary loaders; see Partial prerendering
14321
+
14322
+ Intercepted modal routes
14323
+ A route boundary with an `intercept` target; see Modal routes
14324
+
14325
+ Keep-alive pages
14326
+ `keepAlive = true`; see Keep-alive
14327
+
14328
+ ### What stays the same across adapters
14329
+
14330
+ - Nested routes, layouts, metadata, forms, streaming, SSG, and ISR use the shared route model.
14331
+
14332
+ - Route loaders and actions stay server-only; output schemas bound the data sent to the browser.
14333
+
14334
+ - Switching among React, Preact, Solid, Vue, and Svelte changes the adapter and view syntax, not your backend contract.
14335
+
14336
+ Moving an API server too? See
14337
+ Migrate a backend. For the full
14338
+ rendering and route model, see Loaders & actions
14339
+ and Routing.
13956
14340
 
13957
- Moving a backend (Express, Hono, Fastify, Elysia) instead? See
13958
- Migrating a backend.
14341
+ The current dynamic SSR snapshot reports Nifra at 18× the throughput
14342
+ of Next.js, 7.9× Nuxt, 5.3× SvelteKit, and
14343
+ 2.7× SolidStart on the measured pages. See the
14344
+ benchmark methodology and full results.
13959
14345
 
13960
14346
  ## Nifra - Migrate route by route
13961
14347
 
@@ -19302,9 +19688,12 @@ const app = server()
19302
19688
  - **`rateLimit(options)`** - `429` + `Retry-After` + `RateLimit-*` headers, with a
19303
19689
  pluggable `RateLimitStore`. The default bucket key is the caller IP the server resolved (the
19304
19690
  socket peer, or the app's `clientIp` trust declaration behind a proxy); a custom `key`, trusted
19305
- single-IP `header`, or `trustedProxies` overrides it. With no caller IP it fails closed (`500`)
19306
- instead of silently sharing one bucket. The bundled `MemoryStore` **refuses to run in production** (a per-instance
19307
- limiter is unsafe across instances) - provide a shared store (Redis, etc.) there.
19691
+ single-IP `header`, or `trustedProxies` overrides it. A configured header must contain exactly one
19692
+ valid IP; comma-separated or malformed values fall through to configured `trustedProxies` or
19693
+ `allowGlobalKey` fallbacks. Without a usable key or explicit global fallback, requests fail closed
19694
+ (`500`) instead of silently sharing one bucket. The bundled `MemoryStore` **refuses to run in
19695
+ production** (a per-instance limiter is unsafe across instances) - provide a shared store (Redis,
19696
+ etc.) there.
19308
19697
  - **`cache({ store, ttlMs })` / `responseCache(...)`** - full response cache with a pluggable
19309
19698
  store, `Vary`-aware keys, `Age`, byte caps, and `Cache-Control` / `Set-Cookie` safety defaults.
19310
19699
  `MemoryResponseCache` is dev/single-instance only unless explicitly allowed in production.
@@ -21093,7 +21482,7 @@ done-gate, or `nifra mcp` to give the agent live project tools.
21093
21482
 
21094
21483
  ## @nifrajs/core
21095
21484
 
21096
- `AdmissionController`, `AdmissionDecision`, `AnyServer`, `AuthHeaders`, `AuthMaybePromise`, `AuthenticationFailure`, `AuthenticationFailureReason`, `AuthenticationInput`, `AuthenticationResult`, `AuthenticationStage`, `AuthenticationSuccess`, `Context`, `ContextPlugin`, `CookieOptions`, `CookieSecret`, `DeclaredMountRoute`, `DefinePluginResult`, `DurableObjectNamespaceLike`, `ExecutionContext`, `FRAMEWORK_NAME`, `FetchApp`, `FrameworkError`, `FrameworkName`, `Handler`, `IdentityPlugin`, `InferInput`, `InferOutput`, `JoinRoutePath`, `LambdaEvent`, `LambdaHandler`, `LambdaResponse`, `LambdaV1Event`, `LambdaV2Event`, `ListenTlsOptions`, `LogFields`, `Logger`, `METHODS`, `McpPromptDescriptor`, `McpResourceDescriptor`, `Method`, `Middleware`, `MountFetchOptions`, `MountOptions`, `MountableApp`, `NetlifyEvent`, `NetlifyHandler`, `NifraFeatureVersion`, `NifraPlugin`, `NifraWebSocket`, `NodeRequestContext`, `NodeRequestHook`, `NodeResponseBodyHook`, `NodeResponseContext`, `NodeResponseHook`, `NodeServeOutcome`, `OnRequestResult`, `OpaqueMountDeclaration`, `Params`, `PlainRender`, `Platform`, `PlatformResponse`, `PluginTypeCollapsed`, `PrefixRegistry`, `Prettify`, `PromptArgument`, `PromptMessage`, `ROUTE_PATTERN_OVERLAP_MAX_STATES`, `RedactOptions`, `Registry`, `RequestLocal`, `RequestPath`, `ResponseBodyHook`, `ResponseBodyReplacement`, `ResponseControls`, `ResponseFinalization`, `ResponseHeadersHook`, `ResponseHeadersView`, `ResponseMapFor`, `ResponseResult`, `RouteConfigError`, `RouteConfigErrorCode`, `RouteDescriptor`, `RouteInfo`, `RouteInfoFor`, `RouteMethod`, `RoutePatternOverlapLimitError`, `RouteSchema`, `Router`, `RouterMatch`, `RunningServer`, `SSEContext`, `SSEInit`, `SSEMessage`, `SSEStream`, `ScheduledController`, `ScheduledHandler`, `Server`, `ServerOptions`, `StandardIssue`, `StandardResult`, `StandardSchemaV1`, `StandardTypes`, `StandardWebSocket`, `StatusResponse`, `ToolAnnotations`, `TypedSSEStream`, `UrlParts`, `VERSION`, `ValidationOutcome`, `VercelHandler`, `Version`, `WebSocketContext`, `WebSocketData`, `WebSocketHandler`, `WebSocketUpgradeOutcome`, `authenticated`, `beforeHandler`, `carryRequestLocals`, `commonSecretPatterns`, `cookieNamePrefix`, `defineContextPlugin`, `defineIdentityPlugin`, `definePlugin`, `defineRouterPlugin`, `hasDuplicateCookie`, `isAuthenticatedRequest`, `isSameOriginForm`, `isSameOriginPath`, `isSameOriginRequest`, `jsonLogger`, `markAuthenticatedRequest`, `parseCookies`, `pathnameOf`, `redactLogFields`, `rejected`, `replacedRequestOf`, `requestLocal`, `routePatternOverlap`, `routeTemplateOf`, `serializeCookie`, `server`, `signValue`, `silentLogger`, `status`, `toFetchHandler`, `toLambdaHandler`, `toNetlifyHandler`, `toVercelHandler`, `unsignValue`, `urlPartsOf`, `varyOn`, `writableResponse`
21485
+ `AdmissionController`, `AdmissionDecision`, `AnyServer`, `AuthHeaders`, `AuthMaybePromise`, `AuthenticationFailure`, `AuthenticationFailureReason`, `AuthenticationInput`, `AuthenticationResult`, `AuthenticationStage`, `AuthenticationSuccess`, `Context`, `ContextPlugin`, `CookieOptions`, `CookieSecret`, `DeclaredMountRoute`, `DefinePluginResult`, `DurableObjectNamespaceLike`, `ExecutionContext`, `FRAMEWORK_NAME`, `FetchApp`, `FrameworkError`, `FrameworkName`, `Handler`, `IdentityPlugin`, `InferInput`, `InferOutput`, `JoinRoutePath`, `LambdaEvent`, `LambdaHandler`, `LambdaResponse`, `LambdaV1Event`, `LambdaV2Event`, `ListenTlsOptions`, `LogFields`, `Logger`, `METHODS`, `McpPromptDescriptor`, `McpResourceDescriptor`, `Method`, `Middleware`, `MountFetchOptions`, `MountOptions`, `MountableApp`, `NetlifyEvent`, `NetlifyHandler`, `NifraFeatureVersion`, `NifraPlugin`, `NifraWebSocket`, `NodeRequestContext`, `NodeRequestHook`, `NodeResponseBodyHook`, `NodeResponseContext`, `NodeResponseHook`, `NodeServeOutcome`, `OnRequestResult`, `OpaqueMountDeclaration`, `Params`, `PlainRender`, `Platform`, `PlatformResponse`, `PluginTypeCollapsed`, `PrefixRegistry`, `Prettify`, `PromptArgument`, `PromptMessage`, `ROUTE_PATTERN_OVERLAP_MAX_STATES`, `RedactOptions`, `Registry`, `RequestLocal`, `RequestPath`, `ResponseBodyHook`, `ResponseBodyReplacement`, `ResponseControls`, `ResponseFinalization`, `ResponseHeadersHook`, `ResponseHeadersView`, `ResponseMapFor`, `ResponseResult`, `RouteConfigError`, `RouteConfigErrorCode`, `RouteDescriptor`, `RouteInfo`, `RouteInfoFor`, `RouteMethod`, `RoutePatternOverlapLimitError`, `RouteSchema`, `Router`, `RouterMatch`, `RunningServer`, `SSEContext`, `SSEInit`, `SSEMessage`, `SSEStream`, `ScheduledController`, `ScheduledHandler`, `Server`, `ServerOptions`, `StandardIssue`, `StandardResult`, `StandardSchemaV1`, `StandardTypes`, `StandardWebSocket`, `StatusResponse`, `ToolAnnotations`, `TopicAdapter`, `TypedSSEStream`, `UrlParts`, `VERSION`, `ValidationOutcome`, `VercelHandler`, `Version`, `WebSocketContext`, `WebSocketData`, `WebSocketHandler`, `WebSocketUpgradeOutcome`, `authenticated`, `beforeHandler`, `carryRequestLocals`, `commonSecretPatterns`, `cookieNamePrefix`, `defineContextPlugin`, `defineIdentityPlugin`, `definePlugin`, `defineRouterPlugin`, `hasDuplicateCookie`, `isAuthenticatedRequest`, `isSameOriginForm`, `isSameOriginPath`, `isSameOriginRequest`, `jsonLogger`, `markAuthenticatedRequest`, `parseCookies`, `pathnameOf`, `redactLogFields`, `rejected`, `replacedRequestOf`, `requestLocal`, `routePatternOverlap`, `routeTemplateOf`, `serializeCookie`, `server`, `signValue`, `silentLogger`, `staticResponse`, `status`, `toFetchHandler`, `toLambdaHandler`, `toNetlifyHandler`, `toVercelHandler`, `unsignValue`, `urlPartsOf`, `varyOn`, `writableResponse`
21097
21486
 
21098
21487
  ## @nifrajs/cron
21099
21488
 
@@ -21201,7 +21590,7 @@ done-gate, or `nifra mcp` to give the agent live project tools.
21201
21590
 
21202
21591
  ## @nifrajs/web
21203
21592
 
21204
- `ACTION_GLOBAL`, `Action`, `BOUNDARY_GLOBAL`, `BackendOnly`, `Blocker`, `BlockerController`, `BlockerFunction`, `BlockerLocation`, `BlockerState`, `Boundary`, `BoundaryDescriptor`, `BoundaryError`, `BoundaryLoaderEntry`, `BoundaryLoadersOf`, `BoundaryMode`, `BoundaryRegistration`, `BoundaryRequestCtx`, `BoundaryState`, `BoundaryStates`, `BoundaryStatus`, `BrowserNavigate`, `BuildAssetSet`, `CacheStore`, `CachedResponse`, `CdnPurgeOutcome`, `CdnPurgeTarget`, `ClientAction`, `ClientActionArgs`, `ClientActionResult`, `ClientLoader`, `ClientLoaderArgs`, `ClientRequestBody`, `ClientRouteHooks`, `ClientRouter`, `ClientRouterOptions`, `CreateCspPolicyOptions`, `CreateNonceResolverOptions`, `CreateWebAppOptions`, `CspHeaderContext`, `CspPolicy`, `CssLoadingMode`, `DATA_GLOBAL`, `DATA_HEADER`, `DEFAULT_CSS_LOADING`, `DEFAULT_DEV_PORT`, `DRAFT_COOKIE`, `DataText`, `Deferred`, `DehydrateOptions`, `DehydratedQueryInfo`, `DehydratedState`, `DocumentParts`, `DraftCookieControls`, `DynamicBoundary`, `DynamicBoundaryBatch`, `EnableDraftOptions`, `FetchRouteData`, `Fetcher`, `FetcherState`, `FontDisplay`, `FontFace`, `FontPreloadInput`, `FontSource`, `GenerateClientEntryOptions`, `GenerateServerManifestOptions`, `GetStaticPaths`, `HANDOVER_ID`, `HostPolicy`, `HostPolicyOptions`, `HostPolicyRule`, `Href`, `HrefOptions`, `HtmlSanitizer`, `IDLE_BLOCKER`, `ISRApp`, `ISROptions`, `ISRPlatform`, `ISRQuery`, `ISRStoreOp`, `ISR_REVALIDATE_HEADER`, `ISR_REVALIDATE_TAGS_HEADER`, `ISR_STATUS_HEADER`, `IdentityEpochContext`, `InertScriptType`, `InfiniteData`, `InfiniteQueryHandle`, `InfiniteQueryOptions`, `InterceptBoundary`, `Intercepted`, `KVCacheStore`, `KVCacheStoreOptions`, `KVNamespaceLike`, `KeepAliveOptions`, `KeepAliveServerOptions`, `KeptPage`, `LAYOUT_DATA_GLOBAL`, `LOCALES_GLOBAL`, `LayoutEntry`, `LinkDescriptor`, `LiveClientEntry`, `Loader`, `LoaderContext`, `LoaderResponseControls`, `LoadingEntry`, `Manifest`, `MatchChain`, `MemoryCacheStore`, `MemoryCacheStoreOptions`, `MemoryStaticBoundaryCache`, `Meta`, `MetaArgs`, `MetaDescriptor`, `MetaInput`, `MiddlewareOutcome`, `MountRouterOptions`, `MutationCallbacks`, `MutationCancelledError`, `MutationContext`, `MutationHandle`, `MutationState`, `MutationStatus`, `NAV_FROM_HEADER`, `NavigateFunction`, `NavigateOptions`, `NonceContext`, `NonceGenerator`, `NonceHeader`, `NonceHeaderContext`, `NonceResolver`, `NotFoundEntry`, `NotFoundScope`, `OpenGraphInput`, `PREFETCH_HEADER`, `PRE_HYDRATION_GUARD`, `PageLocale`, `PageLocales`, `PendingBoundary`, `PrefetchMode`, `PrerenderedPageReaderOptions`, `PrerenderedPages`, `PreviewEndpointOptions`, `QueryClient`, `QueryClientOptions`, `QueryHandle`, `QueryOptions`, `QueryState`, `QueryStatus`, `REDIRECT_HEADER`, `RETAIN_HEADER`, `REVALIDATE_HEADER`, `ROOT_ATTRIBUTE`, `ROUTE_GLOBAL`, `RedirectOptions`, `RenderAdapter`, `RenderAdapterConformanceError`, `RenderAdapterConformanceFixture`, `RenderAssemblyCache`, `RenderPageInput`, `RenderPageOptions`, `RenderProps`, `RenderStreamOptions`, `RenderedPage`, `RevalidateEndpointOptions`, `RevalidateOptions`, `RevalidateResult`, `RevalidateTags`, `RevalidateTagsInput`, `RouteEntry`, `RouteMatch`, `RouteMiddleware`, `RouteModule`, `RoutePattern`, `RouteTable`, `RouterState`, `SERVER_FN_MODULE`, `STATUS_HEADER`, `SanitizedHtml`, `ScriptDescriptor`, `SearchOf`, `SharedBoundary`, `SharedHoleCtx`, `ShellCtx`, `ShouldRevalidate`, `ShouldRevalidateArgs`, `SsrModuleLoader`, `StaticBoundary`, `StaticBoundaryCache`, `StaticBoundaryImportEdge`, `StaticBoundaryRoot`, `StaticCtx`, `StaticPath`, `StaticPaths`, `StaticRoutes`, `StatusPageOptions`, `Submission`, `SubmitOptions`, `TrustedHtml`, `UIMatch`, `UnsafeScriptDescriptor`, `WebAppI18n`, `assertCssLoadingCompatible`, `assertRenderAdapterConformance`, `assertStaticBoundaryImports`, `boundaryDescriptors`, `boundaryModeKey`, `buildManifest`, `canonical`, `closeBoundary`, `createClientRouter`, `createCspPolicy`, `createHostPolicy`, `createMatcher`, `createMutation`, `createNonceResolver`, `createQueryClient`, `createWebApp`, `defer`, `disableDraft`, `enableDraft`, `enumerateStaticRoutes`, `filePathToPattern`, `filePathToPatterns`, `fontFace`, `fontPreload`, `generateClientEntry`, `generateServerManifest`, `getBrowserNavigate`, `gone`, `hashQueryKey`, `href`, `isCacheablePage`, `isDraftEnabled`, `isHostPolicy`, `jsonLd`, `localeOfProps`, `mergeHeads`, `nifraScriptHashes`, `normalizeCssLoading`, `notFound`, `openGraph`, `pageLocaleIn`, `prerenderedPageReader`, `previewEndpoint`, `rawHref`, `redirect`, `registerBlocker`, `renderPage`, `renderPageResult`, `resolveChainMeta`, `resolveDynamicBoundaries`, `resolveMeta`, `resolvePublicPath`, `resolveStaticBoundaries`, `revalidate`, `revalidateEndpoint`, `rotateIdentityEpoch`, `sanitizeHtml`, `sanitizedHtml`, `searchOf`, `searchOfChain`, `serializeData`, `serializeSearch`, `setBlockerController`, `setBrowserNavigate`, `setSsrModuleLoader`, `ssrModuleLoader`, `startDynamicBoundaries`, `statusPage`, `trustHtml`, `unsafeInlineScript`, `webProjectEvidence`, `withISR`
21593
+ `ACTION_GLOBAL`, `Action`, `BOUNDARY_GLOBAL`, `BackendOnly`, `Blocker`, `BlockerController`, `BlockerFunction`, `BlockerLocation`, `BlockerState`, `Boundary`, `BoundaryDescriptor`, `BoundaryError`, `BoundaryLoaderEntry`, `BoundaryLoadersOf`, `BoundaryMode`, `BoundaryRegistration`, `BoundaryRequestCtx`, `BoundaryState`, `BoundaryStates`, `BoundaryStatus`, `BrowserNavigate`, `BuildAssetSet`, `CacheStore`, `CachedResponse`, `CdnPurgeOutcome`, `CdnPurgeTarget`, `ClientAction`, `ClientActionArgs`, `ClientActionResult`, `ClientLoader`, `ClientLoaderArgs`, `ClientRequestBody`, `ClientRouteHooks`, `ClientRouter`, `ClientRouterOptions`, `CreateCspPolicyOptions`, `CreateNonceResolverOptions`, `CreateWebAppOptions`, `CspHeaderContext`, `CspPolicy`, `CssLoadingMode`, `DATA_GLOBAL`, `DATA_HEADER`, `DEFAULT_CSS_LOADING`, `DEFAULT_DEV_PORT`, `DRAFT_COOKIE`, `DataText`, `Deferred`, `DehydrateOptions`, `DehydratedQueryInfo`, `DehydratedState`, `DocumentParts`, `DraftCookieControls`, `DynamicBoundary`, `DynamicBoundaryBatch`, `EnableDraftOptions`, `FetchRouteData`, `Fetcher`, `FetcherState`, `FontDisplay`, `FontFace`, `FontPreloadInput`, `FontSource`, `GenerateClientEntryOptions`, `GenerateServerManifestOptions`, `GetStaticPaths`, `HANDOVER_ID`, `HostPolicy`, `HostPolicyOptions`, `HostPolicyRule`, `Href`, `HrefOptions`, `HtmlSanitizer`, `IDLE_BLOCKER`, `ISRApp`, `ISROptions`, `ISRPlatform`, `ISRQuery`, `ISRStoreOp`, `ISR_REVALIDATE_HEADER`, `ISR_REVALIDATE_TAGS_HEADER`, `ISR_STATUS_HEADER`, `IdentityEpochContext`, `InertScriptType`, `InfiniteData`, `InfiniteQueryHandle`, `InfiniteQueryOptions`, `InterceptBoundary`, `Intercepted`, `KVCacheStore`, `KVCacheStoreOptions`, `KVNamespaceLike`, `KeepAliveOptions`, `KeepAliveServerOptions`, `KeptPage`, `LAYOUT_DATA_GLOBAL`, `LOCALES_GLOBAL`, `LayoutEntry`, `LinkDescriptor`, `LiveClientEntry`, `Loader`, `LoaderContext`, `LoaderResponseControls`, `LoadingEntry`, `Manifest`, `MatchChain`, `MemoryCacheStore`, `MemoryCacheStoreOptions`, `MemoryStaticBoundaryCache`, `Meta`, `MetaArgs`, `MetaDescriptor`, `MetaInput`, `MiddlewareOutcome`, `MountRouterOptions`, `MutationCallbacks`, `MutationCancelledError`, `MutationContext`, `MutationHandle`, `MutationState`, `MutationStatus`, `NAV_FROM_HEADER`, `NavigateFunction`, `NavigateOptions`, `NonceContext`, `NonceGenerator`, `NonceHeader`, `NonceHeaderContext`, `NonceResolver`, `NotFoundEntry`, `NotFoundScope`, `OpenGraphInput`, `PREFETCH_HEADER`, `PRE_HYDRATION_GUARD`, `PageLocale`, `PageLocales`, `PendingBoundary`, `PrefetchMode`, `PrerenderedPageReaderOptions`, `PrerenderedPages`, `PreviewEndpointOptions`, `QueryClient`, `QueryClientOptions`, `QueryHandle`, `QueryOptions`, `QueryState`, `QueryStatus`, `REDIRECT_HEADER`, `RETAIN_HEADER`, `REVALIDATE_HEADER`, `ROOT_ATTRIBUTE`, `ROUTE_GLOBAL`, `RedirectOptions`, `RenderAdapter`, `RenderAdapterConformanceError`, `RenderAdapterConformanceFixture`, `RenderAssemblyCache`, `RenderPageInput`, `RenderPageOptions`, `RenderProps`, `RenderStreamOptions`, `RenderedPage`, `RevalidateEndpointOptions`, `RevalidateOptions`, `RevalidateResult`, `RevalidateTags`, `RevalidateTagsInput`, `RouteEntry`, `RouteMatch`, `RouteMiddleware`, `RouteModule`, `RoutePattern`, `RouteSlotName`, `RouteSlotPatternsOf`, `RouteSlotRegistry`, `RouteSlotTarget`, `RouteTable`, `RouterState`, `SERVER_FN_MODULE`, `STATUS_HEADER`, `SanitizedHtml`, `ScriptDescriptor`, `SearchOf`, `SharedBoundary`, `SharedHoleCtx`, `ShellCtx`, `ShouldRevalidate`, `ShouldRevalidateArgs`, `SsrModuleLoader`, `StaticBoundary`, `StaticBoundaryCache`, `StaticBoundaryImportEdge`, `StaticBoundaryRoot`, `StaticCtx`, `StaticPath`, `StaticPaths`, `StaticRoutes`, `StatusPageOptions`, `Submission`, `SubmitOptions`, `TrustedHtml`, `UIMatch`, `UnsafeScriptDescriptor`, `WebAppI18n`, `assertCssLoadingCompatible`, `assertRenderAdapterConformance`, `assertStaticBoundaryImports`, `boundaryDescriptors`, `boundaryModeKey`, `buildManifest`, `canonical`, `closeBoundary`, `createClientRouter`, `createCspPolicy`, `createHostPolicy`, `createMatcher`, `createMutation`, `createNonceResolver`, `createQueryClient`, `createWebApp`, `defer`, `disableDraft`, `enableDraft`, `enumerateStaticRoutes`, `filePathToPattern`, `filePathToPatterns`, `fontFace`, `fontPreload`, `generateClientEntry`, `generateServerManifest`, `getBrowserNavigate`, `gone`, `hashQueryKey`, `href`, `isCacheablePage`, `isDraftEnabled`, `isHostPolicy`, `jsonLd`, `localeOfProps`, `mergeHeads`, `nifraScriptHashes`, `normalizeCssLoading`, `notFound`, `openGraph`, `pageLocaleIn`, `prerenderedPageReader`, `previewEndpoint`, `rawHref`, `redirect`, `registerBlocker`, `renderPage`, `renderPageResult`, `resolveChainMeta`, `resolveDynamicBoundaries`, `resolveMeta`, `resolvePublicPath`, `resolveStaticBoundaries`, `revalidate`, `revalidateEndpoint`, `rotateIdentityEpoch`, `sanitizeHtml`, `sanitizedHtml`, `searchOf`, `searchOfChain`, `serializeData`, `serializeSearch`, `setBlockerController`, `setBrowserNavigate`, `setSsrModuleLoader`, `ssrModuleLoader`, `startDynamicBoundaries`, `statusPage`, `trustHtml`, `unsafeInlineScript`, `webProjectEvidence`, `withISR`
21205
21594
 
21206
21595
  ## @nifrajs/web-preact
21207
21596