@nifrajs/web 2.2.0 → 2.3.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/README.md +3 -3
- package/dist/build-vite.d.ts +4 -4
- package/dist/build-vite.d.ts.map +1 -1
- package/dist/build-vite.js +20 -74
- package/dist/build-vite.js.map +1 -1
- package/dist/build.d.ts +64 -42
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +100 -78
- package/dist/build.js.map +1 -1
- package/dist/bun-dev-entry.d.ts +1 -1
- package/dist/bun-dev-entry.js +1 -1
- package/dist/chunk-names.js +1 -1
- package/dist/client.d.ts +3 -9
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +201 -29
- package/dist/client.js.map +1 -1
- package/dist/conformance.d.ts +2 -2
- package/dist/conformance.js +3 -3
- package/dist/deferred.d.ts +11 -11
- package/dist/deferred.d.ts.map +1 -1
- package/dist/deferred.js +16 -16
- package/dist/dev-error.d.ts +2 -2
- package/dist/dev-error.js +3 -3
- package/dist/dev-port.d.ts +2 -2
- package/dist/dev-port.js +1 -1
- package/dist/dev.d.ts +3 -3
- package/dist/dev.js +9 -9
- package/dist/draft.d.ts +12 -12
- package/dist/draft.js +11 -11
- package/dist/fn-state.d.ts +56 -0
- package/dist/fn-state.d.ts.map +1 -0
- package/dist/fn-state.js +77 -0
- package/dist/fn-state.js.map +1 -0
- package/dist/fn.d.ts +111 -0
- package/dist/fn.d.ts.map +1 -0
- package/dist/fn.js +125 -0
- package/dist/fn.js.map +1 -0
- package/dist/fonts-google.d.ts +9 -9
- package/dist/fonts-google.js +10 -10
- package/dist/fonts.d.ts +7 -7
- package/dist/fonts.js +1 -1
- package/dist/forms.d.ts +8 -8
- package/dist/fs.d.ts +1 -1
- package/dist/fs.js +1 -1
- package/dist/index.d.ts +151 -70
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +317 -139
- package/dist/index.js.map +1 -1
- package/dist/internal/head-attributes.d.ts +15 -0
- package/dist/internal/head-attributes.d.ts.map +1 -0
- package/dist/internal/head-attributes.js +99 -0
- package/dist/internal/head-attributes.js.map +1 -0
- package/dist/internal/script-types.d.ts +14 -0
- package/dist/internal/script-types.d.ts.map +1 -0
- package/dist/internal/script-types.js +17 -0
- package/dist/internal/script-types.js.map +1 -0
- package/dist/internal/server-boundary.d.ts +60 -0
- package/dist/internal/server-boundary.d.ts.map +1 -0
- package/dist/internal/server-boundary.js +174 -0
- package/dist/internal/server-boundary.js.map +1 -0
- package/dist/internal/timing-safe-equal.d.ts +1 -1
- package/dist/internal/timing-safe-equal.js +1 -1
- package/dist/internal/vite-import.d.ts +63 -0
- package/dist/internal/vite-import.d.ts.map +1 -0
- package/dist/internal/vite-import.js +94 -0
- package/dist/internal/vite-import.js.map +1 -0
- package/dist/islands.d.ts +5 -5
- package/dist/islands.js +5 -5
- package/dist/isr.d.ts +15 -15
- package/dist/isr.js +7 -7
- package/dist/manifest.d.ts +73 -35
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +10 -16
- package/dist/manifest.js.map +1 -1
- package/dist/module-graph.d.ts +5 -5
- package/dist/module-graph.js +4 -4
- package/dist/navigation.d.ts +120 -5
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +37 -5
- package/dist/navigation.js.map +1 -1
- package/dist/plugins/css-modules.d.ts +3 -3
- package/dist/plugins/css-modules.js +0 -0
- package/dist/plugins/kit.d.ts +8 -8
- package/dist/plugins/kit.js +9 -9
- package/dist/plugins/scss.js +3 -3
- package/dist/plugins/vite-leak-guard.d.ts +1 -1
- package/dist/plugins/vite-leak-guard.js +1 -1
- package/dist/plugins/vite-server-fn.d.ts +23 -0
- package/dist/plugins/vite-server-fn.d.ts.map +1 -0
- package/dist/plugins/vite-server-fn.js +51 -0
- package/dist/plugins/vite-server-fn.js.map +1 -0
- package/dist/plugins/vite-server-only.d.ts +49 -0
- package/dist/plugins/vite-server-only.d.ts.map +1 -0
- package/dist/plugins/vite-server-only.js +57 -0
- package/dist/plugins/vite-server-only.js.map +1 -0
- package/dist/prerender.d.ts +5 -5
- package/dist/prerender.js +7 -7
- package/dist/query.d.ts +10 -10
- package/dist/query.js +15 -15
- package/dist/route-manifest.d.ts +1 -1
- package/dist/route-manifest.js +2 -2
- package/dist/router.d.ts +30 -21
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +57 -28
- package/dist/router.js.map +1 -1
- package/dist/search.d.ts +94 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +232 -0
- package/dist/search.js.map +1 -0
- package/dist/server-only.d.ts +6 -6
- package/dist/server-only.js +7 -7
- package/dist/service-worker.d.ts +56 -0
- package/dist/service-worker.d.ts.map +1 -0
- package/dist/service-worker.js +127 -0
- package/dist/service-worker.js.map +1 -0
- package/dist/vite.d.ts +15 -13
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +31 -21
- package/dist/vite.js.map +1 -1
- package/package.json +33 -4
- package/server-manifest.d.ts +31 -0
- package/src/build-vite.ts +24 -77
- package/src/build.ts +137 -105
- package/src/bun-dev-entry.ts +1 -1
- package/src/chunk-names.ts +1 -1
- package/src/client.ts +215 -32
- package/src/conformance.ts +3 -3
- package/src/deferred.ts +17 -17
- package/src/dev-error.ts +3 -3
- package/src/dev-port.ts +2 -2
- package/src/dev.ts +12 -12
- package/src/draft.ts +15 -15
- package/src/fn-state.ts +107 -0
- package/src/fn.ts +199 -0
- package/src/fonts-google.ts +13 -13
- package/src/fonts.ts +7 -7
- package/src/forms.ts +8 -8
- package/src/fs.ts +2 -2
- package/src/index.ts +460 -181
- package/src/internal/head-attributes.ts +109 -0
- package/src/internal/script-types.ts +18 -0
- package/src/internal/server-boundary.ts +187 -0
- package/src/internal/timing-safe-equal.ts +1 -1
- package/src/internal/vite-import.ts +92 -0
- package/src/islands.ts +7 -7
- package/src/isr.ts +17 -17
- package/src/manifest.ts +83 -42
- package/src/module-graph.ts +6 -6
- package/src/navigation.ts +151 -5
- package/src/plugins/css-modules.ts +0 -0
- package/src/plugins/kit.ts +11 -11
- package/src/plugins/scss.ts +3 -3
- package/src/plugins/vite-leak-guard.ts +2 -2
- package/src/plugins/vite-server-fn.ts +67 -0
- package/src/plugins/vite-server-only.ts +75 -0
- package/src/prerender.ts +10 -10
- package/src/query.ts +22 -22
- package/src/route-manifest.ts +3 -3
- package/src/router.ts +91 -41
- package/src/search.ts +297 -0
- package/src/server-only.ts +7 -7
- package/src/service-worker.ts +165 -0
- package/src/vite.ts +41 -29
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAOA,OAAO,EAAwB,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAQ1E;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAoB,EACpB,UAAiC,EAAE;IAEnC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;IAE9E,0FAA0F;IAC1F,wFAAwF;IACxF,OAAO,CAAC,iBAAiB,GAAG,QAAQ,CAAA;IAIpC,IAAI,aAAa,GAAyB,IAAI,CAAA;IAC9C,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoB,EAAE;QACpD,MAAM,KAAK,GAAI,KAAmD,EAAE,WAAW,CAAA;QAC/E,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAC9C,CAAC,CAAA;IACD,oGAAoG;IACpG,MAAM,MAAM,GAAG,CAAC,IAAY,EAAU,EAAE;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACzB,IAAI,CAAC;YACH,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAA;QAChC,CA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,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;YACtF,IAAI,CAAC,MAAM,EAAE,CAAA,CAAC,qDAAqD;QACrE,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;IACD,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC7C,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;AAC/D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAA;IACnC,IAAI,EAAE,CAAC,YAAY,CAAC,qBAAqB,CAAC;QAAE,OAAM;IAClD,EAAE,CAAC,YAAY,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAA;IAC1C,QAAQ,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAA;AACrD,CAAC"}
|
package/dist/conformance.d.ts
CHANGED
|
@@ -39,8 +39,8 @@ export declare class RenderAdapterConformanceError extends Error {
|
|
|
39
39
|
* and hydration-head output is a stable string. It rejects with
|
|
40
40
|
* {@link RenderAdapterConformanceError} naming the first failed check.
|
|
41
41
|
*
|
|
42
|
-
* Framework semantics outside the interface
|
|
43
|
-
* error boundaries, and framework-specific primitives
|
|
42
|
+
* Framework semantics outside the interface-Suspense scheduling, compiler plugins, DOM hydration,
|
|
43
|
+
* error boundaries, and framework-specific primitives-remain the adapter package's local tests.
|
|
44
44
|
*/
|
|
45
45
|
export declare function assertRenderAdapterConformance(adapter: RenderAdapter, fixture: RenderAdapterConformanceFixture): Promise<void>;
|
|
46
46
|
//# sourceMappingURL=conformance.d.ts.map
|
package/dist/conformance.js
CHANGED
|
@@ -60,8 +60,8 @@ const readHtml = async (render, check) => {
|
|
|
60
60
|
* and hydration-head output is a stable string. It rejects with
|
|
61
61
|
* {@link RenderAdapterConformanceError} naming the first failed check.
|
|
62
62
|
*
|
|
63
|
-
* Framework semantics outside the interface
|
|
64
|
-
* error boundaries, and framework-specific primitives
|
|
63
|
+
* Framework semantics outside the interface-Suspense scheduling, compiler plugins, DOM hydration,
|
|
64
|
+
* error boundaries, and framework-specific primitives-remain the adapter package's local tests.
|
|
65
65
|
*/
|
|
66
66
|
export async function assertRenderAdapterConformance(adapter, fixture) {
|
|
67
67
|
const { markers, page, outerLayout, innerLayout, props } = fixture;
|
|
@@ -98,7 +98,7 @@ export async function assertRenderAdapterConformance(adapter, fixture) {
|
|
|
98
98
|
fail("buffered render", "renderToString must return a string");
|
|
99
99
|
const bufferedHtml = buffered;
|
|
100
100
|
if (fixture.deferred) {
|
|
101
|
-
// Deferred content differs between streaming and buffered renders
|
|
101
|
+
// Deferred content differs between streaming and buffered renders - only require every marker.
|
|
102
102
|
for (const marker of [
|
|
103
103
|
markers.outer,
|
|
104
104
|
markers.inner,
|
package/dist/deferred.d.ts
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* Deferred loader data (`defer()`). A loader may mark slow values as deferred: the critical data
|
|
3
3
|
* renders in the shell, the deferred data streams in behind a `<Suspense>` (the adapter's `<Await>`
|
|
4
4
|
* consumes it) and resolves on the client **without a re-fetch**. This module owns the agnostic
|
|
5
|
-
* protocol
|
|
5
|
+
* protocol - the marker, the resolved/deferred split, and the tiny client registry that streamed
|
|
6
6
|
* resolution scripts settle. The per-adapter `<Await>` lives in `@nifrajs/web-{solid,react}/client`.
|
|
7
7
|
*/
|
|
8
8
|
import { type TransportCodec } from "@nifrajs/core/transport-codec";
|
|
9
9
|
/**
|
|
10
10
|
* A loader value marked to stream in after the shell. The component consumes it with the adapter's
|
|
11
11
|
* `<Await resolve={...}>`; until the promise settles the shell shows the `<Suspense>` fallback.
|
|
12
|
-
* `id` is assigned by the server at serialization time
|
|
12
|
+
* `id` is assigned by the server at serialization time - the streamed resolve script keys off it.
|
|
13
13
|
*/
|
|
14
14
|
export interface Deferred<T> {
|
|
15
15
|
readonly __nifra_deferred: true;
|
|
@@ -17,8 +17,8 @@ export interface Deferred<T> {
|
|
|
17
17
|
readonly promise: Promise<T>;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* Mark a loader value as deferred
|
|
21
|
-
* **anywhere** in the loader's returned data
|
|
20
|
+
* Mark a loader value as deferred - it streams in after the shell instead of blocking it. Works
|
|
21
|
+
* **anywhere** in the loader's returned data - a top-level key, or nested in objects/arrays:
|
|
22
22
|
*
|
|
23
23
|
* return { user: await api.user.get(), feed: defer(api.user.feed()),
|
|
24
24
|
* panels: [{ chart: defer(api.metrics()) }] }
|
|
@@ -30,8 +30,8 @@ export declare function defer<T>(promise: Promise<T>): Deferred<T>;
|
|
|
30
30
|
/**
|
|
31
31
|
* Split a loader (or action) result into the **component-facing** data (deferred values carry their
|
|
32
32
|
* assigned `id` + promise, for `<Await>`) and the **client-serializable** data (deferred values
|
|
33
|
-
* replaced with a `{__nifra_deferred: id}` placeholder
|
|
34
|
-
* **recursively**
|
|
33
|
+
* replaced with a `{__nifra_deferred: id}` placeholder - promises don't serialize). Walks the tree
|
|
34
|
+
* **recursively** - `defer()` works at any depth, inside nested objects and arrays - assigning ids in
|
|
35
35
|
* walk order. `idOffset` continues the id space when a page splits two results (loader data **and**
|
|
36
36
|
* action data) into one shared client registry, so their ids don't collide. `deferred` lists the
|
|
37
37
|
* promises for callers that await them. Recurses plain objects + arrays only; the data is expected to
|
|
@@ -46,7 +46,7 @@ export declare function prepareDeferred(data: unknown, idOffset?: number): {
|
|
|
46
46
|
}>;
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
|
-
* Stable, non-leaking payload streamed to the client when a deferred value rejects
|
|
49
|
+
* Stable, non-leaking payload streamed to the client when a deferred value rejects - never the raw
|
|
50
50
|
* error text. The real reason is logged server-side; `<Await>`'s `errorFallback` receives
|
|
51
51
|
* this code. (A future typed `DeferredError` could opt into a public, intentional message.) Shared by
|
|
52
52
|
* the NDJSON soft-nav transport and the full-document SSR path (`renderPage`'s `streamDocument`).
|
|
@@ -55,7 +55,7 @@ export declare const DEFERRED_ERROR_CODE = "deferred_error";
|
|
|
55
55
|
/**
|
|
56
56
|
* Stream a loader result as NDJSON for a client (soft) navigation: line 1 is the critical data with
|
|
57
57
|
* `{__nifra_deferred: id}` placeholders (`forClient`), then one line per deferred as its promise
|
|
58
|
-
* settles
|
|
58
|
+
* settles - `{"i": id, "v": value}` on resolve, `{"i": id, "e": "deferred_error"}` on reject (a
|
|
59
59
|
* rejection is data, not a stream error; the opaque code never leaks the raw reason). Closes when all
|
|
60
60
|
* settle. The client (`defaultFetchData`) returns the
|
|
61
61
|
* data after line 1 and settles `<Await>`'s markers as the resolution lines arrive. `JSON.stringify`
|
|
@@ -73,10 +73,10 @@ export declare function ndjsonStream(forClient: unknown, deferred: ReadonlyArray
|
|
|
73
73
|
* works), plus `__nifraDeferred(id)` to read the promise. A plain inline script (not the deferred
|
|
74
74
|
* module entry), so it runs before any streamed resolve script.
|
|
75
75
|
*/
|
|
76
|
-
export declare const DEFERRED_RUNTIME = "(() => {\n const reg = new Map();\n const get = (id) => {\n let e = reg.get(id);\n if (!e) {\n let r, j;\n const p = new Promise((a, b) => { r = a; j = b; });\n // <Await> reads the tagged status/reason synchronously (it never .then()s a rejected promise),\n // so attach a no-op catch to keep a rejection from surfacing as an unhandled rejection.\n p.catch(() => {});\n e = { p, r, j };\n reg.set(id, e);\n }\n return e;\n };\n window.__nifraDeferred = (id) => get(id).p;\n // Tag the promise (status/value/reason)
|
|
76
|
+
export declare const DEFERRED_RUNTIME = "(() => {\n const reg = new Map();\n const get = (id) => {\n let e = reg.get(id);\n if (!e) {\n let r, j;\n const p = new Promise((a, b) => { r = a; j = b; });\n // <Await> reads the tagged status/reason synchronously (it never .then()s a rejected promise),\n // so attach a no-op catch to keep a rejection from surfacing as an unhandled rejection.\n p.catch(() => {});\n e = { p, r, j };\n reg.set(id, e);\n }\n return e;\n };\n window.__nifraDeferred = (id) => get(id).p;\n // Tag the promise (status/value/reason) - React's use() reads them and returns SYNCHRONOUSLY at\n // hydration, so it renders the resolved content directly into the <Suspense> boundary the server\n // streamed (no re-suspend, no fallback flash). r/j also wake awaiters (Solid uses its own _$HY).\n window.__nifraResolve = (id, v) => { const e = get(id); e.p.status = \"fulfilled\"; e.p.value = v; e.r(v); };\n window.__nifraReject = (id, x) => { const e = get(id); e.p.status = \"rejected\"; e.p.reason = x; e.j(x); };\n})();";
|
|
77
77
|
/**
|
|
78
78
|
* Source emitted into the generated client entry: maps serialized `{__nifra_deferred: id}` placeholders
|
|
79
|
-
* (at any depth
|
|
79
|
+
* (at any depth - nested objects/arrays) to the registry's promises, so the component receives real
|
|
80
80
|
* promises to `<Await>`. A no-op for data without placeholders (so non-deferred pages are unchanged).
|
|
81
81
|
*/
|
|
82
82
|
export declare const MAP_DEFERRED_SOURCE = "const mapDeferred = (d) => {\n if (!d || typeof d !== \"object\") return d\n if (typeof d.__nifra_deferred === \"number\") return { __nifra_deferred: true, id: d.__nifra_deferred, promise: window.__nifraDeferred(d.__nifra_deferred) }\n if (Array.isArray(d)) return d.map(mapDeferred)\n const out = {}\n for (const k in d) out[k] = mapDeferred(d[k])\n return out\n}";
|
|
@@ -85,7 +85,7 @@ export declare const MAP_DEFERRED_SOURCE = "const mapDeferred = (d) => {\n if (
|
|
|
85
85
|
* the NDJSON body into a data object whose deferred markers settle as resolution lines arrive.
|
|
86
86
|
* Returns after **line 1** so the router can apply the critical data + render immediately; the
|
|
87
87
|
* markers' promises settle/reject in the background. If the stream ends (or `signal` aborts) with
|
|
88
|
-
* markers unsettled, they reject
|
|
88
|
+
* markers unsettled, they reject - so `<Await>` never hangs.
|
|
89
89
|
*/
|
|
90
90
|
export declare function parseNdjsonData(stream: ReadableStream<Uint8Array>, signal?: AbortSignal, codec?: TransportCodec): Promise<un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,GACrC,cAAc,CAAC,UAAU,CAAC,CAsB5B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,siCAqBvB,CAAA;AAEN;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,uXAO9B,CAAA;AA8CF;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,EAClC,MAAM,CAAC,EAAE,WAAW,EACpB,KAAK,GAAE,cAA+B,GACrC,OAAO,CAAC,OAAO,CAAC,CA4DlB"}
|
package/dist/deferred.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Deferred loader data (`defer()`). A loader may mark slow values as deferred: the critical data
|
|
3
3
|
* renders in the shell, the deferred data streams in behind a `<Suspense>` (the adapter's `<Await>`
|
|
4
4
|
* consumes it) and resolves on the client **without a re-fetch**. This module owns the agnostic
|
|
5
|
-
* protocol
|
|
5
|
+
* protocol - the marker, the resolved/deferred split, and the tiny client registry that streamed
|
|
6
6
|
* resolution scripts settle. The per-adapter `<Await>` lives in `@nifrajs/web-{solid,react}/client`.
|
|
7
7
|
*/
|
|
8
8
|
import { plainJsonCodec } from "@nifrajs/core/transport-codec";
|
|
9
9
|
/**
|
|
10
|
-
* Mark a loader value as deferred
|
|
11
|
-
* **anywhere** in the loader's returned data
|
|
10
|
+
* Mark a loader value as deferred - it streams in after the shell instead of blocking it. Works
|
|
11
|
+
* **anywhere** in the loader's returned data - a top-level key, or nested in objects/arrays:
|
|
12
12
|
*
|
|
13
13
|
* return { user: await api.user.get(), feed: defer(api.user.feed()),
|
|
14
14
|
* panels: [{ chart: defer(api.metrics()) }] }
|
|
@@ -32,8 +32,8 @@ function isDeferred(value) {
|
|
|
32
32
|
/**
|
|
33
33
|
* Split a loader (or action) result into the **component-facing** data (deferred values carry their
|
|
34
34
|
* assigned `id` + promise, for `<Await>`) and the **client-serializable** data (deferred values
|
|
35
|
-
* replaced with a `{__nifra_deferred: id}` placeholder
|
|
36
|
-
* **recursively**
|
|
35
|
+
* replaced with a `{__nifra_deferred: id}` placeholder - promises don't serialize). Walks the tree
|
|
36
|
+
* **recursively** - `defer()` works at any depth, inside nested objects and arrays - assigning ids in
|
|
37
37
|
* walk order. `idOffset` continues the id space when a page splits two results (loader data **and**
|
|
38
38
|
* action data) into one shared client registry, so their ids don't collide. `deferred` lists the
|
|
39
39
|
* promises for callers that await them. Recurses plain objects + arrays only; the data is expected to
|
|
@@ -42,7 +42,7 @@ function isDeferred(value) {
|
|
|
42
42
|
export function prepareDeferred(data, idOffset = 0) {
|
|
43
43
|
const deferred = [];
|
|
44
44
|
// Structural sharing: a subtree with no deferred value returns the ORIGINAL node for
|
|
45
|
-
// both sides (`fc`/`cl` identical to the input), so a deferred-free result
|
|
45
|
+
// both sides (`fc`/`cl` identical to the input), so a deferred-free result - the common case - is
|
|
46
46
|
// returned by reference with no persisted clone, no downstream copy, and no throwaway clone
|
|
47
47
|
// allocations. Only the path to a `defer()` marker is rebuilt; unchanged siblings are shared by
|
|
48
48
|
// reference.
|
|
@@ -119,18 +119,18 @@ export function prepareDeferred(data, idOffset = 0) {
|
|
|
119
119
|
: { forComponent: result.fc, forClient: result.cl, deferred };
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
|
-
* Stable, non-leaking payload streamed to the client when a deferred value rejects
|
|
122
|
+
* Stable, non-leaking payload streamed to the client when a deferred value rejects - never the raw
|
|
123
123
|
* error text. The real reason is logged server-side; `<Await>`'s `errorFallback` receives
|
|
124
124
|
* this code. (A future typed `DeferredError` could opt into a public, intentional message.) Shared by
|
|
125
125
|
* the NDJSON soft-nav transport and the full-document SSR path (`renderPage`'s `streamDocument`).
|
|
126
126
|
*/
|
|
127
127
|
export const DEFERRED_ERROR_CODE = "deferred_error";
|
|
128
|
-
// Shared, stateless
|
|
128
|
+
// Shared, stateless - allocated once at module load, not per stream.
|
|
129
129
|
const NDJSON_ENCODER = new TextEncoder();
|
|
130
130
|
/**
|
|
131
131
|
* Stream a loader result as NDJSON for a client (soft) navigation: line 1 is the critical data with
|
|
132
132
|
* `{__nifra_deferred: id}` placeholders (`forClient`), then one line per deferred as its promise
|
|
133
|
-
* settles
|
|
133
|
+
* settles - `{"i": id, "v": value}` on resolve, `{"i": id, "e": "deferred_error"}` on reject (a
|
|
134
134
|
* rejection is data, not a stream error; the opaque code never leaks the raw reason). Closes when all
|
|
135
135
|
* settle. The client (`defaultFetchData`) returns the
|
|
136
136
|
* data after line 1 and settles `<Await>`'s markers as the resolution lines arrive. `JSON.stringify`
|
|
@@ -180,7 +180,7 @@ export const DEFERRED_RUNTIME = `(() => {
|
|
|
180
180
|
return e;
|
|
181
181
|
};
|
|
182
182
|
window.__nifraDeferred = (id) => get(id).p;
|
|
183
|
-
// Tag the promise (status/value/reason)
|
|
183
|
+
// Tag the promise (status/value/reason) - React's use() reads them and returns SYNCHRONOUSLY at
|
|
184
184
|
// hydration, so it renders the resolved content directly into the <Suspense> boundary the server
|
|
185
185
|
// streamed (no re-suspend, no fallback flash). r/j also wake awaiters (Solid uses its own _$HY).
|
|
186
186
|
window.__nifraResolve = (id, v) => { const e = get(id); e.p.status = "fulfilled"; e.p.value = v; e.r(v); };
|
|
@@ -188,7 +188,7 @@ export const DEFERRED_RUNTIME = `(() => {
|
|
|
188
188
|
})();`;
|
|
189
189
|
/**
|
|
190
190
|
* Source emitted into the generated client entry: maps serialized `{__nifra_deferred: id}` placeholders
|
|
191
|
-
* (at any depth
|
|
191
|
+
* (at any depth - nested objects/arrays) to the registry's promises, so the component receives real
|
|
192
192
|
* promises to `<Await>`. A no-op for data without placeholders (so non-deferred pages are unchanged).
|
|
193
193
|
*/
|
|
194
194
|
export const MAP_DEFERRED_SOURCE = `const mapDeferred = (d) => {
|
|
@@ -199,18 +199,18 @@ export const MAP_DEFERRED_SOURCE = `const mapDeferred = (d) => {
|
|
|
199
199
|
for (const k in d) out[k] = mapDeferred(d[k])
|
|
200
200
|
return out
|
|
201
201
|
}`;
|
|
202
|
-
/** Replace `{__nifra_deferred: <number>}` placeholders (at any depth
|
|
202
|
+
/** Replace `{__nifra_deferred: <number>}` placeholders (at any depth - nested objects/arrays) with
|
|
203
203
|
* `Deferred` markers whose promises are held open in `pending` (settled later by
|
|
204
204
|
* {@link parseNdjsonData}'s drain). Mirrors `prepareDeferred`'s recursive walk. */
|
|
205
205
|
function markersFromPlaceholders(data, pending) {
|
|
206
|
-
// Markers already created in THIS parse, keyed by id
|
|
206
|
+
// Markers already created in THIS parse, keyed by id - so a repeated id aliases the first marker.
|
|
207
207
|
const byId = new Map();
|
|
208
208
|
const walk = (value) => {
|
|
209
209
|
const id = value?.__nifra_deferred;
|
|
210
210
|
if (value !== null && typeof value === "object" && typeof id === "number") {
|
|
211
211
|
// The NDJSON stream is a trust boundary; the server assigns unique ids, but a corrupt/crafted
|
|
212
212
|
// line-1 could repeat one. Alias a duplicate id to the first marker (same promise) instead of
|
|
213
|
-
// overwriting its resolver in `pending`
|
|
213
|
+
// overwriting its resolver in `pending` - otherwise the first marker would never settle (a
|
|
214
214
|
// permanently-pending promise that leaks on abort). One resolve line then settles both.
|
|
215
215
|
const seen = byId.get(id);
|
|
216
216
|
if (seen !== undefined)
|
|
@@ -246,7 +246,7 @@ function markersFromPlaceholders(data, pending) {
|
|
|
246
246
|
* the NDJSON body into a data object whose deferred markers settle as resolution lines arrive.
|
|
247
247
|
* Returns after **line 1** so the router can apply the critical data + render immediately; the
|
|
248
248
|
* markers' promises settle/reject in the background. If the stream ends (or `signal` aborts) with
|
|
249
|
-
* markers unsettled, they reject
|
|
249
|
+
* markers unsettled, they reject - so `<Await>` never hangs.
|
|
250
250
|
*/
|
|
251
251
|
export async function parseNdjsonData(stream, signal, codec = plainJsonCodec) {
|
|
252
252
|
const reader = stream.getReader();
|
|
@@ -297,7 +297,7 @@ export async function parseNdjsonData(stream, signal, codec = plainJsonCodec) {
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
catch {
|
|
300
|
-
// stream errored
|
|
300
|
+
// stream errored - leftovers are rejected below (unless this was an abort)
|
|
301
301
|
}
|
|
302
302
|
finally {
|
|
303
303
|
signal?.removeEventListener("abort", onAbort); // no-op if it already fired ({ once: true })
|
package/dist/dev-error.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Dev-only error overlay. When a loader/action/render throws during `@nifrajs/web/vite` dev, this
|
|
3
|
-
* renders a readable full-page overlay
|
|
4
|
-
* `ssrFixStacktrace` runs first), and the request line
|
|
3
|
+
* renders a readable full-page overlay - the message, the source-mapped stack (Vite's
|
|
4
|
+
* `ssrFixStacktrace` runs first), and the request line - instead of the bare `err.stack` text dump.
|
|
5
5
|
* Dev-only by construction: it's called solely from the Vite middleware's catch, never in
|
|
6
6
|
* production (production maps errors to the `_error` route boundary).
|
|
7
7
|
*/
|
package/dist/dev-error.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Dev-only error overlay. When a loader/action/render throws during `@nifrajs/web/vite` dev, this
|
|
3
|
-
* renders a readable full-page overlay
|
|
4
|
-
* `ssrFixStacktrace` runs first), and the request line
|
|
3
|
+
* renders a readable full-page overlay - the message, the source-mapped stack (Vite's
|
|
4
|
+
* `ssrFixStacktrace` runs first), and the request line - instead of the bare `err.stack` text dump.
|
|
5
5
|
* Dev-only by construction: it's called solely from the Vite middleware's catch, never in
|
|
6
6
|
* production (production maps errors to the `_error` route boundary).
|
|
7
7
|
*/
|
|
@@ -31,7 +31,7 @@ export function renderDevErrorOverlay(err, req) {
|
|
|
31
31
|
const framesHtml = frames.length > 0
|
|
32
32
|
? `<ol class="frames">${frames.map((f) => `<li>${esc(f)}</li>`).join("")}</ol>`
|
|
33
33
|
: `<p class="no-frames">No stack frames.</p>`;
|
|
34
|
-
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><title>${name}
|
|
34
|
+
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><title>${name} - nifra dev</title>
|
|
35
35
|
<style>
|
|
36
36
|
:root { color-scheme: dark }
|
|
37
37
|
body { margin: 0; background: #0b0d10; color: #e6e6e6; font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
|
package/dist/dev-port.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@nifrajs/web/dev-port`
|
|
2
|
+
* `@nifrajs/web/dev-port` - what a dev server says when it cannot bind.
|
|
3
3
|
*
|
|
4
4
|
* Both pipelines need this and neither should own it: the Vite server binds through Node's `http`
|
|
5
5
|
* (asynchronous `error` event), the Bun server binds through `Bun.serve` (synchronous throw). Two very
|
|
@@ -20,7 +20,7 @@ export declare function portInUseMessage(port: number): string;
|
|
|
20
20
|
export declare const isAddressInUse: (err: unknown) => boolean;
|
|
21
21
|
/** Map a bind failure to the port-collision explanation, leaving every other failure as itself. */
|
|
22
22
|
export declare const explainBindFailure: (err: unknown, port: number) => Error;
|
|
23
|
-
/** The bits of a Node server {@link listenOrExplain} touches
|
|
23
|
+
/** The bits of a Node server {@link listenOrExplain} touches - structural, so a test can fake it. */
|
|
24
24
|
export interface ListenTarget {
|
|
25
25
|
listen(port: number, cb: () => void): void;
|
|
26
26
|
once(event: "error", cb: (err: unknown) => void): void;
|
package/dist/dev-port.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@nifrajs/web/dev-port`
|
|
2
|
+
* `@nifrajs/web/dev-port` - what a dev server says when it cannot bind.
|
|
3
3
|
*
|
|
4
4
|
* Both pipelines need this and neither should own it: the Vite server binds through Node's `http`
|
|
5
5
|
* (asynchronous `error` event), the Bun server binds through `Bun.serve` (synchronous throw). Two very
|
package/dist/dev.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type BuildClientOptions } from "./build.js";
|
|
2
|
-
/** Minimal app surface the dev server needs
|
|
2
|
+
/** Minimal app surface the dev server needs - `createWebApp(...)` satisfies it. */
|
|
3
3
|
interface FetchApp {
|
|
4
4
|
fetch(request: Request): Response | Promise<Response>;
|
|
5
5
|
}
|
|
6
6
|
export interface DevServerOptions extends Omit<BuildClientOptions, "minify"> {
|
|
7
7
|
/**
|
|
8
|
-
* Build the nifra app for the current client entry. `importQuery` changes on every reload
|
|
8
|
+
* Build the nifra app for the current client entry. `importQuery` changes on every reload - pass it to
|
|
9
9
|
* `discoverRoutes(routesDir, { importQuery })` so SSR re-imports edited route modules instead of Bun's
|
|
10
10
|
* cached copies.
|
|
11
11
|
*/
|
|
@@ -30,7 +30,7 @@ export interface DevServerOptions extends Omit<BuildClientOptions, "minify"> {
|
|
|
30
30
|
export interface DevServer {
|
|
31
31
|
readonly port: number;
|
|
32
32
|
/**
|
|
33
|
-
* The URL pages point their client entry at
|
|
33
|
+
* The URL pages point their client entry at - always {@link CLIENT_ENTRY_PATH}, never Bun's hashed
|
|
34
34
|
* chunk. Deliberately not the underlying chunk URL: that one moves on every rebuild, and anything
|
|
35
35
|
* holding onto it is holding onto a URL that will stop working.
|
|
36
36
|
*/
|
package/dist/dev.js
CHANGED
|
@@ -7,7 +7,7 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
7
7
|
return path;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
|
-
* `@nifrajs/web/dev`
|
|
10
|
+
* `@nifrajs/web/dev` - the **Bun pipeline's** dev server: one toolchain, no Vite in the process.
|
|
11
11
|
*
|
|
12
12
|
* nifra ships two dev pipelines and the rule between them is that a pipeline owns a whole phase. The
|
|
13
13
|
* Vite server (`@nifrajs/web/vite`) is the default - mature framework plugins, and it resolves SSR as
|
|
@@ -15,12 +15,12 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
15
15
|
* and hot-reloads the client while Bun's runtime resolves SSR. Only one toolchain is present, so the two
|
|
16
16
|
* cannot disagree.
|
|
17
17
|
*
|
|
18
|
-
* What you get: React Fast Refresh WITH state preserved
|
|
18
|
+
* What you get: React Fast Refresh WITH state preserved - Bun's dev server applies it natively, no plugin
|
|
19
19
|
* (verified: editing a component-only module swaps its markup while a `useState` counter keeps its value,
|
|
20
20
|
* no reload). The usual boundary rule still applies, and it is the same rule Vite has: a module whose
|
|
21
21
|
* exports are all components is a refresh boundary, so a ROUTE file that also exports `loader`/`meta` is
|
|
22
22
|
* not, and saving it does a clean full reload. Plus no Vite dependency and ONE bundler across dev and
|
|
23
|
-
* production, which is the real prize
|
|
23
|
+
* production, which is the real prize - the dev/prod seam disappears.
|
|
24
24
|
*
|
|
25
25
|
* What you give up: `*.module.css`. Bun's DEV-server bundler has no CSS-Modules transform (its production
|
|
26
26
|
* `Bun.build` does), so the import compiles to a dangling reference. Plain CSS and Tailwind are fine. The
|
|
@@ -94,7 +94,7 @@ function writeIfChanged(path, content) {
|
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
catch {
|
|
97
|
-
// missing or unreadable
|
|
97
|
+
// missing or unreadable - fall through and write
|
|
98
98
|
}
|
|
99
99
|
writeFileSync(path, content);
|
|
100
100
|
}
|
|
@@ -125,13 +125,13 @@ export function writeDevFiles(options) {
|
|
|
125
125
|
// A bare relative path reads as a PACKAGE specifier to a bundler; `./` is what makes it a file.
|
|
126
126
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
127
127
|
};
|
|
128
|
-
// No `import.meta.hot.accept` here, deliberately. When an edit lands OUTSIDE a Fast Refresh boundary
|
|
129
|
-
// a route file, which also exports `loader`/`meta`
|
|
128
|
+
// No `import.meta.hot.accept` here, deliberately. When an edit lands OUTSIDE a Fast Refresh boundary -
|
|
129
|
+
// a route file, which also exports `loader`/`meta` - Bun walks up to this generated entry, finds no
|
|
130
130
|
// `accept`, logs "hot update was not accepted" and does a full reload. That reload is correct: the route
|
|
131
131
|
// module's non-component exports changed, so patching it into the live tree would be wrong. Accepting
|
|
132
132
|
// here is worse than the warning: Bun re-evaluates the module BEFORE the accept callback runs, so the
|
|
133
133
|
// entry re-executes against a container React already mounted ("createRoot() on a container that has
|
|
134
|
-
// already been passed to createRoot()") and only then does the callback get to reload
|
|
134
|
+
// already been passed to createRoot()") and only then does the callback get to reload - trading an
|
|
135
135
|
// accurate warning for a real error. Editing a component-only module never reaches this path: Bun
|
|
136
136
|
// applies React Fast Refresh there and state is preserved.
|
|
137
137
|
writeIfChanged(entryPath, generateClientEntry(manifest, { clientModule, resolve: toSpecifier }));
|
|
@@ -186,9 +186,9 @@ export async function createDevServer(options) {
|
|
|
186
186
|
// Bun resolves and bundles the HTML, and everything it references, at import time.
|
|
187
187
|
const htmlModule = (await import(__rewriteRelativeImportExtension(htmlPath)));
|
|
188
188
|
let server;
|
|
189
|
-
// The last resolved entry, with the time it was resolved. Deliberately short-lived
|
|
189
|
+
// The last resolved entry, with the time it was resolved. Deliberately short-lived - see `currentEntry`.
|
|
190
190
|
let cache;
|
|
191
|
-
// The app, tagged with the entry hash it was built against
|
|
191
|
+
// The app, tagged with the entry hash it was built against - see `appFor`.
|
|
192
192
|
let built;
|
|
193
193
|
let building;
|
|
194
194
|
let version = 0;
|
package/dist/draft.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Draft / preview mode
|
|
2
|
+
* Draft / preview mode - let an editor see unpublished content by flipping a signed cookie that
|
|
3
3
|
* loaders read (`ctx.draft`) and ISR bypasses (fresh render, never cached). The cookie is **HMAC-signed**
|
|
4
|
-
* (so a visitor can't forge it) and **HttpOnly** (JS can't read it). You gate `enableDraft` yourself
|
|
5
|
-
* behind an editor login or a `?token=` check
|
|
4
|
+
* (so a visitor can't forge it) and **HttpOnly** (JS can't read it). You gate `enableDraft` yourself -
|
|
5
|
+
* behind an editor login or a `?token=` check - exactly like Next's `draftMode().enable()`.
|
|
6
6
|
*
|
|
7
7
|
* // a route you've protected (e.g. checked ?token= against a secret):
|
|
8
8
|
* app.get("/api/draft", async (c) => {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { type CookieOptions } from "@nifrajs/core/server";
|
|
18
18
|
/** The cookie name nifra uses for draft/preview mode. */
|
|
19
19
|
export declare const DRAFT_COOKIE = "__nifra_draft";
|
|
20
|
-
/** The response-cookie surface `enableDraft`/`disableDraft` need
|
|
20
|
+
/** The response-cookie surface `enableDraft`/`disableDraft` need - nifra's `c.set`. Structural, so any
|
|
21
21
|
* nifra handler context satisfies it without importing the full `Context`. */
|
|
22
22
|
export interface DraftCookieControls {
|
|
23
23
|
cookie(name: string, value: string, options?: CookieOptions): void;
|
|
@@ -27,17 +27,17 @@ export interface DraftCookieControls {
|
|
|
27
27
|
}): void;
|
|
28
28
|
}
|
|
29
29
|
export interface EnableDraftOptions {
|
|
30
|
-
/** Cookie lifetime in **seconds** (default `3600` = 1h). Keep it short
|
|
30
|
+
/** Cookie lifetime in **seconds** (default `3600` = 1h). Keep it short - draft is an editor session. */
|
|
31
31
|
readonly maxAgeSeconds?: number;
|
|
32
32
|
/** Cookie `Path` (default `"/"`). */
|
|
33
33
|
readonly path?: string;
|
|
34
|
-
/** Override the `Secure` attribute (defaults to `true`
|
|
34
|
+
/** Override the `Secure` attribute (defaults to `true` - secure-by-default). Pass `false` only for
|
|
35
35
|
* local `http://` dev, where a `Secure` cookie isn't stored. */
|
|
36
36
|
readonly secure?: boolean;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Turn draft mode **on** for this client by setting a signed, HttpOnly `__nifra_draft` cookie. Call it
|
|
40
|
-
* from a route you've already authorized. `secret` signs the cookie
|
|
40
|
+
* from a route you've already authorized. `secret` signs the cookie - pass the SAME secret to
|
|
41
41
|
* `createWebApp({ draftSecret })` and `withISR({ draftSecret })` so the framework can verify it.
|
|
42
42
|
*/
|
|
43
43
|
export declare function enableDraft(c: {
|
|
@@ -59,7 +59,7 @@ export declare function isDraftEnabled(request: Request, secret: string): Promis
|
|
|
59
59
|
export interface PreviewEndpointOptions {
|
|
60
60
|
/** Shared secret the preview link must carry. Compared in **constant time**. */
|
|
61
61
|
readonly secret: string;
|
|
62
|
-
/** Secret that **signs** the draft cookie
|
|
62
|
+
/** Secret that **signs** the draft cookie - the same one passed to `createWebApp({ draftSecret })`
|
|
63
63
|
* and `withISR({ draftSecret })`. Keep it distinct from {@link secret}: that one travels in URLs
|
|
64
64
|
* (logs, `Referer`, browser history), this one never leaves the server. */
|
|
65
65
|
readonly draftSecret: string;
|
|
@@ -74,17 +74,17 @@ export interface PreviewEndpointOptions {
|
|
|
74
74
|
readonly cookie?: EnableDraftOptions;
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
|
-
* A **preview / draft-mode entry point**
|
|
77
|
+
* A **preview / draft-mode entry point** - a `fetch` handler that checks a preview token, turns draft
|
|
78
78
|
* mode on, and redirects the editor to the page they wanted. `GET` with `?token=<secret>&to=/some/path`;
|
|
79
79
|
* mount it on a nifra route, e.g. `app.get("/api/preview", (c) => handler(c.req))`.
|
|
80
80
|
*
|
|
81
|
-
* This is the link-borne sibling of `revalidateEndpoint`. It exists because the alternative
|
|
82
|
-
* you to gate the route yourself
|
|
81
|
+
* This is the link-borne sibling of `revalidateEndpoint`. It exists because the alternative - telling
|
|
82
|
+
* you to gate the route yourself - means hand-rolling two checks that are easy to get subtly wrong and
|
|
83
83
|
* that fail silently when you do: the token compare must not exit early on the first wrong character,
|
|
84
84
|
* and the `?to=` destination must not be allowed to point off-site. Both are handled here.
|
|
85
85
|
*
|
|
86
86
|
* A CMS "Preview" button is a plain link, so the token has to ride the query string. That has a cost
|
|
87
|
-
* no endpoint can remove
|
|
87
|
+
* no endpoint can remove - the secret lands in server logs, the `Referer` header, and browser history.
|
|
88
88
|
* Use a preview token minted for that purpose, rotate it, and never reuse a token that grants anything
|
|
89
89
|
* beyond draft mode.
|
|
90
90
|
*
|
package/dist/draft.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Draft / preview mode
|
|
2
|
+
* Draft / preview mode - let an editor see unpublished content by flipping a signed cookie that
|
|
3
3
|
* loaders read (`ctx.draft`) and ISR bypasses (fresh render, never cached). The cookie is **HMAC-signed**
|
|
4
|
-
* (so a visitor can't forge it) and **HttpOnly** (JS can't read it). You gate `enableDraft` yourself
|
|
5
|
-
* behind an editor login or a `?token=` check
|
|
4
|
+
* (so a visitor can't forge it) and **HttpOnly** (JS can't read it). You gate `enableDraft` yourself -
|
|
5
|
+
* behind an editor login or a `?token=` check - exactly like Next's `draftMode().enable()`.
|
|
6
6
|
*
|
|
7
7
|
* // a route you've protected (e.g. checked ?token= against a secret):
|
|
8
8
|
* app.get("/api/draft", async (c) => {
|
|
@@ -18,12 +18,12 @@ import { parseCookies, serializeCookie, signValue, unsignValue, } from "@nifrajs
|
|
|
18
18
|
import { timingSafeEqual } from "./internal/timing-safe-equal.js";
|
|
19
19
|
/** The cookie name nifra uses for draft/preview mode. */
|
|
20
20
|
export const DRAFT_COOKIE = "__nifra_draft";
|
|
21
|
-
// The signed cookie's payload is a fixed marker
|
|
21
|
+
// The signed cookie's payload is a fixed marker - a *valid signature* (not the value) is the signal
|
|
22
22
|
// that the server issued this via enableDraft(). Nothing secret is stored in it.
|
|
23
23
|
const DRAFT_MARKER = "1";
|
|
24
24
|
/**
|
|
25
25
|
* Turn draft mode **on** for this client by setting a signed, HttpOnly `__nifra_draft` cookie. Call it
|
|
26
|
-
* from a route you've already authorized. `secret` signs the cookie
|
|
26
|
+
* from a route you've already authorized. `secret` signs the cookie - pass the SAME secret to
|
|
27
27
|
* `createWebApp({ draftSecret })` and `withISR({ draftSecret })` so the framework can verify it.
|
|
28
28
|
*/
|
|
29
29
|
export async function enableDraft(c, secret, options = {}) {
|
|
@@ -37,7 +37,7 @@ export async function enableDraft(c, secret, options = {}) {
|
|
|
37
37
|
*
|
|
38
38
|
* `secure` is resolved here rather than left to the caller: `serializeCookie` is pure and applies
|
|
39
39
|
* **no** security defaults, so the `previewEndpoint` path would silently emit a cookie without
|
|
40
|
-
* `Secure`
|
|
40
|
+
* `Secure` - over plain HTTP that hands the draft cookie to any network observer. Passing it
|
|
41
41
|
* explicitly makes both paths identical instead of one inheriting a default the other never sees.
|
|
42
42
|
*/
|
|
43
43
|
function draftCookieOptions(options) {
|
|
@@ -70,7 +70,7 @@ export async function isDraftEnabled(request, secret) {
|
|
|
70
70
|
*
|
|
71
71
|
* A redirect target that arrives in the query string is attacker-controlled: anyone can mint a link
|
|
72
72
|
* to your own preview route and choose where the editor lands. "Starts with `/`" is the check people
|
|
73
|
-
* write and it is not enough
|
|
73
|
+
* write and it is not enough - `//evil.com` is a protocol-relative URL and `/\evil.com` is normalized
|
|
74
74
|
* to one by browsers, so both start with a slash and navigate off-site. Control characters are refused
|
|
75
75
|
* as well, since a newline in a `Location` header splits the response.
|
|
76
76
|
*/
|
|
@@ -87,17 +87,17 @@ function safeRedirectPath(value) {
|
|
|
87
87
|
return value;
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
|
-
* A **preview / draft-mode entry point**
|
|
90
|
+
* A **preview / draft-mode entry point** - a `fetch` handler that checks a preview token, turns draft
|
|
91
91
|
* mode on, and redirects the editor to the page they wanted. `GET` with `?token=<secret>&to=/some/path`;
|
|
92
92
|
* mount it on a nifra route, e.g. `app.get("/api/preview", (c) => handler(c.req))`.
|
|
93
93
|
*
|
|
94
|
-
* This is the link-borne sibling of `revalidateEndpoint`. It exists because the alternative
|
|
95
|
-
* you to gate the route yourself
|
|
94
|
+
* This is the link-borne sibling of `revalidateEndpoint`. It exists because the alternative - telling
|
|
95
|
+
* you to gate the route yourself - means hand-rolling two checks that are easy to get subtly wrong and
|
|
96
96
|
* that fail silently when you do: the token compare must not exit early on the first wrong character,
|
|
97
97
|
* and the `?to=` destination must not be allowed to point off-site. Both are handled here.
|
|
98
98
|
*
|
|
99
99
|
* A CMS "Preview" button is a plain link, so the token has to ride the query string. That has a cost
|
|
100
|
-
* no endpoint can remove
|
|
100
|
+
* no endpoint can remove - the secret lands in server logs, the `Referer` header, and browser history.
|
|
101
101
|
* Use a preview token minted for that purpose, rotate it, and never reuse a token that grants anything
|
|
102
102
|
* beyond draft mode.
|
|
103
103
|
*
|