@nifrajs/cli 5.5.0 → 5.6.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 +172 -0
- package/dist/cdn-check.d.ts +7 -6
- package/dist/cdn-check.d.ts.map +1 -1
- package/dist/cdn-check.js +13 -1
- package/dist/cdn-check.js.map +1 -1
- package/dist/check-diagnostics.d.ts.map +1 -1
- package/dist/check-diagnostics.js +5 -3
- package/dist/check-diagnostics.js.map +1 -1
- package/dist/check-scan.d.ts.map +1 -1
- package/dist/check-scan.js +29 -2
- package/dist/check-scan.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +14 -5
- package/dist/cli.js.map +1 -1
- package/dist/command-catalog.d.ts +14 -1
- package/dist/command-catalog.d.ts.map +1 -1
- package/dist/command-catalog.js +93 -0
- package/dist/command-catalog.js.map +1 -1
- package/dist/doctor.d.ts +9 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +52 -0
- package/dist/doctor.js.map +1 -1
- package/dist/fix-recipes.d.ts.map +1 -1
- package/dist/fix-recipes.js +27 -0
- package/dist/fix-recipes.js.map +1 -1
- package/dist/frontend-guidance.d.ts +1 -1
- package/dist/frontend-guidance.d.ts.map +1 -1
- package/dist/frontend-guidance.js +17 -8
- package/dist/frontend-guidance.js.map +1 -1
- package/dist/internal/source-facts.d.ts +2 -1
- package/dist/internal/source-facts.d.ts.map +1 -1
- package/dist/internal/source-facts.js +17 -11
- package/dist/internal/source-facts.js.map +1 -1
- package/dist/introspect.js +1 -1
- package/dist/introspect.js.map +1 -1
- package/dist/load.d.ts +4 -1
- package/dist/load.d.ts.map +1 -1
- package/dist/load.js +8 -0
- package/dist/load.js.map +1 -1
- package/dist/mcp-exec.d.ts.map +1 -1
- package/dist/mcp-exec.js +57 -3
- package/dist/mcp-exec.js.map +1 -1
- package/dist/mcp-http.d.ts +2 -1
- package/dist/mcp-http.d.ts.map +1 -1
- package/dist/mcp-http.js +3 -2
- package/dist/mcp-http.js.map +1 -1
- package/dist/mcp-tool-meta.d.ts +21 -0
- package/dist/mcp-tool-meta.d.ts.map +1 -0
- package/dist/mcp-tool-meta.js +246 -0
- package/dist/mcp-tool-meta.js.map +1 -0
- package/dist/mcp.d.ts +3 -2
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +36 -98
- package/dist/mcp.js.map +1 -1
- package/dist/output-schemas.d.ts +8 -0
- package/dist/output-schemas.d.ts.map +1 -1
- package/dist/output-schemas.js +14 -0
- package/dist/output-schemas.js.map +1 -1
- package/dist/ppr-read-fix.d.ts +8 -0
- package/dist/ppr-read-fix.d.ts.map +1 -0
- package/dist/ppr-read-fix.js +356 -0
- package/dist/ppr-read-fix.js.map +1 -0
- package/dist/recipes/5.6.0.d.ts +10 -0
- package/dist/recipes/5.6.0.d.ts.map +1 -0
- package/dist/recipes/5.6.0.js +68 -0
- package/dist/recipes/5.6.0.js.map +1 -0
- package/dist/recipes/index.d.ts.map +1 -1
- package/dist/recipes/index.js +2 -0
- package/dist/recipes/index.js.map +1 -1
- package/dist/review.d.ts.map +1 -1
- package/dist/review.js +7 -2
- package/dist/review.js.map +1 -1
- package/dist/rules/codes.d.ts +8 -3
- package/dist/rules/codes.d.ts.map +1 -1
- package/dist/rules/codes.js +9 -4
- package/dist/rules/codes.js.map +1 -1
- package/dist/rules/explanations.d.ts.map +1 -1
- package/dist/rules/explanations.js +39 -13
- package/dist/rules/explanations.js.map +1 -1
- package/dist/rules/islands.d.ts +91 -0
- package/dist/rules/islands.d.ts.map +1 -1
- package/dist/rules/islands.js +757 -3
- package/dist/rules/islands.js.map +1 -1
- package/dist/rules/ppr.d.ts +16 -0
- package/dist/rules/ppr.d.ts.map +1 -0
- package/dist/rules/ppr.js +114 -0
- package/dist/rules/ppr.js.map +1 -0
- package/dist/rules/swap.d.ts +7 -0
- package/dist/rules/swap.d.ts.map +1 -0
- package/dist/rules/swap.js +338 -0
- package/dist/rules/swap.js.map +1 -0
- package/dist/scaffold-hole.d.ts +105 -0
- package/dist/scaffold-hole.d.ts.map +1 -0
- package/dist/scaffold-hole.js +688 -0
- package/dist/scaffold-hole.js.map +1 -0
- package/dist/scaffold.d.ts +5 -3
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/scaffold.js +56 -46
- package/dist/scaffold.js.map +1 -1
- package/dist/verification-plan.d.ts.map +1 -1
- package/dist/verification-plan.js +12 -1
- package/dist/verification-plan.js.map +1 -1
- package/dist/web-app-options.d.ts +1 -1
- package/dist/web-app-options.d.ts.map +1 -1
- package/dist/web-app-options.js.map +1 -1
- package/docs/examples.json +63 -9
- package/docs/llms-full.txt +2070 -437
- package/docs/types.json +1300 -270
- package/package.json +11 -11
- package/src/cdn-check.ts +21 -7
- package/src/check-diagnostics.ts +5 -3
- package/src/check-scan.ts +34 -3
- package/src/cli.ts +14 -5
- package/src/command-catalog.ts +126 -0
- package/src/doctor.ts +44 -1
- package/src/fix-recipes.ts +28 -0
- package/src/frontend-guidance.ts +20 -8
- package/src/internal/source-facts.ts +27 -13
- package/src/introspect.ts +1 -1
- package/src/load.ts +13 -0
- package/src/mcp-exec.ts +74 -3
- package/src/mcp-http.ts +3 -2
- package/src/mcp-tool-meta.ts +268 -0
- package/src/mcp.ts +35 -99
- package/src/output-schemas.ts +28 -0
- package/src/ppr-read-fix.ts +426 -0
- package/src/recipes/5.6.0.ts +69 -0
- package/src/recipes/index.ts +2 -0
- package/src/review.ts +7 -2
- package/src/rules/codes.ts +9 -4
- package/src/rules/explanations.ts +39 -13
- package/src/rules/islands.ts +875 -3
- package/src/rules/ppr.ts +143 -0
- package/src/rules/swap.ts +402 -0
- package/src/scaffold-hole.ts +880 -0
- package/src/scaffold.ts +60 -49
- package/src/verification-plan.ts +20 -1
- package/src/web-app-options.ts +1 -0
- package/dist/rules/nano.d.ts +0 -6
- package/dist/rules/nano.d.ts.map +0 -1
- package/dist/rules/nano.js +0 -273
- package/dist/rules/nano.js.map +0 -1
- package/src/rules/nano.ts +0 -307
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { UpgradeRecipe } from "./index.ts"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Upgrade recipe for Nifra 5.6.
|
|
5
|
+
*
|
|
6
|
+
* `@nifrajs/islets` and `@nifrajs/web/nano` merge into `@nifrajs/web/islands`. The imports move
|
|
7
|
+
* mechanically; the call shapes and the island host markup do not, so the notes list each removed
|
|
8
|
+
* name with what replaces it.
|
|
9
|
+
*/
|
|
10
|
+
export const recipe: UpgradeRecipe = {
|
|
11
|
+
version: "5.6.0",
|
|
12
|
+
pins: [
|
|
13
|
+
{ match: "@nifrajs/", to: "5.6.0" },
|
|
14
|
+
{ match: "create-nifra", to: "5.6.0" },
|
|
15
|
+
{ match: "nifra", to: "5.6.0" },
|
|
16
|
+
],
|
|
17
|
+
dependencyMoves: [{ from: "@nifrajs/islets", to: "@nifrajs/web", toVersion: "5.6.0" }],
|
|
18
|
+
importMoves: [
|
|
19
|
+
{ from: "@nifrajs/islets", to: "@nifrajs/web/islands" },
|
|
20
|
+
{ from: "@nifrajs/web/nano", to: "@nifrajs/web/islands" },
|
|
21
|
+
{ from: "@nifrajs/uploads/detect", to: "@nifrajs/core/file-type" },
|
|
22
|
+
],
|
|
23
|
+
retiredMarkers: [
|
|
24
|
+
{
|
|
25
|
+
marker: "nifra-expect NF-C021",
|
|
26
|
+
instead: "nothing: NF-C021 is retired, so delete the comment",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
marker: "nifra-expect NF-C023",
|
|
30
|
+
instead: "nothing: NF-C023 is retired, so delete the comment",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
affects: [
|
|
34
|
+
"@nifrajs/cli",
|
|
35
|
+
"@nifrajs/coding-agent",
|
|
36
|
+
"@nifrajs/core",
|
|
37
|
+
"@nifrajs/env",
|
|
38
|
+
"@nifrajs/islets",
|
|
39
|
+
"@nifrajs/middleware",
|
|
40
|
+
"@nifrajs/schema",
|
|
41
|
+
"@nifrajs/uploads",
|
|
42
|
+
"@nifrajs/web",
|
|
43
|
+
"@nifrajs/web-react",
|
|
44
|
+
"@nifrajs/web-svelte",
|
|
45
|
+
"@nifrajs/web-vanilla",
|
|
46
|
+
],
|
|
47
|
+
notes: [
|
|
48
|
+
'Island hosts are any element with `data-island="<id>"`. `<nifra-island data-id>` markers are no longer mounted: rename `data-id` to `data-island`, `data-props` to `data-island-props`, `data-strategy` to `data-island-strategy` and `data-media` to `data-island-media`. The `@nifrajs/web-react` `<Island>` marker renders the new names; `@nifrajs/islets`\' `data-island-state` becomes `data-island-props`.',
|
|
49
|
+
'`@nifrajs/islets`: `island("id", setup)` plus its own `mountIslands()` becomes `const id = bindIsland(setup)` and `mountIslands({ id })`; the setup still receives `{ root, state }` and returns its handlers, and gains `props` and `onDispose(fn)`. `islandState(value)` is `islandProps(value)`. `signal`, `computed`, `effect` and `batch` keep their shapes.',
|
|
50
|
+
"`@nifrajs/web/nano`: a signal is read by calling it (`count()`, was `count.get()`); `computed(fn, [deps])` is `computed(fn)`, which tracks what it reads; `bind(el, source, apply)` is `effect(() => apply(el, source()))`; `bindResource` is an `effect` over the resource's state; `resource(fetcher, [deps])` is `resource(source, (key, abort) => fetcher)`, where `source` returns the key and the fetcher's reads are not dependencies; `Readable.subscribe(fn)` is `effect(() => fn(source()))`. `bindList(source, container, { key, create, update })` keeps its shape; `key` receives only the item.",
|
|
51
|
+
"Effects, computeds, `bindList` and `resource` created while an enhancer sets up stop when its island unmounts, so the disposers nano asked you to collect can go. An effect created later, inside an event handler, is not owned.",
|
|
52
|
+
"`nifra check` adds NF-C047 (a `data-bind-*` name its `bindIsland` setup never declares) and NF-C048 (a binding no `bindIsland` host walks), and NF-C022 now checks the islands `bindList` key. NF-C021 and NF-C023 are retired; a `nifra.check.json` override of either no longer does anything.",
|
|
53
|
+
"`nifra scaffold --variant stateful` emits a reactive island where it emitted the nano pattern.",
|
|
54
|
+
"The server-component pipeline is certified on Vite 8.3.4: set `vite` to exactly 8.3.4. Until it matches, the plugin's guard stops the build and `nifra check` names the installed version.",
|
|
55
|
+
'`withISR` over any store but `MemoryCacheStore` (a `KVCacheStore`, or a `CacheStore` of your own) needs `storeSecret`, the same in every process, at least 32 characters and generated at random (`openssl rand -hex 32`), and throws at construction without one; on Workers, set it with `wrangler secret put` and pass `env.<NAME>`. Pages stored before the upgrade carry no signature, so each renders once more and is stored signed. A page that fails the check reaches `onStoreError` with op `"verify"`.',
|
|
56
|
+
"`detectFileType`, `DETECTABLE_MIME_TYPES`, `FILE_TYPE_PREFIX_BYTES` and the `FileType` type are exported from `@nifrajs/core/file-type`, and `@nifrajs/uploads` no longer exports them. `@nifrajs/uploads/detect` imports are rewritten; import those names from `@nifrajs/core/file-type` where they came from `@nifrajs/uploads`. `@nifrajs/uploads` takes `@nifrajs/core` as a peer dependency.",
|
|
57
|
+
"`idempotency()` from `@nifrajs/middleware` covers the routes declared after it, and installing it after a route that uses a covered method throws: move the `.use(idempotency(...))` above those routes. A replay now runs just before the handler, after the route's authentication, validation and every guard admit the retry, and stored records without an admission marker are refused. It returns an `IdentityPlugin` (from `@nifrajs/core`) rather than a `Middleware`: replace an explicit `Middleware` annotation on it, or let TypeScript infer the type.",
|
|
58
|
+
'`multipartBody` and `t.form` parse a form themselves, by the Fetch standard\'s parser, instead of the runtime\'s `formData()`, so every runtime reads the same parts. A part\'s disposition must be `form-data; name="..."` with an optional `; filename="..."`, a body led by a preamble is refused, and a file part with no `Content-Type` is `text/plain` on every runtime.',
|
|
59
|
+
"`@nifrajs/web-vanilla`'s `html` writes each value for the place it lands: an unquoted attribute value is quoted, a `javascript:` or `vbscript:` URL at the start of a URL attribute becomes `about:invalid`, and a string or nested template throws as a tag name, inside `<script>` or `<style>`, or in an `on*` or `srcdoc` value. Interpolate a number or `raw()` trusted text there instead.",
|
|
60
|
+
"A reload of the page on screen keeps the identity of every part of `data` it did not change, and React and Preact layouts render memoized on their own props. Svelte pages receive `data` as the router published it, not as a deep reactive proxy, so writing into `data` in place no longer updates the page: copy what you edit into the page's own state. A page that compares `data` with its value from before a reload exports `shareData = false`.",
|
|
61
|
+
'While an intercept boundary holds a route in a modal, `useLocation`, `useSearch`, `useMatches` and the route props describe the page underneath; `RouterState.intercepted` names the boundary, and `path` stays the address-bar URL. A form with no action inside `data-nifra-boundary="<name>"` posts to the target, and the result arrives as the boundary\'s `actionData`.',
|
|
62
|
+
"`@nifrajs/coding-agent`: a plan with more subagent nodes than `limits.maxChildren` (default 4) fails to compile with `E_MAX_CHILDREN`, the ceiling counts retries, and `OrchestrationHost`'s `policy.allowedCapabilities` bounds every catalog step a plan resolves to.",
|
|
63
|
+
"`nifra mcp` answers a line that is not valid UTF-8 with `-32700` instead of running it, sends no reply to a notification whose handler throws, processes a last line without a trailing newline, and lets running requests answer before it shuts down when stdin closes.",
|
|
64
|
+
"An `authenticate()` stage, and the auth plugins built on one (`bearer()`, `jwt()`, `basicAuth()`, `apiKey()`), now gates the `mount()` and `mountFetch()` handlers registered after it, WebSocket upgrades included: a caller the stage refuses gets its response, not the mounted app. Register a mount that must stay public before the stage.",
|
|
65
|
+
"`t.integer()` is bounded to the safe-integer range by default, so a JSON or query value past 2^53 - 1, which has already been rounded when it is parsed, fails validation with a 422 instead of reaching the handler as a different number. A bound passed to `t.integer()` replaces the default on that side.",
|
|
66
|
+
"`env.number()` reads plain decimal text only, so `0x10`, `1e3` and `Infinity` are refused at startup. A value of only spaces is unset for `env.number()` and `env.port()`, so a `default` applies, and `env.boolean({ default })` returns the default for a variable that is set but empty.",
|
|
67
|
+
"`etag()` keeps an `ETag` the handler already set and answers `If-None-Match` against it, instead of replacing it with a hash of the body.",
|
|
68
|
+
],
|
|
69
|
+
}
|
package/src/recipes/index.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { recipe as v5_2_0 } from "./5.2.0.ts"
|
|
|
17
17
|
import { recipe as v5_3_0 } from "./5.3.0.ts"
|
|
18
18
|
import { recipe as v5_4_0 } from "./5.4.0.ts"
|
|
19
19
|
import { recipe as v5_5_0 } from "./5.5.0.ts"
|
|
20
|
+
import { recipe as v5_6_0 } from "./5.6.0.ts"
|
|
20
21
|
|
|
21
22
|
/** A pin rule: every dependency whose name starts with `match` is set to version `to`. */
|
|
22
23
|
export interface PinRule {
|
|
@@ -74,6 +75,7 @@ const RECIPES: Record<string, UpgradeRecipe> = {
|
|
|
74
75
|
[v5_3_0.version]: v5_3_0,
|
|
75
76
|
[v5_4_0.version]: v5_4_0,
|
|
76
77
|
[v5_5_0.version]: v5_5_0,
|
|
78
|
+
[v5_6_0.version]: v5_6_0,
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
export function getRecipe(version: string): UpgradeRecipe | undefined {
|
package/src/review.ts
CHANGED
|
@@ -132,9 +132,14 @@ export const CHECK_CODES: Readonly<Record<string, ReviewCheckId>> = {
|
|
|
132
132
|
"NF-C018": "route-boundary",
|
|
133
133
|
"NF-C019": "route-boundary",
|
|
134
134
|
"NF-C020": "route-boundary",
|
|
135
|
-
"NF-C021": "route-boundary",
|
|
136
135
|
"NF-C022": "route-boundary",
|
|
137
|
-
"NF-
|
|
136
|
+
"NF-C047": "route-boundary",
|
|
137
|
+
"NF-C048": "route-boundary",
|
|
138
|
+
"NF-C049": "route-boundary",
|
|
139
|
+
"NF-C050": "route-boundary",
|
|
140
|
+
"NF-C051": "route-boundary",
|
|
141
|
+
"NF-C052": "route-boundary",
|
|
142
|
+
"NF-C053": "route-boundary",
|
|
138
143
|
"NF-C024": "route-boundary",
|
|
139
144
|
"NF-C025": "route-boundary",
|
|
140
145
|
"NF-C026": "route-boundary",
|
package/src/rules/codes.ts
CHANGED
|
@@ -44,9 +44,14 @@ export const RULE_CODES = Object.freeze({
|
|
|
44
44
|
"NF-C045": "Route registered outside the typed chain",
|
|
45
45
|
"NF-C046": "Identity-sensitive version skew",
|
|
46
46
|
"NF-C020": "Island enhancer cleanup check",
|
|
47
|
-
"NF-
|
|
48
|
-
"NF-
|
|
49
|
-
"NF-
|
|
47
|
+
"NF-C022": "bindList key check",
|
|
48
|
+
"NF-C047": "Island binding name check",
|
|
49
|
+
"NF-C048": "Island binding outside a bindIsland host",
|
|
50
|
+
"NF-C049": "Swap link or form misdeclared",
|
|
51
|
+
"NF-C050": "Swap names a slot nothing declares",
|
|
52
|
+
"NF-C051": "Slot content is not its slot() alone",
|
|
53
|
+
"NF-C052": "Swap URL's page renders no such slot",
|
|
54
|
+
"NF-C053": "Partially prerendered page reads the request",
|
|
50
55
|
"NF-D001": "Doctor check",
|
|
51
56
|
"NF-D002": "Mixed nifra versions",
|
|
52
57
|
"NF-D003": "Stale file: dependencies in bun.lock",
|
|
@@ -68,7 +73,7 @@ export const RULE_CODES = Object.freeze({
|
|
|
68
73
|
} as const)
|
|
69
74
|
|
|
70
75
|
/** Codes that no longer fire but remain reserved forever. */
|
|
71
|
-
export const RETIRED_CODES: ReadonlySet<string> = new Set()
|
|
76
|
+
export const RETIRED_CODES: ReadonlySet<string> = new Set(["NF-C021", "NF-C023"])
|
|
72
77
|
|
|
73
78
|
export type BuiltInCode = keyof typeof RULE_CODES
|
|
74
79
|
|
|
@@ -118,20 +118,10 @@ export const RULE_EXPLANATIONS: Readonly<Record<BuiltInCode, RuleExplanation>> =
|
|
|
118
118
|
fix: "Return a function that removes the listener.",
|
|
119
119
|
docs: "/docs/islands",
|
|
120
120
|
},
|
|
121
|
-
"NF-C021": {
|
|
122
|
-
why: "A nano binding's returned disposer is discarded, so the binding outlives its component and leaks on soft navigation.",
|
|
123
|
-
fix: "Collect the disposer and call it on teardown.",
|
|
124
|
-
docs: "/docs/nano",
|
|
125
|
-
},
|
|
126
121
|
"NF-C022": {
|
|
127
|
-
why: "bindList
|
|
128
|
-
fix: "Key each item by a stable id.",
|
|
129
|
-
docs: "/docs/
|
|
130
|
-
},
|
|
131
|
-
"NF-C023": {
|
|
132
|
-
why: "A computed or effect reads a signal its deps array does not list, so it does not update when that signal changes.",
|
|
133
|
-
fix: "Add the missing signals to the deps array.",
|
|
134
|
-
docs: "/docs/nano",
|
|
122
|
+
why: "A bindList key reads the item's position (a second parameter, which bindList never passes, or an indexOf/findIndex call handed the item), so adding, removing or reordering items hands a node and its state to the wrong item.",
|
|
123
|
+
fix: "Key each item by a stable id on the item.",
|
|
124
|
+
docs: "/docs/islands",
|
|
135
125
|
},
|
|
136
126
|
"NF-C024": {
|
|
137
127
|
why: "Two route patterns match a common path (the finding shows one), so one shadows the other for some requests.",
|
|
@@ -253,6 +243,42 @@ export const RULE_EXPLANATIONS: Readonly<Record<BuiltInCode, RuleExplanation>> =
|
|
|
253
243
|
fix: "Install one version everywhere: align the ranges in every install root that carries a copy, or for nifra packages run `nifra upgrade <version>` in this app and in the linked repository, then install in each.",
|
|
254
244
|
docs: "/docs/troubleshooting",
|
|
255
245
|
},
|
|
246
|
+
"NF-C047": {
|
|
247
|
+
why: 'A data-bind-* attribute inside an island host names a signal its bindIsland setup never declares with state("..."), or a handler the setup does not return. At runtime the binding is skipped with a console warning, so the markup never updates or never reacts.',
|
|
248
|
+
fix: 'Fix the name in the markup, or declare it in the setup: state("name", initial) for a signal, a returned handler for data-bind-on.',
|
|
249
|
+
docs: "/docs/islands",
|
|
250
|
+
},
|
|
251
|
+
"NF-C048": {
|
|
252
|
+
why: "A data-bind-* attribute sits outside every data-island host, or inside a host mounted with defineIsland or a plain enhancer. Only bindIsland walks bindings, so this one never binds.",
|
|
253
|
+
fix: "Move the element inside a host mounted with bindIsland, or mount that host with bindIsland. A binding inside a data-swap-slot belongs to an island inside that slot, which a swap mounts again.",
|
|
254
|
+
docs: "/docs/islands",
|
|
255
|
+
},
|
|
256
|
+
"NF-C049": {
|
|
257
|
+
why: "A data-swap attribute sits on an element other than <a href> or <form>, its value is not replace:<slot> or append:<slot>, or it is in JSX, where no page can answer a slot swap. The link or form behaves as if the attribute were not there.",
|
|
258
|
+
fix: "Put data-swap on a link with an href or on a form, write replace:<slot> or append:<slot>, and render the page with @nifrajs/web-vanilla.",
|
|
259
|
+
docs: "/docs/islands",
|
|
260
|
+
},
|
|
261
|
+
"NF-C050": {
|
|
262
|
+
why: "A data-swap link or form names a slot that no data-swap-slot element in the project declares, so there is nothing to swap and every click loads the page normally.",
|
|
263
|
+
fix: 'Fix the slot name, or mark the region to refresh with data-swap-slot="<name>" and render its content with slot("<name>", ...).',
|
|
264
|
+
docs: "/docs/islands",
|
|
265
|
+
},
|
|
266
|
+
"NF-C051": {
|
|
267
|
+
why: 'A data-swap-slot element must hold slot("<name>", ...) and nothing else: the server answers a swap with what slot() renders and the client replaces the whole element content with it. Content beside it is lost on the first swap; without it, the server has nothing to answer with; a slot() outside its element swaps nothing.',
|
|
268
|
+
fix: 'Make slot("<name>", content) the only content of the element marked data-swap-slot="<name>", and move anything else outside it.',
|
|
269
|
+
docs: "/docs/islands",
|
|
270
|
+
},
|
|
271
|
+
"NF-C052": {
|
|
272
|
+
why: "A data-swap link or form goes to a page whose module and layouts render no slot() of the name it swaps, so the server answers with the whole document and every swap loads the page normally.",
|
|
273
|
+
fix: "Point the link or form at the page that renders the slot, or render the slot in that page.",
|
|
274
|
+
docs: "/docs/islands",
|
|
275
|
+
},
|
|
276
|
+
"NF-C053": {
|
|
277
|
+
why: "A page whose backend half exports shellLoader calls getContext() or tryGetContext(). Its shell is built once and served to every visitor, so the shell check refuses a page that reads the request.",
|
|
278
|
+
fix: "Read the request in a dynamic hole's loader, and render what uses it in that hole. The fix moves a read held in one const, and the one element that uses it, into a new hole.",
|
|
279
|
+
command: "nifra fix --code NF-C053",
|
|
280
|
+
docs: "/docs/partial-prerendering",
|
|
281
|
+
},
|
|
256
282
|
"NF-D001": {
|
|
257
283
|
why: "The doctor gate of `nifra assure` found an undeclared import or a package installed more than once.",
|
|
258
284
|
fix: "Run `nifra doctor` for the details and the fix of each finding.",
|