@nifrajs/cli 5.13.0 → 5.15.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/README.md +3 -1
- package/dist/agent-files.js +0 -74
- package/dist/agent-files.js.map +1 -1
- package/dist/app-files.js +0 -19
- package/dist/app-files.js.map +1 -1
- package/dist/assure-hydration.js +0 -23
- package/dist/assure-hydration.js.map +1 -1
- package/dist/assure.js +0 -14
- package/dist/assure.js.map +1 -1
- package/dist/capabilities-tool.js +0 -51
- package/dist/capabilities-tool.js.map +1 -1
- package/dist/cdn-check.js +0 -2
- package/dist/cdn-check.js.map +1 -1
- package/dist/check-diagnostics.d.ts.map +1 -1
- package/dist/check-diagnostics.js +22 -31
- package/dist/check-diagnostics.js.map +1 -1
- package/dist/check-scan.d.ts.map +1 -1
- package/dist/check-scan.js +17 -622
- package/dist/check-scan.js.map +1 -1
- package/dist/check.js +0 -86
- package/dist/check.js.map +1 -1
- package/dist/cli.js +3 -336
- package/dist/cli.js.map +1 -1
- package/dist/client-module.js +0 -13
- package/dist/client-module.js.map +1 -1
- package/dist/command-catalog.js +0 -21
- package/dist/command-catalog.js.map +1 -1
- package/dist/component-check.js +1 -7
- package/dist/component-check.js.map +1 -1
- package/dist/config-target.js +0 -13
- package/dist/config-target.js.map +1 -1
- package/dist/contract-proof.js +0 -1
- package/dist/contract-proof.js.map +1 -1
- package/dist/contracts.js +0 -36
- package/dist/contracts.js.map +1 -1
- package/dist/db-audit.js +0 -15
- package/dist/db-audit.js.map +1 -1
- package/dist/db-child.js +0 -20
- package/dist/db-child.js.map +1 -1
- package/dist/db-config.js +0 -23
- package/dist/db-config.js.map +1 -1
- package/dist/db-tool.js +0 -24
- package/dist/db-tool.js.map +1 -1
- package/dist/deployment-adapters.js +1 -7
- package/dist/deployment-adapters.js.map +1 -1
- package/dist/dev-bun-config.js +0 -102
- package/dist/dev-bun-config.js.map +1 -1
- package/dist/dev-feed-tool.js +0 -32
- package/dist/dev-feed-tool.js.map +1 -1
- package/dist/dev-server-client.js +0 -16
- package/dist/dev-server-client.js.map +1 -1
- package/dist/diagnostics.js +0 -10
- package/dist/diagnostics.js.map +1 -1
- package/dist/diff-tool.js +0 -23
- package/dist/diff-tool.js.map +1 -1
- package/dist/docs-search.js +0 -35
- package/dist/docs-search.js.map +1 -1
- package/dist/doctor.js +3 -161
- package/dist/doctor.js.map +1 -1
- package/dist/env-file.js +0 -66
- package/dist/env-file.js.map +1 -1
- package/dist/examples.js +0 -16
- package/dist/examples.js.map +1 -1
- package/dist/fix-recipes.js +0 -20
- package/dist/fix-recipes.js.map +1 -1
- package/dist/frontend-guidance.js +12 -48
- package/dist/frontend-guidance.js.map +1 -1
- package/dist/hand-built-manifest.js +0 -17
- package/dist/hand-built-manifest.js.map +1 -1
- package/dist/hooks-report.js +0 -4
- package/dist/hooks-report.js.map +1 -1
- package/dist/i18n-check.js +0 -30
- package/dist/i18n-check.js.map +1 -1
- package/dist/init-agents.js +1 -133
- package/dist/init-agents.js.map +1 -1
- package/dist/internal/code-unit-order.js +0 -2
- package/dist/internal/code-unit-order.js.map +1 -1
- package/dist/internal/config-paths.js +0 -12
- package/dist/internal/config-paths.js.map +1 -1
- package/dist/internal/control-character.js +0 -1
- package/dist/internal/control-character.js.map +1 -1
- package/dist/internal/escape-regexp.d.ts +1 -2
- package/dist/internal/escape-regexp.d.ts.map +1 -1
- package/dist/internal/escape-regexp.js +1 -4
- package/dist/internal/escape-regexp.js.map +1 -1
- package/dist/internal/git-ignored.js +0 -11
- package/dist/internal/git-ignored.js.map +1 -1
- package/dist/internal/installed-package.js +0 -2
- package/dist/internal/installed-package.js.map +1 -1
- package/dist/internal/line-at.js +0 -1
- package/dist/internal/line-at.js.map +1 -1
- package/dist/internal/nifra-project.js +0 -31
- package/dist/internal/nifra-project.js.map +1 -1
- package/dist/internal/posix-path.js +0 -1
- package/dist/internal/posix-path.js.map +1 -1
- package/dist/internal/project-specifiers.js +0 -34
- package/dist/internal/project-specifiers.js.map +1 -1
- package/dist/internal/realpath-or-self.js +0 -1
- package/dist/internal/realpath-or-self.js.map +1 -1
- package/dist/internal/record.d.ts +1 -1
- package/dist/internal/record.d.ts.map +1 -1
- package/dist/internal/record.js +1 -4
- package/dist/internal/record.js.map +1 -1
- package/dist/internal/reserved-segment-codemod.js +0 -44
- package/dist/internal/reserved-segment-codemod.js.map +1 -1
- package/dist/internal/script-kind.js +0 -5
- package/dist/internal/script-kind.js.map +1 -1
- package/dist/internal/source-facts.js +3 -37
- package/dist/internal/source-facts.js.map +1 -1
- package/dist/internal/typescript-import.js +0 -49
- package/dist/internal/typescript-import.js.map +1 -1
- package/dist/internal/workspace-packages.js +0 -24
- package/dist/internal/workspace-packages.js.map +1 -1
- package/dist/introspect.js +1 -89
- package/dist/introspect.js.map +1 -1
- package/dist/learn.js +0 -16
- package/dist/learn.js.map +1 -1
- package/dist/levels-tool.js +0 -34
- package/dist/levels-tool.js.map +1 -1
- package/dist/load.js +0 -75
- package/dist/load.js.map +1 -1
- package/dist/local-cli.js +0 -23
- package/dist/local-cli.js.map +1 -1
- package/dist/lock-links.js +0 -20
- package/dist/lock-links.js.map +1 -1
- package/dist/manifest-tool.js +0 -5
- package/dist/manifest-tool.js.map +1 -1
- package/dist/mcp-app-tool.js +0 -9
- package/dist/mcp-app-tool.js.map +1 -1
- package/dist/mcp-context.js +0 -30
- package/dist/mcp-context.js.map +1 -1
- package/dist/mcp-delegate.js +0 -45
- package/dist/mcp-delegate.js.map +1 -1
- package/dist/mcp-docs-tools.js +0 -13
- package/dist/mcp-docs-tools.js.map +1 -1
- package/dist/mcp-exec.js +0 -71
- package/dist/mcp-exec.js.map +1 -1
- package/dist/mcp-http.js +1 -38
- package/dist/mcp-http.js.map +1 -1
- package/dist/mcp-io.d.ts +5 -1
- package/dist/mcp-io.d.ts.map +1 -1
- package/dist/mcp-io.js +3 -68
- package/dist/mcp-io.js.map +1 -1
- package/dist/mcp-isolate.js +0 -28
- package/dist/mcp-isolate.js.map +1 -1
- package/dist/mcp-path.js +0 -8
- package/dist/mcp-path.js.map +1 -1
- package/dist/mcp-project-child.js +0 -19
- package/dist/mcp-project-child.js.map +1 -1
- package/dist/mcp-protocol.js +0 -5
- package/dist/mcp-protocol.js.map +1 -1
- package/dist/mcp-reflect.js +0 -11
- package/dist/mcp-reflect.js.map +1 -1
- package/dist/mcp-relay.d.ts +4 -0
- package/dist/mcp-relay.d.ts.map +1 -1
- package/dist/mcp-relay.js +9 -20
- package/dist/mcp-relay.js.map +1 -1
- package/dist/mcp-render.js +1 -42
- package/dist/mcp-render.js.map +1 -1
- package/dist/mcp-root.js +0 -90
- package/dist/mcp-root.js.map +1 -1
- package/dist/mcp-run.js +1 -38
- package/dist/mcp-run.js.map +1 -1
- package/dist/mcp-tool-meta.js +3 -8
- package/dist/mcp-tool-meta.js.map +1 -1
- package/dist/mcp-ws.js +0 -16
- package/dist/mcp-ws.js.map +1 -1
- package/dist/mcp.js +0 -86
- package/dist/mcp.js.map +1 -1
- package/dist/migrate-layout.js +0 -313
- package/dist/migrate-layout.js.map +1 -1
- package/dist/openapi-tool.js +0 -18
- package/dist/openapi-tool.js.map +1 -1
- package/dist/openapi-types.js +0 -22
- package/dist/openapi-types.js.map +1 -1
- package/dist/output-schemas.js +0 -67
- package/dist/output-schemas.js.map +1 -1
- package/dist/pipeline-guard.js +0 -58
- package/dist/pipeline-guard.js.map +1 -1
- package/dist/pipeline-report.js +0 -71
- package/dist/pipeline-report.js.map +1 -1
- package/dist/port.js +1 -89
- package/dist/port.js.map +1 -1
- package/dist/ppr-read-fix.js +0 -29
- package/dist/ppr-read-fix.js.map +1 -1
- package/dist/project-facts.js +0 -5
- package/dist/project-facts.js.map +1 -1
- package/dist/project-path.js +0 -7
- package/dist/project-path.js.map +1 -1
- package/dist/project-site.js +0 -2
- package/dist/project-site.js.map +1 -1
- package/dist/recipes/1.8.0.js +0 -9
- package/dist/recipes/1.8.0.js.map +1 -1
- package/dist/recipes/2.0.0.js +0 -6
- package/dist/recipes/2.0.0.js.map +1 -1
- package/dist/recipes/3.0.0.js +0 -7
- package/dist/recipes/3.0.0.js.map +1 -1
- package/dist/recipes/4.0.0.js +0 -6
- package/dist/recipes/4.0.0.js.map +1 -1
- package/dist/recipes/5.0.0.js +0 -8
- package/dist/recipes/5.0.0.js.map +1 -1
- package/dist/recipes/5.1.0.js +0 -6
- package/dist/recipes/5.1.0.js.map +1 -1
- package/dist/recipes/5.10.0.js +0 -10
- package/dist/recipes/5.10.0.js.map +1 -1
- package/dist/recipes/5.11.0.js +0 -7
- package/dist/recipes/5.11.0.js.map +1 -1
- package/dist/recipes/5.12.0.js +0 -6
- package/dist/recipes/5.12.0.js.map +1 -1
- package/dist/recipes/5.13.0.js +0 -6
- package/dist/recipes/5.13.0.js.map +1 -1
- package/dist/recipes/5.14.0.d.ts +10 -0
- package/dist/recipes/5.14.0.d.ts.map +1 -0
- package/dist/recipes/5.14.0.js +26 -0
- package/dist/recipes/5.14.0.js.map +1 -0
- package/dist/recipes/5.15.0.d.ts +12 -0
- package/dist/recipes/5.15.0.d.ts.map +1 -0
- package/dist/recipes/5.15.0.js +30 -0
- package/dist/recipes/5.15.0.js.map +1 -0
- package/dist/recipes/5.2.0.js +0 -7
- package/dist/recipes/5.2.0.js.map +1 -1
- package/dist/recipes/5.3.0.js +0 -8
- package/dist/recipes/5.3.0.js.map +1 -1
- package/dist/recipes/5.4.0.js +0 -8
- package/dist/recipes/5.4.0.js.map +1 -1
- package/dist/recipes/5.5.0.js +0 -6
- package/dist/recipes/5.5.0.js.map +1 -1
- package/dist/recipes/5.6.0.js +0 -7
- package/dist/recipes/5.6.0.js.map +1 -1
- package/dist/recipes/5.7.0.js +0 -9
- package/dist/recipes/5.7.0.js.map +1 -1
- package/dist/recipes/5.8.0.js +0 -6
- package/dist/recipes/5.8.0.js.map +1 -1
- package/dist/recipes/5.9.0.js +0 -9
- package/dist/recipes/5.9.0.js.map +1 -1
- package/dist/recipes/index.d.ts.map +1 -1
- package/dist/recipes/index.js +4 -9
- package/dist/recipes/index.js.map +1 -1
- package/dist/release-verification.js +0 -14
- package/dist/release-verification.js.map +1 -1
- package/dist/replay.js +0 -3
- package/dist/replay.js.map +1 -1
- package/dist/review.js +0 -21
- package/dist/review.js.map +1 -1
- package/dist/route-types.js +0 -17
- package/dist/route-types.js.map +1 -1
- package/dist/rule-explain.js +0 -5
- package/dist/rule-explain.js.map +1 -1
- package/dist/rules/codes.js +0 -2
- package/dist/rules/codes.js.map +1 -1
- package/dist/rules/comment-markers.js +0 -25
- package/dist/rules/comment-markers.js.map +1 -1
- package/dist/rules/contract-visibility.js +0 -27
- package/dist/rules/contract-visibility.js.map +1 -1
- package/dist/rules/data-guard.js +1 -52
- package/dist/rules/data-guard.js.map +1 -1
- package/dist/rules/internal-links.js +0 -36
- package/dist/rules/internal-links.js.map +1 -1
- package/dist/rules/islands.js +2 -65
- package/dist/rules/islands.js.map +1 -1
- package/dist/rules/layout.js +0 -1
- package/dist/rules/layout.js.map +1 -1
- package/dist/rules/legacy.js +0 -31
- package/dist/rules/legacy.js.map +1 -1
- package/dist/rules/merge-auth.js +0 -9
- package/dist/rules/merge-auth.js.map +1 -1
- package/dist/rules/pages.js +0 -95
- package/dist/rules/pages.js.map +1 -1
- package/dist/rules/ppr.js +0 -8
- package/dist/rules/ppr.js.map +1 -1
- package/dist/rules/route-statement.js +0 -13
- package/dist/rules/route-statement.js.map +1 -1
- package/dist/rules/routes.js +1 -67
- package/dist/rules/routes.js.map +1 -1
- package/dist/rules/secrets.js +0 -15
- package/dist/rules/secrets.js.map +1 -1
- package/dist/rules/security.js +0 -113
- package/dist/rules/security.js.map +1 -1
- package/dist/rules/server-fn-namespace.js +0 -5
- package/dist/rules/server-fn-namespace.js.map +1 -1
- package/dist/rules/source-scan.js +0 -5
- package/dist/rules/source-scan.js.map +1 -1
- package/dist/rules/swap.js +0 -21
- package/dist/rules/swap.js.map +1 -1
- package/dist/rules/text-slot-boolean.js +0 -5
- package/dist/rules/text-slot-boolean.js.map +1 -1
- package/dist/rules/typescript.js +0 -5
- package/dist/rules/typescript.js.map +1 -1
- package/dist/rules/undeclared-response.js +0 -8
- package/dist/rules/undeclared-response.js.map +1 -1
- package/dist/rules/zones.js +0 -45
- package/dist/rules/zones.js.map +1 -1
- package/dist/runtime-differences.js +0 -20
- package/dist/runtime-differences.js.map +1 -1
- package/dist/scaffold-hole.js +1 -45
- package/dist/scaffold-hole.js.map +1 -1
- package/dist/scaffold.js +3 -60
- package/dist/scaffold.js.map +1 -1
- package/dist/sdk.js +1 -13
- package/dist/sdk.js.map +1 -1
- package/dist/search-terms.js +0 -12
- package/dist/search-terms.js.map +1 -1
- package/dist/shell-files.js +0 -15
- package/dist/shell-files.js.map +1 -1
- package/dist/shell-init.js +0 -15
- package/dist/shell-init.js.map +1 -1
- package/dist/smoke.js +0 -4
- package/dist/smoke.js.map +1 -1
- package/dist/source-rewrites.js +0 -43
- package/dist/source-rewrites.js.map +1 -1
- package/dist/stylex-migrate.js +0 -29
- package/dist/stylex-migrate.js.map +1 -1
- package/dist/symptom-search.js +0 -3
- package/dist/symptom-search.js.map +1 -1
- package/dist/sync-manifest.js +3 -33
- package/dist/sync-manifest.js.map +1 -1
- package/dist/test-tool.js +0 -10
- package/dist/test-tool.js.map +1 -1
- package/dist/typecheck-coverage.js +0 -36
- package/dist/typecheck-coverage.js.map +1 -1
- package/dist/types-search.js +0 -35
- package/dist/types-search.js.map +1 -1
- package/dist/upgrade.js +0 -214
- package/dist/upgrade.js.map +1 -1
- package/dist/verification-plan.js +0 -19
- package/dist/verification-plan.js.map +1 -1
- package/dist/verification.js +0 -23
- package/dist/verification.js.map +1 -1
- package/dist/version-drift.js +0 -8
- package/dist/version-drift.js.map +1 -1
- package/dist/web-app-options.js +0 -16
- package/dist/web-app-options.js.map +1 -1
- package/dist/work-graph.js +0 -21
- package/dist/work-graph.js.map +1 -1
- package/dist/workspace-link.js +0 -31
- package/dist/workspace-link.js.map +1 -1
- package/docs/examples.json +7 -1
- package/docs/llms-full.txt +422 -44
- package/docs/types.json +193 -16
- package/package.json +12 -11
- package/src/assure-hydration.ts +3 -3
- package/src/check-diagnostics.ts +26 -2
- package/src/check-scan.ts +8 -1
- package/src/cli.ts +5 -5
- package/src/frontend-guidance.ts +12 -12
- package/src/internal/escape-regexp.ts +1 -4
- package/src/internal/record.ts +1 -3
- package/src/internal/typescript-import.ts +1 -1
- package/src/mcp-http.ts +1 -1
- package/src/mcp-io.ts +8 -5
- package/src/mcp-relay.ts +19 -7
- package/src/mcp-render.ts +1 -1
- package/src/mcp-tool-meta.ts +3 -3
- package/src/recipes/5.14.0.ts +34 -0
- package/src/recipes/5.15.0.ts +40 -0
- package/src/recipes/index.ts +4 -0
package/docs/llms-full.txt
CHANGED
|
@@ -12,7 +12,7 @@ nifra is a Bun-native, contract-first, framework-agnostic full-stack TypeScript
|
|
|
12
12
|
- **Secure by default.** Body-size cap, `requestTimeoutMs` + `c.signal`, graceful shutdown, redacting logger, same-origin `redirect()`, constant-time secret comparison, fail-closed middleware.
|
|
13
13
|
- **Money** in integer minor units; **time** parsed to absolute UTC at the boundary.
|
|
14
14
|
- Throwing a `Response` anywhere in the lifecycle is control flow (returned as-is), not an error.
|
|
15
|
-
Optional server components (all five adapters): React, Preact, Vue, Svelte and Solid share owner-GET admission, closed input/public-props schemas and private/no-store output. React uses native RSC/Flight. Use *.component.server.ts(x), defineServerComponent, an explicit componentPipeline named config export, native outlets and bindComponentRouter. Await invalidateComponentScope on identity/tenant/permission changes. Component GETs cannot acquire domain write privileges; use validated serverFn/actions for mutations. Native use-server actions are unsupported. Pin the certified compiler tuple documented in /docs/server-components.
|
|
15
|
+
Optional server components (all five adapters): React, Preact, Vue, Svelte and Solid share owner-GET admission, closed input/public-props schemas and private/no-store output. React uses native RSC/Flight; Vue, Svelte, Preact and the current Solid 1.x adapter use explicitly registered islands in validated server-rendered ranges. Solid 2's experimental frames protocol is not currently targeted. Use *.component.server.ts(x), defineServerComponent, an explicit componentPipeline named config export, native outlets and bindComponentRouter. Await invalidateComponentScope on identity/tenant/permission changes. Component GETs cannot acquire domain write privileges; use validated serverFn/actions for mutations. Native use-server actions are unsupported. Pin the certified compiler tuple documented in /docs/server-components.
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
@@ -239,11 +239,16 @@ implementation, secrets and database handles off the browser and use the same va
|
|
|
239
239
|
mutation API across the supported UI libraries.
|
|
240
240
|
|
|
241
241
|
The optional server-components pipeline adds
|
|
242
|
-
server-only views and state-preserving refresh
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
242
|
+
server-only views and state-preserving refresh, but the render protocol depends on the UI
|
|
243
|
+
library. React uses native RSC/Flight. In Nifra's current certified adapters, Vue, Svelte,
|
|
244
|
+
Solid and Preact use an owned server-rendered range with schema-checked JSON props and
|
|
245
|
+
explicitly registered client islands as separate native roots; they do not emulate Flight.
|
|
246
|
+
Nested ranges, slots and data crossing those roots are explicit. Solid 2 has its own
|
|
247
|
+
experimental server-component frames protocol, but Nifra's current Solid tuple does not
|
|
248
|
+
target it. The shared certification covers admission, ownership, prop validation, limits and
|
|
249
|
+
safe hydration - it does not mean identical React component semantics.
|
|
250
|
+
A partially prerendered page can show a server component in a hole. Server functions remain
|
|
251
|
+
the mutation API; native React `"use server"` actions are unsupported.
|
|
247
252
|
|
|
248
253
|
### Caching and fresh data
|
|
249
254
|
|
|
@@ -294,14 +299,14 @@ to full-stack later without a rewrite.
|
|
|
294
299
|
**Throughput - the realistic case.** Router micro-benchmarks flatter Hono (a single compiled
|
|
295
300
|
regex), but a real request also pays for middleware and validation,
|
|
296
301
|
context, and serialization. In the current matrix Nifra runs **level with Elysia on Bun** -
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
**level with Fastify on Node** (
|
|
302
|
+
100% of Elysia on `GET /users/:id` and
|
|
303
|
+
100% on the validated `POST` - and
|
|
304
|
+
**level with Fastify on Node** (107% of Fastify on GET,
|
|
300
305
|
105% on the validated `POST`), with Elysia, Hono,
|
|
301
|
-
and Express behind. On **Deno** it runs at
|
|
302
|
-
GET and
|
|
306
|
+
and Express behind. On **Deno** it runs at 107% of Elysia on
|
|
307
|
+
GET and 127% on the validated `POST`. In the realistic shape (security headers + CORS +
|
|
303
308
|
bearer auth + cookies + validated query/body + a ~2.4 KB JSON response, measured on
|
|
304
|
-
**Bun** with `oha`) Nifra runs at **
|
|
309
|
+
**Bun** with `oha`) Nifra runs at **110% of Elysia on GET and 114% on POST**. Treat benchmark
|
|
305
310
|
rows as same-run evidence, not a permanent law of nature.
|
|
306
311
|
|
|
307
312
|
-
|
|
@@ -1424,6 +1429,33 @@ export const app = server()
|
|
|
1424
1429
|
app.listen(3000)
|
|
1425
1430
|
```
|
|
1426
1431
|
|
|
1432
|
+
### Echoing a path parameter
|
|
1433
|
+
|
|
1434
|
+
`echoParam(path)` answers a GET route with its final path parameter as
|
|
1435
|
+
`text/plain`, **exactly as the request spelled it**: percent-escapes are left
|
|
1436
|
+
in, not decoded. Pass it the route's own path, a static prefix and one final
|
|
1437
|
+
`:name` segment; anything else throws. That fixed contract lets a transport that
|
|
1438
|
+
matches paths itself answer the route without calling the app:
|
|
1439
|
+
`@nifrajs/node-uws` does, under the same conditions as
|
|
1440
|
+
`staticResponse()`, and only while no other route can match a request the echo
|
|
1441
|
+
route would answer. The reply carries `X-Content-Type-Options: nosniff`.
|
|
1442
|
+
The answer is defined by the path you pass: a request that does not match it (the handler
|
|
1443
|
+
registered elsewhere) gets the decoded value, one that does gets its final segment as sent,
|
|
1444
|
+
whatever route matched it. Two inputs are outside
|
|
1445
|
+
the contract: a malformed escape such as `%zz` is echoed as sent when the node-uws
|
|
1446
|
+
native lane answers the route and refused with 400 by ordinary routing (a request hook, for
|
|
1447
|
+
one, sends it there), and a segment of only dots written as escapes is read differently by
|
|
1448
|
+
each runtime's URL parser.
|
|
1449
|
+
|
|
1450
|
+
```ts
|
|
1451
|
+
import { echoParam, server } from "@nifrajs/core/server"
|
|
1452
|
+
|
|
1453
|
+
const USER = "/user/:id"
|
|
1454
|
+
|
|
1455
|
+
export const app = server().get(USER, echoParam(USER))
|
|
1456
|
+
// GET /user/%41b answers 200 text/plain with the body %41b
|
|
1457
|
+
```
|
|
1458
|
+
|
|
1427
1459
|
Prefer `c.set` over returning a raw `Response`. A `Response`
|
|
1428
1460
|
return makes the typed client infer `data: never`, so you silently lose drift
|
|
1429
1461
|
detection for that route (`nifra check` flags it, NF-C007). `c.set`
|
|
@@ -2194,7 +2226,228 @@ public registration API rather than as a bespoke dispatcher.
|
|
|
2194
2226
|
|
|
2195
2227
|
## Nifra - Server components
|
|
2196
2228
|
|
|
2197
|
-
> Server-only views with
|
|
2229
|
+
> Server-only views with closed schemas and owner-route authorization: native React RSC/Flight, or explicit server-rendered ranges and client islands for Vue, Svelte, Solid and Preact.
|
|
2230
|
+
|
|
2231
|
+
Compose server-only views and refresh their content while keeping native client state. React uses native RSC and Flight. Nifra's current certified Vue, Svelte, Solid and Preact adapters use schema-guarded server-rendered ranges with explicitly registered client islands, not a Flight-equivalent protocol.
|
|
2232
|
+
|
|
2233
|
+
This additive feature shipped in 5.0.0. All five adapters pass the same admission, ownership, limits and hydration-safety certification; that shared certification does not make their component semantics identical. Ordinary SSR, loaders, islands and server functions keep their existing APIs.
|
|
2234
|
+
|
|
2235
|
+
### Execution and public props
|
|
2236
|
+
|
|
2237
|
+
A `*.component.server.ts` or `*.component.server.tsx` module declares a closed input schema, closed public-props schema, authorization, a read operation and a view. The compiler replaces browser imports with an opaque typed handle. The server implementation and its imports stay in the server build.
|
|
2238
|
+
|
|
2239
|
+
```ts
|
|
2240
|
+
// Product.component.server.ts - native Vue/Svelte/Solid view.
|
|
2241
|
+
import { t } from "@nifrajs/schema"
|
|
2242
|
+
import { defineServerComponent, type ServerComponentContext } from "@nifrajs/web/server-components"
|
|
2243
|
+
import { nativeServerView } from "@nifrajs/web/server-components/islands"
|
|
2244
|
+
|
|
2245
|
+
// Replace these declarations with your native view and scoped read service.
|
|
2246
|
+
declare const ProductView: unknown
|
|
2247
|
+
declare function readProduct(ctx: ServerComponentContext, id: string): Promise<{ title: string; internal: string }>
|
|
2248
|
+
|
|
2249
|
+
export const Product = defineServerComponent({
|
|
2250
|
+
input: t.object({ id: t.string({ minLength: 1 }) }),
|
|
2251
|
+
props: t.object({ title: t.string() }),
|
|
2252
|
+
authorize(ctx, input) {
|
|
2253
|
+
if (ctx.params.id !== input.id) throw new Response(null, { status: 403 })
|
|
2254
|
+
},
|
|
2255
|
+
load: (ctx, input) => readProduct(ctx, input.id),
|
|
2256
|
+
view: () => nativeServerView(ProductView),
|
|
2257
|
+
})
|
|
2258
|
+
```
|
|
2259
|
+
|
|
2260
|
+
The input is validated before component authorization and loading. The load result is projected through the props schema, so undeclared fields such as `internal` never reach the view or browser. The view receives `{ props, children }`. Public values are bounded JSON: finite numbers, strings, booleans, null, arrays and plain objects. Functions, framework contexts, requests, bindings, class instances and executable closures cannot cross this seam.
|
|
2261
|
+
|
|
2262
|
+
Keep ownership checks in the scoped read service too. Every definition requires an authorization callback. Use `inheritOwnerAuthorization` only when the owning route already enforces the full resource authorization; it records an intentional choice to reuse that admission.
|
|
2263
|
+
|
|
2264
|
+
### Why non-React adapters use ranges
|
|
2265
|
+
|
|
2266
|
+
RSC is a React wire-format and runtime contract, not a generic SSR feature that every UI library can share. For the current Vue, Svelte, Solid and Preact adapters, the portable unit is an owned server-rendered HTML range: Nifra calls that framework's own SSR renderer for the range, places registered client islands behind owned markers, and sends bounded JSON props plus validated slot and nested-range HTML. The browser's matching native adapter then creates independent roots for those islands and updates their props or remounts them according to their stable reference and key. The server-rendered range itself is not interactive.
|
|
2267
|
+
|
|
2268
|
+
This is intentionally narrower than React RSC/Flight: non-React adapters do not have a Flight payload, server references, serialized closures, or automatic React-style server/client tree composition. Named slots and nested server ranges must be registered explicitly, and a separate native root does not inherit outer page context; pass the needed public data explicitly. Domain writes still go through a validated server function or route action, followed by a component refresh. Native `"use server"` actions are not part of Nifra's component contract.
|
|
2269
|
+
|
|
2270
|
+
Solid 2.0 also ships its own reactive server components behind `serverFunctions: { components: true }`, applied in the browser through Solid's frames runtime. Nifra does not target that protocol: the Solid adapter uses ordinary Solid SSR and hydration inside the shared range/island contract, with the version tuple below. Frames would need a separate renderer and client setup, and would not turn the result into React Flight.
|
|
2271
|
+
|
|
2272
|
+
### Register the owning page
|
|
2273
|
+
|
|
2274
|
+
```ts
|
|
2275
|
+
// doc-check: skip - complete application entries are in examples/server-components.
|
|
2276
|
+
import { createWebApp } from "@nifrajs/web"
|
|
2277
|
+
import { componentBuild } from "@nifrajs/web/server-components/build-info"
|
|
2278
|
+
import { createServerComponents, serverComponentInstance } from "@nifrajs/web/server-components"
|
|
2279
|
+
import { vueServerComponents } from "@nifrajs/web-vue/server-components"
|
|
2280
|
+
import { Product } from "./Product.component.server"
|
|
2281
|
+
declare const deploymentId: string // stable and unique for this deployed environment
|
|
2282
|
+
|
|
2283
|
+
const components = createServerComponents({
|
|
2284
|
+
build: componentBuild,
|
|
2285
|
+
deployment: deploymentId,
|
|
2286
|
+
adapter: vueServerComponents(),
|
|
2287
|
+
owners: {
|
|
2288
|
+
"product/[id]": { // exact manifest route id, not a URL pattern
|
|
2289
|
+
components: [Product],
|
|
2290
|
+
scope: "anonymous", // personalized pages supply a public auth-scope token
|
|
2291
|
+
cache: {
|
|
2292
|
+
scope: "public",
|
|
2293
|
+
requestIndependent: true,
|
|
2294
|
+
revalidate: 300,
|
|
2295
|
+
tags: ["catalog"],
|
|
2296
|
+
},
|
|
2297
|
+
instances: (ctx) => [serverComponentInstance(Product, "product", { id: ctx.params.id })],
|
|
2298
|
+
},
|
|
2299
|
+
},
|
|
2300
|
+
})
|
|
2301
|
+
|
|
2302
|
+
export function createApp(clientEntry: string, assets: { styles?: readonly string[] }) {
|
|
2303
|
+
return createWebApp({ adapter, manifest, clientEntry, styles: assets.styles, serverComponents: components })
|
|
2304
|
+
}
|
|
2305
|
+
```
|
|
2306
|
+
|
|
2307
|
+
The owner lists the components and instances that may execute. A browser cannot invent a new instance or change its input. Initial HTML and hydration state reuse one execution. A refresh sends a bounded `x-nifra-component` selection to the actual owning page URL using same-origin GET.
|
|
2308
|
+
|
|
2309
|
+
Hooks, filesystem middleware, gate layouts, ordinary layouts and the page loader run before component work on both initial requests and refreshes. Ordinary layout and page loaders retain their parallel execution; use `gate: true` when a layout must block the page loader. Component execution preserves the admitted request's environment, API, response controls, cancellation, budgets and effect accounting.
|
|
2310
|
+
|
|
2311
|
+
Owners declare allowed capabilities and definitions may narrow that set. Domain writes are rejected in this GET path. Mutate through a validated server function or route action, then refresh after success. Native React `"use server"` actions and serialized closures are unsupported.
|
|
2312
|
+
|
|
2313
|
+
A partially prerendered page can instead show a component in a hole, rendered for each visitor after the shared shell; its route lists the component under `holes` rather than `owners`. See partial prerendering.
|
|
2314
|
+
|
|
2315
|
+
### Native views and client islands
|
|
2316
|
+
|
|
2317
|
+
React definitions return JSX in a compiler-generated RSC entry. `createReactComponentRenderer` resolves an allowlisted definition, guards its public props, and renders it with the plugin's React server renderer into a sanitized Flight stream. `reactServerComponents` consumes that stream, produces the initial HTML with React's server renderer, and carries the bounded Flight payload for hydration. The browser decodes the payload with React Flight and hydrates or creates a real React root; refreshes publish the next React tree into that root, preserving React state. One selected React component can additionally negotiate progressive Flight during an owner refresh; other cases use the bounded buffered response. Imported `"use client"` exports require a companion `*.props.ts` with a matching closed schema for every export. The compiler guards element creation and cloning before a client prop handoff.
|
|
2318
|
+
|
|
2319
|
+
Nifra's React path is still an opt-in owner/component pipeline, not a claim that every Nifra route becomes a Next.js App Router tree. Component inputs and public props are closed, bounded JSON; server references, serialized closures, arbitrary framework context and native React `"use server"` actions do not cross this public seam. Mutations use Nifra server functions or route actions, and progressive Flight is limited to one selected component with no mounted Nifra descendants. Multiple records, descendants, unsupported negotiation and all non-React adapters use the bounded buffered component response.
|
|
2320
|
+
|
|
2321
|
+
Vue, Svelte, Solid and Preact definitions return `nativeServerView(View, islands, ranges)`. Their native view receives public `props` plus named island and nested-range markup. Use `vueServerComponents()`, `svelteServerComponents()` or `solidServerComponents()` or `preactServerComponents()` with the matching client adapter.
|
|
2322
|
+
|
|
2323
|
+
Preact uses `preactServerComponents()` from `@nifrajs/web-preact/server-components`, `preactComponentClient({ islands })` from its `/client` subpath, and a typed `ServerComponent` from its `/outlet` subpath. Pass the controller or client adapter to the outlet and hydrate with Preact. Use `@preact/preset-vite` for JSX and development updates. Preact uses native Preact roots; `preact/compat` does not supply React Flight.
|
|
2324
|
+
|
|
2325
|
+
```ts
|
|
2326
|
+
// Counter.island.ts - compiler assigns an opaque reference.
|
|
2327
|
+
import { t } from "@nifrajs/schema"
|
|
2328
|
+
import { defineClientIsland, clientIsland } from "@nifrajs/web/server-components/islands"
|
|
2329
|
+
declare function Counter(props: { title: string }): null
|
|
2330
|
+
|
|
2331
|
+
export const counter = defineClientIsland({
|
|
2332
|
+
props: t.object({ title: t.string() }), component: Counter, slots: ["summary"],
|
|
2333
|
+
})
|
|
2334
|
+
// Inside a server view, pass this named island to nativeServerView(...).
|
|
2335
|
+
export const instance = clientIsland(counter, "counter", { title: "Public title" }, {
|
|
2336
|
+
summary: "<p>Server-owned summary</p>",
|
|
2337
|
+
})
|
|
2338
|
+
```
|
|
2339
|
+
|
|
2340
|
+
A stable island reference, key and parent keep the native root, state, DOM node, focus and text selection. Changed keys remount. Removal awaits disposal; reappearance mounts a fresh root. Named slots contain validated server-owned HTML. Nested ranges must refer to registered children of that parent. Use `serverComponentIdentity` when registering a child's parent and `serverComponentChild` when selecting a child's render.
|
|
2341
|
+
|
|
2342
|
+
Each component range has its own native root. Native context belongs to that root and its descendants; outer page context is not implicitly shared across independent roots. Pass explicit public data when a separate root needs it. Managed portals must use `componentPortalTarget` from `@nifrajs/web/server-components/portal`; targets outside the owned range are rejected and cleanup is awaited.
|
|
2343
|
+
|
|
2344
|
+
Outlets are available from each adapter's `/server-components/outlet` export. React, Solid and Preact export `ServerComponent`; Svelte exports a native generic component as default. Vue also offers a specialized outlet for render functions and templates:
|
|
2345
|
+
|
|
2346
|
+
```ts
|
|
2347
|
+
// doc-check: skip - component fragment; Product is a compiler-generated client handle.
|
|
2348
|
+
import { h } from "vue"
|
|
2349
|
+
import { createServerComponentOutlet } from "@nifrajs/web-vue/server-components/outlet"
|
|
2350
|
+
import { Product } from "./Product.component.server"
|
|
2351
|
+
const ProductOutlet = createServerComponentOutlet(Product)
|
|
2352
|
+
// Specialization keeps h() and SFC template inputs tied to Product's schema.
|
|
2353
|
+
h(ProductOutlet, { state, instanceKey: "product", input: { id }, controller, clientAdapter })
|
|
2354
|
+
```
|
|
2355
|
+
|
|
2356
|
+
### Client entry, navigation and mutations
|
|
2357
|
+
|
|
2358
|
+
```ts
|
|
2359
|
+
// doc-check: skip - integrate with the native client entry, not a second page root.
|
|
2360
|
+
import { ComponentController, bindComponentRouter, invalidateComponentScope,
|
|
2361
|
+
parseComponentState, refreshAfterComponentMutation } from "@nifrajs/web/server-components/client"
|
|
2362
|
+
import { vueComponentClient } from "@nifrajs/web-vue/server-components/client"
|
|
2363
|
+
import { counter } from "./Counter.island"
|
|
2364
|
+
|
|
2365
|
+
const state = parseComponentState(hydrationState)
|
|
2366
|
+
const clientAdapter = vueComponentClient({ islands: [counter] })
|
|
2367
|
+
const controller = new ComponentController({ state, adapter: clientAdapter })
|
|
2368
|
+
// Pass state, controller and clientAdapter to the page's native outlet.
|
|
2369
|
+
const stop = bindComponentRouter(router)
|
|
2370
|
+
await refreshAfterComponentMutation(save({ text }), controller, [state.records[0].instance])
|
|
2371
|
+
await invalidateComponentScope() // await this on logout or permission/tenant changes
|
|
2372
|
+
// On application disposal: stop(); await controller.dispose()
|
|
2373
|
+
```
|
|
2374
|
+
|
|
2375
|
+
Use `props.serverComponents` from the server render to initialize the outlet and controller. Hydrate with the adapter's native API. Install `bindComponentRouter` for navigation, retained layouts, history and action revalidation, and dispose its subscription with the application. Mutation helpers refresh only an `ok: true` result; failures keep the current content.
|
|
2376
|
+
|
|
2377
|
+
Auth-scope tokens are public identifiers, never cookies or credentials. Personalized owners must change their scope when identity, tenant or permissions change. Await `invalidateComponentScope()` before displaying another subject's content. Invalidation clears private records and native roots; subsequent authorized navigation can restore structural outlets. Denied refreshes also clear the scope.
|
|
2378
|
+
|
|
2379
|
+
Route epochs, auth epochs, generations and build IDs prevent obsolete fetches, imports or native preparation from committing. A failed update disposes the affected range and reports a typed error. There is no automatic 4xx retry. Version mismatch permits at most one controlled document reload for that build.
|
|
2380
|
+
|
|
2381
|
+
### Build and development
|
|
2382
|
+
|
|
2383
|
+
```ts
|
|
2384
|
+
// doc-check: skip - Vue compiler is an app dependency; the isolated tarball consumer compiles this config with the pinned plugin.
|
|
2385
|
+
// nifra.config.ts - named exports; no default config object.
|
|
2386
|
+
import vue from "@vitejs/plugin-vue"
|
|
2387
|
+
import { vueAdapter } from "@nifrajs/web-vue"
|
|
2388
|
+
export const adapter = vueAdapter
|
|
2389
|
+
export const clientModule = "@nifrajs/web-vue/client"
|
|
2390
|
+
export const vitePlugins = [vue()]
|
|
2391
|
+
export const componentPipeline = {
|
|
2392
|
+
adapter: "vue" as const,
|
|
2393
|
+
entries: { client: "entry.client.ts", ssr: "entry.backend.ts" },
|
|
2394
|
+
}
|
|
2395
|
+
// entry.backend.ts exports createApp(clientEntry, assets).
|
|
2396
|
+
// React also requires entries.rsc and an RSC renderer registry.
|
|
2397
|
+
```
|
|
2398
|
+
|
|
2399
|
+
`nifra dev` and `nifra build --target node` select the coordinated Vite pipeline when `componentPipeline` is exported. Other targets are `bun`, `deno`, `cloudflare` and `vercel`. Bun remains a supported runtime. The programmatic APIs are `buildServerComponents` and `devServerComponents` from `@nifrajs/web/server-components/build`.
|
|
2400
|
+
|
|
2401
|
+
The pipeline has complete application client/SSR entries; React adds an RSC entry. It generates target serving code, an integrity manifest and one generation across server and client assets. It rejects an ordinary backend import into client code, unregistered client props, unsupported target builtins, foreign references and mixed build generations. Source edits restart all development environments together. `nifra check --json` validates source receipts without executing configuration.
|
|
2402
|
+
|
|
2403
|
+
Keep the certified compiler tuple pinned in the application lockfile. React's framework-facing RSC APIs require exact alignment even when ordinary React SSR allows a broader peer range. The pipeline reads component modules with the TypeScript compiler API, which TypeScript 7 does not ship: on TypeScript 7 the build stops with `NIFRA_TS_UNSUPPORTED`, and `nifra check` reports the same code and checks each component module as an ordinary backend import.
|
|
2404
|
+
|
|
2405
|
+
| Dependency | Certified tuple |
|
|
2406
|
+
| --- | --- |
|
|
2407
|
+
| React / React DOM / Flight | 19.3.1 / 19.3.1 / 19.3.1 |
|
|
2408
|
+
| Vue / plugin-vue | 3.5.45 / 6.0.11 |
|
|
2409
|
+
| Svelte / plugin-svelte | 5.57.3 / 7.3.1 |
|
|
2410
|
+
| Solid / @solidjs/vite-plugin | 2.0.0 / 3.0.1 |
|
|
2411
|
+
| Preact / render-to-string / preset-vite | 10.29.8 / 6.8.3 / 2.10.6 |
|
|
2412
|
+
| Vite / plugin-rsc | 8.3.8 / 0.5.39 |
|
|
2413
|
+
| TypeScript | 6.0.3 |
|
|
2414
|
+
|
|
2415
|
+
The runtime matrix covers Bun 1.3.14 and 1.4.4, Node 22.23.3 and 26.12.0, Deno 2.0.0 and 2.9.7, Cloudflare Workers and Pages under workerd compatibility date 2026-09-18, and Vercel's Node 22 entry. Browser certification uses Playwright 1.63.0 with Chromium 153.0.8010.12, Firefox 155.0 and WebKit 26.6. Vanilla retains ordinary SSR; its server-component opt-in is rejected.
|
|
2416
|
+
|
|
2417
|
+
### Streaming, caching and CSP
|
|
2418
|
+
|
|
2419
|
+
Progressive Flight currently applies to React owner refreshes for one selected component with no mounted Nifra descendants. Multiple components, descendants, other adapters, or refreshes without Flight negotiation use the bounded buffered response. This does not stream the initial owner HTML.
|
|
2420
|
+
|
|
2421
|
+
Enabling server components does not make every route private. Owner and hole-hosting routes and component transport responses remain `private, no-store` by default; non-owner routes keep their ordinary SSR and ISR behavior.
|
|
2422
|
+
|
|
2423
|
+
For a cacheable owner route, any request-header method called through `ctx.request.headers` or `ctx.req.headers` by route middleware, a layout or page loader, component authorization/loading, or app hooks registered through `createWebApp({ use })` disables shared storage for that response. A request replacement Nifra cannot inspect also disables storage. Nifra has no request-header variation key. `requestIndependent` remains the application's assertion for dependencies Nifra cannot observe, including database, environment, global, external-service, and hooks attached after app creation.
|
|
2424
|
+
|
|
2425
|
+
Initial owner-route HTML still waits for its complete state. Owner refreshes negotiate `application/vnd.nifra.component-flight-v1` only for one selected React record with no currently mounted Nifra descendants. The server sends a bounded metadata frame followed by sanitized Flight rows as they become ready. The client checks the closed metadata shape, route owner, build, identity scope and navigation epochs before handing the stream to React; each frame is checked for size, order, count and completion before its bytes reach Flight. React commits the record root and ready Suspense fallbacks while later Flight segments remain in flight, then reveals each boundary as its segment resolves. Refreshes with multiple Nifra records or currently mounted Nifra descendants, unsupported adapters or no Flight negotiation use the bounded buffered response. This refresh protocol stays separate from PPR and does not make refresh output cacheable.
|
|
2426
|
+
|
|
2427
|
+
An owner route is eligible for shared ISR only when its owner declares `cache: { scope: "public", requestIndependent: true, revalidate, tags }`. That contract covers the complete route, layouts and loaders, owner callbacks, component authorization and loading, and rendered output. Runtime also requires a static anonymous owner scope, a deployment identity, and no owner capabilities. Never opt in output derived from a user, credential, authorization decision or secret. Cache identity includes the canonical URL, deployment, build, adapter and route. Requests with credentials or accepted authentication state, data or swap mode, component refreshes, non-GET methods, errors, `Set-Cookie` or unsupported `Vary` bypass storage. Responses leaving Nifra remain `private, no-store`; only the configured Nifra ISR store keeps an approved document. To purge an owner route by path, pass the same app instance to `revalidateEndpoint({ app, store, secret })` so the purge uses the same deployment/build/route partition. Tag purges affect entries carrying the declared tag. Without the ISR wrapper, owner caching is disabled.
|
|
2428
|
+
|
|
2429
|
+
PPR holes keep their separate caching lifecycle. A nonce must be fresh per response; pass it through `createWebApp`. Strict CSP and Chromium Trusted Types are covered by the browser suite. If your policy requires Trusted Types, install `installComponentTrustedTypesPolicy()` from `@nifrajs/web/server-components/trusted-html` before hydration and allow the native framework's policy where required.
|
|
2430
|
+
|
|
2431
|
+
HTML, URLs, styles, slots and portal targets are validated before insertion. React-owned bootstrap scripts require the expected nonce; raw executable HTML and foreign script/assets are rejected. Per-input, per-stream, per-document, depth, concurrency, queue and deadline limits fail closed. Cancellation propagates to reads and native work; an uncooperative promise retains its admission slot until it settles.
|
|
2432
|
+
|
|
2433
|
+
Forms work without JavaScript. Successful actions reauthorize the owner GET exactly once. Parent-domain cookie changes, and Secure cookies on a request the app sees as `http:` (a TLS terminator in front), return 303 to the same path so the browser applies its cookie policy before the GET, preserving the action headers and cookies.
|
|
2434
|
+
|
|
2435
|
+
### Examples, verification and rollback
|
|
2436
|
+
|
|
2437
|
+
The repository contains runnable React, Vue, Svelte, Solid and Preact examples under `examples/server-components/`. They exercise native islands, nested ranges, slots, portals, actions and navigation. Their data, scope tokens and fixed nonce are certification fixtures; replace them with scoped application services, auth integration and fresh nonces before deployment.
|
|
2438
|
+
|
|
2439
|
+
```bash
|
|
2440
|
+
bun examples/server-components/react/run.ts
|
|
2441
|
+
bun examples/server-components/vue/run.ts
|
|
2442
|
+
bun examples/server-components/svelte/run.ts
|
|
2443
|
+
bun examples/server-components/solid/run.ts
|
|
2444
|
+
# Add build to emit a Bun production application.
|
|
2445
|
+
bun run check:server-components
|
|
2446
|
+
bun run check:server-components:consumers
|
|
2447
|
+
bun run check:server-components:performance
|
|
2448
|
+
```
|
|
2449
|
+
|
|
2450
|
+
Deploy the complete server build, integrity manifest and immutable assets together. Keep old hashed assets for the deployment overlap window. Roll back by redeploying the previous complete build. Disabling components requires rebuilding the application with an ordinary SSR fallback; component source cannot be dropped unchanged into an older runtime.
|
|
2198
2451
|
|
|
2199
2452
|
## Nifra - Optimistic UI & fetchers
|
|
2200
2453
|
|
|
@@ -2704,7 +2957,7 @@ function send(metric: WebVitalsMetric): void {
|
|
|
2704
2957
|
|
|
2705
2958
|
// Call it from the root layout's mount effect; the stop function it returns is the cleanup.
|
|
2706
2959
|
// React, Preact: useEffect(() => reportVitals(), [])
|
|
2707
|
-
// Svelte: onMount(reportVitals) Solid:
|
|
2960
|
+
// Svelte: onMount(reportVitals) Solid: onSettled(reportVitals)
|
|
2708
2961
|
// Vue: onMounted(() => (stop = reportVitals())), onUnmounted(() => stop())
|
|
2709
2962
|
export const reportVitals = () => reportWebVitals(send, { softNavigations: true })
|
|
2710
2963
|
```
|
|
@@ -3225,7 +3478,7 @@ export default function Page({ data }: Route.ComponentProps) {
|
|
|
3225
3478
|
|
|
3226
3479
|
The same `defer()` works in actions and across client-side soft navigations (an
|
|
3227
3480
|
NDJSON stream settles the deferred values), and it's framework-agnostic - React
|
|
3228
|
-
`<Suspense>` and Solid's streaming both drive it from one core. See
|
|
3481
|
+
`<Suspense>` and Solid's `<Loading>` streaming both drive it from one core. See
|
|
3229
3482
|
Frameworks for which adapters stream the boundary in the
|
|
3230
3483
|
server HTML.
|
|
3231
3484
|
|
|
@@ -8070,7 +8323,6 @@ export const vitePlugins = [react()] // only if you want Vite's dev pip
|
|
|
8070
8323
|
// Vue/Svelte/Solid also export:
|
|
8071
8324
|
// clientPlugins = [vueBunPlugin("dom")] // compile routes for the client build
|
|
8072
8325
|
// serverPlugins = [vueBunPlugin("ssr")] // compile routes into the target's server bundle
|
|
8073
|
-
// conditions = ["solid"] // Solid: resolve solid-js to its source
|
|
8074
8326
|
// define = { __VUE_OPTIONS_API__: "true", ... } // Vue feature flags
|
|
8075
8327
|
```
|
|
8076
8328
|
|
|
@@ -8376,8 +8628,8 @@ starts from unless nothing else, installed or declared, names one.
|
|
|
8376
8628
|
|
|
8377
8629
|
```bash
|
|
8378
8630
|
nifra upgrade --list # the release targets this CLI knows
|
|
8379
|
-
nifra upgrade 5.
|
|
8380
|
-
nifra upgrade 5.
|
|
8631
|
+
nifra upgrade 5.15.0 # dry-run: every planned edit, nothing written
|
|
8632
|
+
nifra upgrade 5.15.0 --write # apply; it verifies with nifra check once the target is installed
|
|
8381
8633
|
# if pins were already bumped by hand, add --from <installed-version>
|
|
8382
8634
|
bun install # install the new pins
|
|
8383
8635
|
nifra check # verify against them
|
|
@@ -9442,9 +9694,9 @@ preserved (rerender)
|
|
|
9442
9694
|
|
|
9443
9695
|
Solid
|
|
9444
9696
|
|
|
9445
|
-
|
|
9697
|
+
`@solidjs/vite-plugin` (`{ ssr: true }`)
|
|
9446
9698
|
|
|
9447
|
-
resets (solid-refresh)
|
|
9699
|
+
resets (solid-js/refresh)
|
|
9448
9700
|
|
|
9449
9701
|
Svelte
|
|
9450
9702
|
|
|
@@ -9455,8 +9707,8 @@ resets (svelte HMR)
|
|
|
9455
9707
|
For **React, Preact, and Vue**, an edit hot-swaps with component state preserved.
|
|
9456
9708
|
For **Solid and Svelte**, the module hot-swaps live (no full reload - scroll,
|
|
9457
9709
|
route, and other components are kept), but the edited component re-runs, so its own local state
|
|
9458
|
-
resets. For Solid, use `solid({ ssr: true })`
|
|
9459
|
-
|
|
9710
|
+
resets. For Solid, use `solid({ ssr: true })` from
|
|
9711
|
+
`@solidjs/vite-plugin`. Working examples for all five live in `examples/hmr-*`.
|
|
9460
9712
|
|
|
9461
9713
|
### The Fast Refresh boundary rule
|
|
9462
9714
|
|
|
@@ -10840,8 +11092,8 @@ svelteMdxBunPlugin("ssr")
|
|
|
10840
11092
|
```
|
|
10841
11093
|
|
|
10842
11094
|
React, Preact, and Vue share one plugin (their JSX runtimes differ only by `jsxImportSource`). Solid
|
|
10843
|
-
needs its compile-time transform, so `@nifrajs/web-solid/mdx` runs `
|
|
10844
|
-
maps intrinsic tags through
|
|
11095
|
+
needs its compile-time transform, so `@nifrajs/web-solid/mdx` runs `@solidjs/compiler` over the MDX and
|
|
11096
|
+
maps intrinsic tags through `dynamic()`. Svelte has no JSX, so `@nifrajs/web-svelte/mdx` routes MDX through
|
|
10845
11097
|
`mdsvex` - Svelte's own Markdown compiler. All five server-render and hydrate.
|
|
10846
11098
|
|
|
10847
11099
|
## Nifra - Framework contract
|
|
@@ -11352,8 +11604,11 @@ file that reaches it.
|
|
|
11352
11604
|
The optional server-components pipeline supports
|
|
11353
11605
|
React, Preact, Vue, Svelte and Solid. Declare closed input/public-props schemas and authorization
|
|
11354
11606
|
in `*.component.server.ts(x)`, register owner instances and export a named
|
|
11355
|
-
`componentPipeline` configuration. React uses native RSC/Flight;
|
|
11356
|
-
|
|
11607
|
+
`componentPipeline` configuration. React uses native RSC/Flight; Vue, Svelte,
|
|
11608
|
+
Preact and Nifra's Solid adapter use schema-checked server-rendered ranges and
|
|
11609
|
+
explicitly registered native islands, not a Flight-equivalent protocol. Solid 2 has a
|
|
11610
|
+
separate experimental server-component frames protocol that Nifra does not currently target.
|
|
11611
|
+
Refresh repeats owner GET admission;
|
|
11357
11612
|
HTML/data/refresh are private/no-store. Writes use server functions or actions. Bind the
|
|
11358
11613
|
router and await auth-scope invalidation on identity, tenant or permission changes.
|
|
11359
11614
|
|
|
@@ -13104,8 +13359,8 @@ data, duplicate runtimes, and stable list identity.
|
|
|
13104
13359
|
state identity, compat boundaries, and runtime duplication.
|
|
13105
13360
|
|
|
13106
13361
|
-
|
|
13107
|
-
**Solid:** tracked reads, props and stores, `For` versus
|
|
13108
|
-
|
|
13362
|
+
**Solid:** tracked reads, props and stores, `For` keyed versus
|
|
13363
|
+
unkeyed, and owner cleanup.
|
|
13109
13364
|
|
|
13110
13365
|
-
|
|
13111
13366
|
**Vue:** refs in script, watch sources and traversal, reactive props, and SSR
|
|
@@ -14380,7 +14635,7 @@ the command below, which runs every recipe since its installed version. The 5.6
|
|
|
14380
14635
|
its imports and dependencies; the follow-up changes below need a hand.
|
|
14381
14636
|
|
|
14382
14637
|
```sh
|
|
14383
|
-
nifra upgrade 5.
|
|
14638
|
+
nifra upgrade 5.15.0
|
|
14384
14639
|
```
|
|
14385
14640
|
|
|
14386
14641
|
-
|
|
@@ -14399,7 +14654,7 @@ Islands.
|
|
|
14399
14654
|
throws at startup without one. Pages stored before the upgrade render once more.
|
|
14400
14655
|
|
|
14401
14656
|
-
|
|
14402
|
-
The server-component pipeline is certified on Vite 8.3.
|
|
14657
|
+
The server-component pipeline is certified on Vite 8.3.8: pin `vite` to exactly
|
|
14403
14658
|
that version.
|
|
14404
14659
|
|
|
14405
14660
|
-
|
|
@@ -14811,9 +15066,9 @@ Migrate a backend. For the full
|
|
|
14811
15066
|
rendering and route model, see Loaders & actions
|
|
14812
15067
|
and Routing.
|
|
14813
15068
|
|
|
14814
|
-
The current dynamic SSR snapshot reports Nifra at
|
|
14815
|
-
of Next.js,
|
|
14816
|
-
2
|
|
15069
|
+
The current dynamic SSR snapshot reports Nifra at 15× the throughput
|
|
15070
|
+
of Next.js, 6.9× Nuxt, 4× SvelteKit, and
|
|
15071
|
+
2× SolidStart on the measured pages. See the
|
|
14817
15072
|
benchmark methodology and full results.
|
|
14818
15073
|
|
|
14819
15074
|
## Nifra - Migrate route by route
|
|
@@ -18779,7 +19034,9 @@ The server answers for the nifra the project installs. When the project has its
|
|
|
18779
19034
|
a different version than the `nifra` the client spawned (a global install, say), the session is handed
|
|
18780
19035
|
to `./node_modules/.bin/nifra mcp`. When that is impossible, `nifra_check`, `nifra_types`,
|
|
18781
19036
|
`nifra_docs`, `nifra_example`, `nifra_assure` and `nifra_contracts` refuse with the fix instead of
|
|
18782
|
-
describing a different release.
|
|
19037
|
+
describing a different release. A project CLI that installs mid-session takes the session over the same
|
|
19038
|
+
way; a single message from it larger than 16 MiB ends that CLI, and the request waiting on it gets a
|
|
19039
|
+
`-32603` error.
|
|
18783
19040
|
|
|
18784
19041
|
The server runs none of the project's code and keeps none of its `.env`. Every tool, resource and
|
|
18785
19042
|
prompt that loads the app, including the ones the app declares with `.tool()`, runs in a fresh process
|
|
@@ -20871,6 +21128,104 @@ one cheap read instead of the whole corpus. For the wider framework: the repo's
|
|
|
20871
21128
|
[`llms-full.txt`](../../llms-full.txt) is the full machine-readable corpus. Run `nifra check` as the
|
|
20872
21129
|
done-gate, or `nifra mcp` to give the agent live project tools.
|
|
20873
21130
|
|
|
21131
|
+
## @nifrajs/node-uws
|
|
21132
|
+
|
|
21133
|
+
Serve a [nifra](../../README.md) app on [uWebSockets.js](https://github.com/uNetworking/uWebSockets.js)
|
|
21134
|
+
from Node. It is `@nifrajs/node` with uWS's native HTTP server in place of `node:http`: requests reach
|
|
21135
|
+
the app through the same node-direct lane, and answers are written with uWS's corked, copy-once API.
|
|
21136
|
+
|
|
21137
|
+
```ts
|
|
21138
|
+
import { server } from "@nifrajs/core/server"
|
|
21139
|
+
import { serve } from "@nifrajs/node-uws"
|
|
21140
|
+
|
|
21141
|
+
const app = server().get("/users/:id", (c) => ({ id: c.params.id }))
|
|
21142
|
+
|
|
21143
|
+
const handle = await serve(app, { port: 3000 })
|
|
21144
|
+
// handle.port the bound port (useful with `port: 0`)
|
|
21145
|
+
// await handle.stop() stop accepting, drain in-flight requests, close the rest
|
|
21146
|
+
```
|
|
21147
|
+
|
|
21148
|
+
## Install
|
|
21149
|
+
|
|
21150
|
+
Install this package with its core and Node adapter dependencies:
|
|
21151
|
+
|
|
21152
|
+
```sh
|
|
21153
|
+
npm install @nifrajs/node-uws @nifrajs/node @nifrajs/core
|
|
21154
|
+
```
|
|
21155
|
+
|
|
21156
|
+
uWebSockets.js is not published to npm. Install it from GitHub, next to this package:
|
|
21157
|
+
|
|
21158
|
+
```sh
|
|
21159
|
+
npm install uNetworking/uWebSockets.js#v20.71.0
|
|
21160
|
+
```
|
|
21161
|
+
|
|
21162
|
+
Its releases ship prebuilt binaries for Node 22, 24 and 26 on macOS and Linux (x64, arm64) and Windows
|
|
21163
|
+
(x64). There is none for Alpine (musl) or Windows on arm64, and a new Node major has none until upstream
|
|
21164
|
+
publishes one. The Node 24 binary for Linux arm64 needs glibc 2.38 or newer, so Debian 12 and Ubuntu 22.04
|
|
21165
|
+
cannot load it. Importing this package succeeds either way; `serve()` loads the addon and throws an error
|
|
21166
|
+
that says so when it cannot load. Use `@nifrajs/node` where that matters.
|
|
21167
|
+
|
|
21168
|
+
## Options
|
|
21169
|
+
|
|
21170
|
+
| Option | |
|
|
21171
|
+
|---|---|
|
|
21172
|
+
| `port`, `hostname` | As in `@nifrajs/node`. |
|
|
21173
|
+
| `protocol` | `"http"` or `"https"`: the scheme `Request.url` carries. `"https"` by default when `tls` is set. |
|
|
21174
|
+
| `tls` | `{ keyFileName, certFileName, passphrase?, caFileName?, dhParamsFileName?, sslCiphers?, sslPreferLowMemoryUsage? }`. uWS reads the files itself, so these are paths, not PEM text. |
|
|
21175
|
+
| `allowedHosts`, `canonicalHost`, `normalizeTarget` | Same rules and defaults as `@nifrajs/node`. |
|
|
21176
|
+
| `gracefulSignals` | Call `stop()` on SIGTERM/SIGINT. Off by default. |
|
|
21177
|
+
|
|
21178
|
+
`static` and `fastResponse` are refused with a `TypeError`: serve files from a route or a static host in
|
|
21179
|
+
front.
|
|
21180
|
+
|
|
21181
|
+
`stop({ drainMs, delayMs })`, `await using`, and the app's `onStopping` / `onStop` hooks behave as they
|
|
21182
|
+
do on `@nifrajs/node`.
|
|
21183
|
+
|
|
21184
|
+
## How it differs from `@nifrajs/node`
|
|
21185
|
+
|
|
21186
|
+
- **Fixed replies skip the app.** A `staticResponse()` GET route (no path parameter, no
|
|
21187
|
+
schema, auth or other route-level stage) is compiled into uWS and answered without calling into
|
|
21188
|
+
JavaScript, and a fixed POST is answered from uWS's callback without building a request, as long as the app has no request or response hook, deadline, capacity gate, response
|
|
21189
|
+
headers or Host policy (`allowedHosts`, `canonicalHost`, `normalizeTarget`). A POST carrying an `Origin` header goes to the ordinary path, which runs the cross-site form check; one without cannot fail it. An `echoParam()` route
|
|
21190
|
+
(whose only parameter is its last segment, and which no other route can overlap) is answered the
|
|
21191
|
+
same way, from the path as sent. A malformed `Host` is screened on every other
|
|
21192
|
+
route and not on these; a malformed percent-escape in an echoed segment is echoed as sent, where
|
|
21193
|
+
the other runtimes answer 400. Serving seals the app, as `listen()` does: a route or
|
|
21194
|
+
hook added afterwards throws `SERVER_SEALED`.
|
|
21195
|
+
- **No WebSockets.** A handshake is refused with `501`. Use `@nifrajs/node` for apps with `ws` routes.
|
|
21196
|
+
- **Streaming responses** (SSE, streamed SSR) are written chunked with back-pressure; a body whose
|
|
21197
|
+
`Content-Length` is declared is sent with that length and cut off, not finished, if the stream ends
|
|
21198
|
+
short or runs long.
|
|
21199
|
+
- **Headers uWS frames itself** - `Content-Length`, `Transfer-Encoding` and `Date` - are dropped from the
|
|
21200
|
+
app's response, and uWS adds a `uWebSockets: 20` header it cannot be told to omit.
|
|
21201
|
+
- **Header values are checked** for CR, LF and other control characters before anything is written, and
|
|
21202
|
+
a status outside 100-999 is refused: either is a `500`, reported through the app's logger.
|
|
21203
|
+
- **uWS's parser, not Node's.** It rejects a repeated `Host`, a request carrying both `Content-Length`
|
|
21204
|
+
and `Transfer-Encoding`, and an absolute-form target with `400`, before the app sees them. Its idle
|
|
21205
|
+
timeout is fixed at 10 seconds, and there is no equivalent of Node's `requestTimeout`.
|
|
21206
|
+
- **Request bodies are pushed by uWS**, not pulled. The socket is throttled once 1 MiB is buffered
|
|
21207
|
+
unread; a body larger than the route's cap is refused with `413` as on `@nifrajs/node`. A handler
|
|
21208
|
+
that answers without reading the body releases the throttle first and the rest of the upload is
|
|
21209
|
+
dropped, so the next request on that connection is read; reading the body afterwards rejects.
|
|
21210
|
+
- **An empty header value reads as absent** through `c.header()`.
|
|
21211
|
+
|
|
21212
|
+
## Notes for contributors
|
|
21213
|
+
|
|
21214
|
+
The shared pieces - the outcome runtime, Host and target policy, lifecycle and error hooks - come from
|
|
21215
|
+
`@nifrajs/node/transport`. uWS objects are valid only while their callback runs, so the request copies
|
|
21216
|
+
its headers out the moment an app goes asynchronous, and a response is never touched after it ended or
|
|
21217
|
+
aborted: uWS throws on that, and an uncaught throw there ends the process.
|
|
21218
|
+
|
|
21219
|
+
Tests run on Node (`bun run test:node`), because uWS does not load under Bun.
|
|
21220
|
+
|
|
21221
|
+
## For AI agents
|
|
21222
|
+
|
|
21223
|
+
Start with [`LLM.md`](./LLM.md) - this package's contract card (the exports you call + its footguns),
|
|
21224
|
+
one cheap read instead of the whole corpus. For the wider framework: the repo's
|
|
21225
|
+
[`AGENTS.md`](../../AGENTS.md) is the copy-paste quick reference, and
|
|
21226
|
+
[`llms-full.txt`](../../llms-full.txt) is the full machine-readable corpus. Run `nifra check` as the
|
|
21227
|
+
done-gate, or `nifra mcp` to give the agent live project tools.
|
|
21228
|
+
|
|
20874
21229
|
## @nifrajs/otel
|
|
20875
21230
|
|
|
20876
21231
|
Distributed tracing for nifra. The `tracing()` plugin continues (or starts) a **W3C trace** per
|
|
@@ -21515,7 +21870,11 @@ private package-not in these mechanical interfaces.
|
|
|
21515
21870
|
|
|
21516
21871
|
Keys are POSIX-ish relative paths (`avatars/u1.png`). **Every** adapter rejects unsafe keys - absolute
|
|
21517
21872
|
paths, `..` traversal, NUL bytes, backslashes - via `assertSafeKey`, so a `FileStorage` key can never
|
|
21518
|
-
escape its root and a key valid in one adapter is valid in all.
|
|
21873
|
+
escape its root through key syntax and a key valid in one adapter is valid in all.
|
|
21874
|
+
|
|
21875
|
+
Keep the storage and sidecar directory trees, including all nested directories and ancestors,
|
|
21876
|
+
under trusted ownership. On Windows, protect those directories with ACLs that prevent other
|
|
21877
|
+
principals from modifying or replacing them. FileStorage cannot verify those ACLs.
|
|
21519
21878
|
|
|
21520
21879
|
```ts
|
|
21521
21880
|
import { assertSafeKey, StorageKeyError } from "@nifrajs/storage"
|
|
@@ -21864,6 +22223,16 @@ one cheap read instead of the whole corpus. For the wider framework: the repo's
|
|
|
21864
22223
|
[`llms-full.txt`](../../llms-full.txt) is the full machine-readable corpus. Run `nifra check` as the
|
|
21865
22224
|
done-gate, or `nifra mcp` to give the agent live project tools.
|
|
21866
22225
|
|
|
22226
|
+
## @nifrajs/utils
|
|
22227
|
+
|
|
22228
|
+
Runtime-neutral utility functions shared by Nifra packages. The package has no runtime dependencies.
|
|
22229
|
+
|
|
22230
|
+
```ts
|
|
22231
|
+
import { isRecord, sha256Hex } from "@nifrajs/utils"
|
|
22232
|
+
```
|
|
22233
|
+
|
|
22234
|
+
See the [package LLM guide](./LLM.md) and the [full repository LLM context](../../llms-full.txt).
|
|
22235
|
+
|
|
21867
22236
|
## @nifrajs/web
|
|
21868
22237
|
|
|
21869
22238
|
Framework-agnostic SSR core for nifra - the render seam + HTML document orchestration.
|
|
@@ -21884,12 +22253,13 @@ One package, the same on React, Preact, Vue, Solid and Svelte (pick the renderer
|
|
|
21884
22253
|
- [Keep-alive](https://nifra.dev/docs/keep-alive) pages, a query cache, optimistic fetchers, and
|
|
21885
22254
|
[islands](https://nifra.dev/docs/islands) (`@nifrajs/web/islands`) for pages with no framework runtime.
|
|
21886
22255
|
- Optional [server components](https://nifra.dev/docs/server-components) on all five adapters:
|
|
21887
|
-
React uses native RSC/Flight,
|
|
21888
|
-
|
|
21889
|
-
|
|
21890
|
-
|
|
21891
|
-
|
|
21892
|
-
|
|
22256
|
+
React uses native RSC/Flight. Vue, Svelte, Preact and the Solid adapter use
|
|
22257
|
+
explicitly registered islands in validated server-rendered ranges; Solid 2's experimental
|
|
22258
|
+
frames protocol is not currently targeted. Definitions take closed input and public-props
|
|
22259
|
+
schemas and authorization; a refresh runs the owner page's GET with its admission, capabilities,
|
|
22260
|
+
budgets and cancellation. Use the `/server-components`, `/server-components/client`,
|
|
22261
|
+
`/server-components/islands` and `/server-components/build` exports with a `componentPipeline`
|
|
22262
|
+
config export; the repository has a runnable example per adapter.
|
|
21893
22263
|
|
|
21894
22264
|
## Guarding pages
|
|
21895
22265
|
|
|
@@ -21976,7 +22346,7 @@ done-gate, or `nifra mcp` to give the agent live project tools.
|
|
|
21976
22346
|
|
|
21977
22347
|
## @nifrajs/web-solid
|
|
21978
22348
|
|
|
21979
|
-
Solid render adapter for @nifrajs/web - SSR + hydration + the Solid
|
|
22349
|
+
Solid render adapter for @nifrajs/web - SSR + hydration + the Solid compiler build plugin.
|
|
21980
22350
|
|
|
21981
22351
|
Part of the **[nifra](https://nifra.dev)** full-stack TypeScript framework - one core, five UI libraries, every runtime. Scaffold a new app with `bun create nifra`.
|
|
21982
22352
|
|
|
@@ -22048,7 +22418,7 @@ To refresh one region from a link or GET form without a full reload, render it w
|
|
|
22048
22418
|
|
|
22049
22419
|
- In text and in a quoted attribute value, it is HTML-escaped.
|
|
22050
22420
|
- An unquoted attribute value (`class=${name}`) is quoted for you, so a space in the value cannot start another attribute.
|
|
22051
|
-
- A `javascript:` or `vbscript:` URL that begins an `href`, `src`, `action` or other URL attribute is written as `about:invalid`.
|
|
22421
|
+
- A `javascript:` or `vbscript:` URL that begins an `href`, `src`, `action` or other URL attribute is written as `about:invalid`. So is a `data:` URL that begins the `src` (or `href`) of a `<script>`, which runs; a `data:` image, download, frame or object URL is kept.
|
|
22052
22422
|
- No escaping makes a string safe as a tag name, inside `<script>` or `<style>`, or in an `on*` handler or `srcdoc` value, so a string or nested template throws there. An attribute name takes only a plain name with no value (`<input ${checked ? "checked" : ""}>`), or a suffix after `data-` or `aria-`. Numbers and booleans fill any of these, and `raw()` is the explicit opt-out for trusted text.
|
|
22053
22423
|
|
|
22054
22424
|
Need a stateful app UI with reactive components? That is what the five framework adapters are for - reach for `@nifrajs/web-preact` or `@nifrajs/web-solid` when you want a small reactive runtime.
|
|
@@ -22423,7 +22793,7 @@ done-gate, or `nifra mcp` to give the agent live project tools.
|
|
|
22423
22793
|
|
|
22424
22794
|
## @nifrajs/core
|
|
22425
22795
|
|
|
22426
|
-
`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`
|
|
22796
|
+
`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`, `echoParam`, `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`
|
|
22427
22797
|
|
|
22428
22798
|
## @nifrajs/cron
|
|
22429
22799
|
|
|
@@ -22497,6 +22867,10 @@ done-gate, or `nifra mcp` to give the agent live project tools.
|
|
|
22497
22867
|
|
|
22498
22868
|
`FetchHandler`, `HashedFiles`, `NodeServer`, `NodeStopOptions`, `RequestProtocol`, `RequestProtocolOption`, `ServeOptions`, `ServeStaticOptions`, `serve`, `serveStatic`
|
|
22499
22869
|
|
|
22870
|
+
## @nifrajs/node-uws
|
|
22871
|
+
|
|
22872
|
+
`FetchHandler`, `NodeStopOptions`, `ServeOptions`, `UwsServer`, `UwsTlsOptions`, `serve`
|
|
22873
|
+
|
|
22500
22874
|
## @nifrajs/otel
|
|
22501
22875
|
|
|
22502
22876
|
`ActiveObservation`, `AttributeValue`, `EffectTracingOptions`, `EffectTracingPlugin`, `EndObservation`, `NifraSpan`, `ObservationAdapter`, `ObservationClock`, `ObservationContext`, `ObservationLifecycle`, `ObservationLifecycleOptions`, `ObservationLink`, `ObservationParent`, `ObservationScope`, `OtlpExporter`, `OtlpExporterOptions`, `ParsedTraceparent`, `RecordingObservationLifecycle`, `SpanKind`, `SpanStatus`, `StartObservation`, `TraceContext`, `TracingOptions`, `causalitySpanLink`, `combineObservationAdapters`, `consoleSpanExporter`, `createObservationLifecycle`, `effectTracing`, `formatTraceparent`, `generateSpanId`, `generateTraceId`, `otlpExporter`, `parseTraceparent`, `traceHeaders`, `tracing`
|
|
@@ -22537,6 +22911,10 @@ done-gate, or `nifra mcp` to give the agent live project tools.
|
|
|
22537
22911
|
|
|
22538
22912
|
`ImagePixelLimitError`, `ImageReencoder`, `SignDownloadUrlOptions`, `StripImageMetadataOptions`, `UploadResult`, `ValidateUploadOptions`, `signDownloadUrl`, `stripImageMetadata`, `validateUpload`, `verifyDownloadUrl`
|
|
22539
22913
|
|
|
22914
|
+
## @nifrajs/utils
|
|
22915
|
+
|
|
22916
|
+
`bytesToHex`, `concatBytes`, `escapeRegExp`, `isRecord`, `sha256Hex`
|
|
22917
|
+
|
|
22540
22918
|
## @nifrajs/web
|
|
22541
22919
|
|
|
22542
22920
|
`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`
|