@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.
- package/CHANGELOG.md +52 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +10 -13
- package/dist/cli.js.map +1 -1
- package/dist/doctor.js +2 -2
- package/dist/doctor.js.map +1 -1
- package/dist/load.d.ts +2 -2
- package/dist/load.d.ts.map +1 -1
- package/dist/load.js +1 -1
- package/dist/load.js.map +1 -1
- package/dist/mcp-delegate.d.ts +17 -3
- package/dist/mcp-delegate.d.ts.map +1 -1
- package/dist/mcp-delegate.js +24 -9
- package/dist/mcp-delegate.js.map +1 -1
- package/dist/mcp-http.js +1 -1
- package/dist/mcp-relay.d.ts +37 -0
- package/dist/mcp-relay.d.ts.map +1 -0
- package/dist/mcp-relay.js +129 -0
- package/dist/mcp-relay.js.map +1 -0
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +55 -1
- package/dist/mcp.js.map +1 -1
- package/dist/migrate-layout.d.ts.map +1 -1
- package/dist/migrate-layout.js +45 -33
- package/dist/migrate-layout.js.map +1 -1
- package/dist/recipes/5.10.0.d.ts +3 -2
- package/dist/recipes/5.10.0.d.ts.map +1 -1
- package/dist/recipes/5.10.0.js +5 -4
- package/dist/recipes/5.10.0.js.map +1 -1
- package/dist/recipes/5.11.0.d.ts +10 -0
- package/dist/recipes/5.11.0.d.ts.map +1 -0
- package/dist/recipes/5.11.0.js +50 -0
- package/dist/recipes/5.11.0.js.map +1 -0
- package/dist/recipes/5.12.0.d.ts +9 -0
- package/dist/recipes/5.12.0.d.ts.map +1 -0
- package/dist/recipes/5.12.0.js +34 -0
- package/dist/recipes/5.12.0.js.map +1 -0
- package/dist/recipes/index.d.ts.map +1 -1
- package/dist/recipes/index.js +4 -0
- package/dist/recipes/index.js.map +1 -1
- package/dist/source-rewrites.d.ts +0 -5
- package/dist/source-rewrites.d.ts.map +1 -1
- package/dist/source-rewrites.js +232 -7
- package/dist/source-rewrites.js.map +1 -1
- package/dist/upgrade.d.ts +19 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +55 -2
- package/dist/upgrade.js.map +1 -1
- package/docs/examples.json +38 -2
- package/docs/llms-full.txt +610 -221
- package/docs/types.json +362 -32
- package/package.json +11 -11
- package/src/cli.ts +10 -13
- package/src/doctor.ts +2 -2
- package/src/load.ts +6 -3
- package/src/mcp-delegate.ts +37 -11
- package/src/mcp-http.ts +1 -1
- package/src/mcp-relay.ts +155 -0
- package/src/mcp.ts +51 -1
- package/src/migrate-layout.ts +61 -29
- package/src/recipes/5.10.0.ts +5 -4
- package/src/recipes/5.11.0.ts +51 -0
- package/src/recipes/5.12.0.ts +35 -0
- package/src/recipes/index.ts +4 -0
- package/src/source-rewrites.ts +250 -8
- package/src/upgrade.ts +71 -3
package/docs/llms-full.txt
CHANGED
|
@@ -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
|
-
|
|
299
|
-
**level with Fastify on Node** (
|
|
300
|
-
|
|
301
|
-
and Express behind. On **Deno** it runs at
|
|
302
|
-
GET and
|
|
303
|
-
bearer auth + cookies + validated query/body + a ~2.4 KB JSON response, measured
|
|
304
|
-
`oha`) Nifra runs at **
|
|
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`.
|
|
476
|
-
|
|
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
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
`c.
|
|
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
|
-
//
|
|
4470
|
-
//
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
//
|
|
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
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
smaller
|
|
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
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
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.
|
|
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(
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
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
|
-
|
|
4890
|
+
await save(result.bytes, `${id}.${result.ext}`) // result.mime / .ext are trustworthy
|
|
4785
4891
|
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
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
|
-
|
|
4793
|
-
the
|
|
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.
|
|
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
|
|
4968
|
-
|
|
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
|
-
|
|
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
|
|
8061
|
-
nifra upgrade 5.
|
|
8062
|
-
nifra upgrade 5.
|
|
8063
|
-
|
|
8064
|
-
|
|
8065
|
-
nifra
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
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
|
|
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
|
-
[
|
|
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
|
-
###
|
|
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
|
-
|
|
13692
|
-
|
|
13693
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
13735
|
-
|
|
13736
|
-
|
|
13737
|
-
|
|
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
|
-
###
|
|
13961
|
+
### Map the backend primitives
|
|
13740
13962
|
|
|
13741
|
-
Express / Hono /
|
|
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
|
-
`
|
|
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
|
-
`
|
|
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
|
-
|
|
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
|
-
|
|
13978
|
+
Set a status or response header
|
|
13979
|
+
`c.set.status` and `c.set.headers`, or return a `Response`
|
|
13756
13980
|
|
|
13757
|
-
|
|
13758
|
-
|
|
13981
|
+
Middleware and plugins
|
|
13982
|
+
`.use()` and the optional `@nifrajs/middleware` packages
|
|
13759
13983
|
|
|
13760
|
-
|
|
13984
|
+
Generated client types or a separate SDK
|
|
13985
|
+
`client<typeof app>()` from `@nifrajs/client`, no codegen
|
|
13761
13986
|
|
|
13762
|
-
|
|
13763
|
-
|
|
13987
|
+
OpenAPI and interactive API docs
|
|
13988
|
+
Generate a document from the route schemas with `nifra openapi`
|
|
13764
13989
|
|
|
13765
|
-
|
|
13990
|
+
### Express to Nifra
|
|
13766
13991
|
|
|
13767
|
-
`
|
|
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
|
-
|
|
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
|
-
|
|
13772
|
-
|
|
14006
|
+
// Nifra
|
|
14007
|
+
import { server } from "@nifrajs/core/server"
|
|
14008
|
+
import { t } from "@nifrajs/schema"
|
|
13773
14009
|
|
|
13774
|
-
|
|
13775
|
-
|
|
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
|
-
###
|
|
14018
|
+
### Fastify to Nifra
|
|
13778
14019
|
|
|
13779
|
-
|
|
13780
|
-
|
|
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
|
-
//
|
|
13784
|
-
|
|
13785
|
-
|
|
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
|
|
13788
|
-
server
|
|
13789
|
-
|
|
13790
|
-
|
|
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
|
|
14061
|
+
### Hono to Nifra
|
|
13794
14062
|
|
|
13795
|
-
The
|
|
13796
|
-
`c.params.id`, and
|
|
13797
|
-
|
|
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
|
-
|
|
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
|
|
13804
|
-
|
|
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
|
-
###
|
|
14090
|
+
### Elysia to Nifra
|
|
13808
14091
|
|
|
13809
|
-
-
|
|
13810
|
-
|
|
13811
|
-
|
|
13812
|
-
|
|
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
|
-
|
|
13816
|
-
|
|
13817
|
-
|
|
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
|
-
|
|
13820
|
-
|
|
14108
|
+
// Nifra
|
|
14109
|
+
import { server } from "@nifrajs/core/server"
|
|
14110
|
+
import { t } from "@nifrajs/schema"
|
|
13821
14111
|
|
|
13822
|
-
|
|
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
|
-
|
|
14119
|
+
### Connect the API to a frontend or another runtime
|
|
13825
14120
|
|
|
13826
|
-
|
|
13827
|
-
|
|
13828
|
-
|
|
13829
|
-
|
|
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
|
-
|
|
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
|
-
|
|
13834
|
-
Nifra
|
|
14135
|
+
## Nifra - Migrating React, Preact, Solid, Vue & Svelte apps
|
|
13835
14136
|
|
|
13836
|
-
|
|
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
|
-
|
|
13839
|
-
|
|
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
|
-
|
|
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
|
-
|
|
13844
|
-
|
|
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
|
-
|
|
14153
|
+
### Map the route and data model
|
|
13847
14154
|
|
|
13848
|
-
|
|
14155
|
+
Starting point
|
|
14156
|
+
Nifra adapter and page
|
|
14157
|
+
Move server data to
|
|
13849
14158
|
|
|
13850
|
-
|
|
14159
|
+
Next.js, Remix, React Router
|
|
14160
|
+
React, `routes/example.tsx`
|
|
14161
|
+
route `.backend.ts`
|
|
13851
14162
|
|
|
13852
|
-
|
|
14163
|
+
Preact SSR / Fresh
|
|
14164
|
+
Preact, `routes/example.tsx`
|
|
14165
|
+
route `.backend.ts`
|
|
13853
14166
|
|
|
13854
|
-
|
|
14167
|
+
SolidStart
|
|
14168
|
+
Solid, `routes/example.tsx`
|
|
14169
|
+
route `.backend.ts`
|
|
13855
14170
|
|
|
13856
|
-
|
|
14171
|
+
Nuxt
|
|
14172
|
+
Vue, `routes/example.vue`
|
|
14173
|
+
route `.backend.ts`
|
|
13857
14174
|
|
|
13858
|
-
|
|
14175
|
+
SvelteKit
|
|
14176
|
+
Svelte, `routes/example.svelte`
|
|
14177
|
+
route `.backend.ts`
|
|
13859
14178
|
|
|
13860
|
-
|
|
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
|
-
|
|
13863
|
-
Nifra's client router - `Link` + hover/focus prefetch, scroll restoration
|
|
14185
|
+
### Move data loading and mutations once
|
|
13864
14186
|
|
|
13865
|
-
`
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
14210
|
+
### React - Next.js, Remix, and React Router
|
|
13872
14211
|
|
|
13873
|
-
|
|
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
|
-
|
|
13876
|
-
|
|
13877
|
-
|
|
14218
|
+
```tsx
|
|
14219
|
+
// routes/users/[id].tsx - React page, data is inferred from loaderOutput
|
|
14220
|
+
import type { Route } from "./+types/[id]"
|
|
13878
14221
|
|
|
13879
|
-
|
|
14222
|
+
export default function User({ data }: Route.ComponentProps) {
|
|
14223
|
+
return <h1>{data.name}</h1>
|
|
14224
|
+
}
|
|
14225
|
+
```
|
|
13880
14226
|
|
|
13881
|
-
|
|
14227
|
+
### Preact - Preact SSR and Fresh
|
|
13882
14228
|
|
|
13883
|
-
|
|
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
|
-
|
|
13886
|
-
|
|
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
|
-
|
|
14238
|
+
export default function User({ data }: Route.ComponentProps) {
|
|
14239
|
+
return <h1>{data.name}</h1>
|
|
14240
|
+
}
|
|
14241
|
+
```
|
|
13889
14242
|
|
|
13890
|
-
|
|
13891
|
-
Opening a route in a modal
|
|
14243
|
+
### Solid - SolidStart
|
|
13892
14244
|
|
|
13893
|
-
|
|
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
|
-
|
|
13896
|
-
|
|
14248
|
+
```tsx
|
|
14249
|
+
// routes/users/[id].tsx - keep Solid components and JSX
|
|
14250
|
+
import type { Route } from "./+types/[id]"
|
|
13897
14251
|
|
|
13898
|
-
|
|
14252
|
+
export default function User(props: Route.ComponentProps) {
|
|
14253
|
+
return <h1>{props.data.name}</h1>
|
|
14254
|
+
}
|
|
14255
|
+
```
|
|
13899
14256
|
|
|
13900
|
-
|
|
13901
|
-
in-process during SSR - no `fetch` to your own API, no untyped JSON.
|
|
14257
|
+
### Vue - Nuxt
|
|
13902
14258
|
|
|
13903
|
-
|
|
13904
|
-
|
|
13905
|
-
|
|
13906
|
-
|
|
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
|
-
|
|
13912
|
-
|
|
13913
|
-
|
|
13914
|
-
|
|
13915
|
-
|
|
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
|
-
|
|
13920
|
-
|
|
13921
|
-
|
|
13922
|
-
}
|
|
14270
|
+
<template>
|
|
14271
|
+
<h1>{{ props.data.name }}</h1>
|
|
14272
|
+
</template>
|
|
13923
14273
|
```
|
|
13924
14274
|
|
|
13925
|
-
### Svelte
|
|
14275
|
+
### Svelte - SvelteKit
|
|
13926
14276
|
|
|
13927
|
-
|
|
13928
|
-
|
|
13929
|
-
|
|
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
|
-
```
|
|
13933
|
-
|
|
13934
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
14290
|
+
### Map the rest of your frontend
|
|
13942
14291
|
|
|
13943
|
-
|
|
13944
|
-
|
|
13945
|
-
app.
|
|
14292
|
+
Existing feature
|
|
14293
|
+
Nifra equivalent
|
|
13946
14294
|
|
|
13947
|
-
|
|
13948
|
-
|
|
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
|
-
|
|
13955
|
-
|
|
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
|
-
|
|
13958
|
-
|
|
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.
|
|
19306
|
-
|
|
19307
|
-
|
|
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
|
|