@timber-js/app 0.2.0-alpha.211 → 0.2.0-alpha.213
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/agent-skill.md +10 -5
- package/dist/_chunks/{actions-Rjk4htmA.js → actions-CEootpB1.js} +49 -12
- package/dist/_chunks/actions-CEootpB1.js.map +1 -0
- package/dist/_chunks/{als-registry-DaxkVjt5.js → als-registry-BZqHCtq-.js} +2 -4
- package/dist/_chunks/als-registry-BZqHCtq-.js.map +1 -0
- package/dist/_chunks/{cache-api-DGdYfNJn.js → cache-api-LA3sBpUS.js} +5 -5
- package/dist/_chunks/{cache-api-DGdYfNJn.js.map → cache-api-LA3sBpUS.js.map} +1 -1
- package/dist/_chunks/{chains-DGX9zmg9.js → chains-BfoPFraI.js} +2 -2
- package/dist/_chunks/{chains-DGX9zmg9.js.map → chains-BfoPFraI.js.map} +1 -1
- package/dist/_chunks/{classify-QwG5rxKI.js → classify-BT66U83D.js} +2 -2
- package/dist/_chunks/{classify-QwG5rxKI.js.map → classify-BT66U83D.js.map} +1 -1
- package/dist/_chunks/{cli-check-ajNY3B2e.js → cli-check-BfQ54-UJ.js} +3 -3
- package/dist/_chunks/{cli-check-ajNY3B2e.js.map → cli-check-BfQ54-UJ.js.map} +1 -1
- package/dist/_chunks/{cli-schema-sync-D2eI8jEg.js → cli-schema-sync-czh2dsLs.js} +2 -2
- package/dist/_chunks/{cli-schema-sync-D2eI8jEg.js.map → cli-schema-sync-czh2dsLs.js.map} +1 -1
- package/dist/_chunks/{client-dep-entries-2HCF09no.js → client-dep-entries-CQwpb8dI.js} +2 -2
- package/dist/_chunks/{client-dep-entries-2HCF09no.js.map → client-dep-entries-CQwpb8dI.js.map} +1 -1
- package/dist/_chunks/{convention-lint-DLmhGsRS.js → convention-lint-BEVW4EID.js} +3 -3
- package/dist/_chunks/{convention-lint-DLmhGsRS.js.map → convention-lint-BEVW4EID.js.map} +1 -1
- package/dist/_chunks/{dev-server-TFpEwm3H.js → dev-server-FKxptbnI.js} +2 -2
- package/dist/_chunks/{dev-server-TFpEwm3H.js.map → dev-server-FKxptbnI.js.map} +1 -1
- package/dist/_chunks/{error-boundary-DsNScGRM.js → error-boundary-9g_Lb2na.js} +3 -3
- package/dist/_chunks/{error-boundary-DsNScGRM.js.map → error-boundary-9g_Lb2na.js.map} +1 -1
- package/dist/_chunks/{json-lossy-check-CVuRs2hG.js → json-lossy-check-C8zBY2uZ.js} +2 -2
- package/dist/_chunks/{json-lossy-check-CVuRs2hG.js.map → json-lossy-check-C8zBY2uZ.js.map} +1 -1
- package/dist/_chunks/{live-graph-cNuWMYQI.js → live-graph-C_4v-fHv.js} +4 -4
- package/dist/_chunks/{live-graph-cNuWMYQI.js.map → live-graph-C_4v-fHv.js.map} +1 -1
- package/dist/_chunks/{logger-BP0LN6vP.js → logger-CbLdcy-W.js} +2 -2
- package/dist/_chunks/{logger-BP0LN6vP.js.map → logger-CbLdcy-W.js.map} +1 -1
- package/dist/_chunks/{poison-scan-CfQ3unZR.js → poison-scan-C92liMAr.js} +2 -2
- package/dist/_chunks/{poison-scan-CfQ3unZR.js.map → poison-scan-C92liMAr.js.map} +1 -1
- package/dist/_chunks/{scanner-DmqdxzbW.js → scanner-CQt12vE2.js} +2 -2
- package/dist/_chunks/{scanner-DmqdxzbW.js.map → scanner-CQt12vE2.js.map} +1 -1
- package/dist/_chunks/{sizeof-BM1409x2.js → sizeof-QPE5nd3u.js} +2 -2
- package/dist/_chunks/{sizeof-BM1409x2.js.map → sizeof-QPE5nd3u.js.map} +1 -1
- package/dist/_chunks/{walkers-Czu2jXFq.js → walkers-DAT4avhZ.js} +3 -3
- package/dist/_chunks/{walkers-Czu2jXFq.js.map → walkers-DAT4avhZ.js.map} +1 -1
- package/dist/adapters/cloudflare-kv-cache.js +1 -1
- package/dist/analyze/crawl-entry.js +3 -3
- package/dist/analyze/graph-command.js +2 -2
- package/dist/cache/index.js +2 -2
- package/dist/cache/stores/memory.js +1 -1
- package/dist/cdn/workers-cache-purge.js +1 -1
- package/dist/cli.js +3 -3
- package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -1
- package/dist/client/browser-entry/action-queue.d.ts +1 -0
- package/dist/client/browser-entry/action-queue.d.ts.map +1 -1
- package/dist/client/browser-entry/form-state.d.ts +22 -0
- package/dist/client/browser-entry/form-state.d.ts.map +1 -0
- package/dist/client/browser-entry/hydrate.d.ts +9 -1
- package/dist/client/browser-entry/hydrate.d.ts.map +1 -1
- package/dist/client/browser-entry/index.d.ts +2 -0
- package/dist/client/browser-entry/index.d.ts.map +1 -1
- package/dist/client/browser-entry/router-init.d.ts.map +1 -1
- package/dist/client/error-boundary.js +1 -1
- package/dist/client/form.d.ts +17 -64
- package/dist/client/form.d.ts.map +1 -1
- package/dist/client/index.d.ts +3 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +111 -51
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.js +33 -32
- package/dist/client/internal.js.map +1 -1
- package/dist/client/navigation-api.d.ts +25 -63
- package/dist/client/navigation-api.d.ts.map +1 -1
- package/dist/client/navigation-transition.d.ts +11 -2
- package/dist/client/navigation-transition.d.ts.map +1 -1
- package/dist/client/router-effects.d.ts +7 -3
- package/dist/client/router-effects.d.ts.map +1 -1
- package/dist/client/router-lifecycle.d.ts +17 -11
- package/dist/client/router-lifecycle.d.ts.map +1 -1
- package/dist/client/router-pipeline.d.ts +3 -2
- package/dist/client/router-pipeline.d.ts.map +1 -1
- package/dist/client/router-types.d.ts +24 -44
- package/dist/client/router-types.d.ts.map +1 -1
- package/dist/client/router.d.ts.map +1 -1
- package/dist/client/use-form-field.d.ts +39 -0
- package/dist/client/use-form-field.d.ts.map +1 -0
- package/dist/config-types.d.ts +2 -1
- package/dist/config-types.d.ts.map +1 -1
- package/dist/index.js +6 -7
- package/dist/index.js.map +1 -1
- package/dist/plugins/shims.d.ts.map +1 -1
- package/dist/routing/index.js +2 -2
- package/dist/rsc-runtime/rsc.d.ts +1 -1
- package/dist/rsc-runtime/rsc.d.ts.map +1 -1
- package/dist/server/action-client.d.ts +20 -7
- package/dist/server/action-client.d.ts.map +1 -1
- package/dist/server/action-handler.d.ts +27 -8
- package/dist/server/action-handler.d.ts.map +1 -1
- package/dist/server/als-registry.d.ts +22 -2
- package/dist/server/als-registry.d.ts.map +1 -1
- package/dist/server/client-error-message.d.ts +12 -0
- package/dist/server/client-error-message.d.ts.map +1 -0
- package/dist/server/flight-scripts.d.ts +9 -0
- package/dist/server/flight-scripts.d.ts.map +1 -1
- package/dist/server/form-data.d.ts +13 -4
- package/dist/server/form-data.d.ts.map +1 -1
- package/dist/server/form-state-flight.d.ts +32 -0
- package/dist/server/form-state-flight.d.ts.map +1 -0
- package/dist/server/index.d.ts +0 -2
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +41 -60
- package/dist/server/index.js.map +1 -1
- package/dist/server/internal.js +10 -6
- package/dist/server/internal.js.map +1 -1
- package/dist/server/logger.d.ts +1 -0
- package/dist/server/logger.d.ts.map +1 -1
- package/dist/server/pipeline.d.ts +20 -6
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/request-context.d.ts +27 -2
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/route-element-builder.d.ts.map +1 -1
- package/dist/server/rsc-entry/action-dispatcher.d.ts +6 -5
- package/dist/server/rsc-entry/action-dispatcher.d.ts.map +1 -1
- package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/index.d.ts.map +1 -1
- package/dist/server/rsc-entry/render-route.d.ts +2 -0
- package/dist/server/rsc-entry/render-route.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-renderer.d.ts +6 -0
- package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
- package/dist/server/ssr-bridge-types.d.ts +10 -0
- package/dist/server/ssr-bridge-types.d.ts.map +1 -1
- package/dist/server/ssr-entry.d.ts.map +1 -1
- package/dist/server/ssr-form-state.d.ts +30 -0
- package/dist/server/ssr-form-state.d.ts.map +1 -0
- package/dist/server/ssr-render.d.ts +3 -0
- package/dist/server/ssr-render.d.ts.map +1 -1
- package/dist/shared/form-state-flight.d.ts +36 -0
- package/dist/shared/form-state-flight.d.ts.map +1 -0
- package/docs/api/31-api-client.mdx +31 -3
- package/docs/api/34-api-config.mdx +1 -1
- package/docs/learn/08-forms-and-actions.mdx +116 -36
- package/package.json +1 -1
- package/src/client/browser-entry/action-dispatch.ts +104 -24
- package/src/client/browser-entry/action-queue.ts +1 -1
- package/src/client/browser-entry/form-state.ts +48 -0
- package/src/client/browser-entry/hydrate.ts +10 -1
- package/src/client/browser-entry/index.ts +25 -7
- package/src/client/browser-entry/router-init.ts +7 -20
- package/src/client/form.tsx +33 -98
- package/src/client/index.ts +3 -2
- package/src/client/navigation-api.ts +47 -173
- package/src/client/navigation-transition.ts +15 -4
- package/src/client/router-effects.ts +8 -4
- package/src/client/router-lifecycle.ts +40 -20
- package/src/client/router-pipeline.ts +10 -12
- package/src/client/router-types.ts +24 -48
- package/src/client/router.ts +49 -56
- package/src/client/use-form-field.ts +132 -0
- package/src/config-types.ts +2 -1
- package/src/plugins/shims.ts +0 -2
- package/src/rsc-runtime/rsc.ts +3 -0
- package/src/rsc-runtime/vendor-types.d.ts +14 -0
- package/src/server/action-client.ts +77 -64
- package/src/server/action-handler.ts +133 -95
- package/src/server/als-registry.ts +23 -9
- package/src/server/client-error-message.ts +18 -0
- package/src/server/flight-scripts.ts +13 -0
- package/src/server/form-data.ts +62 -10
- package/src/server/form-state-flight.ts +67 -0
- package/src/server/index.ts +0 -4
- package/src/server/logger.ts +6 -1
- package/src/server/pipeline.ts +27 -8
- package/src/server/request-context.ts +39 -2
- package/src/server/route-element-builder.ts +12 -1
- package/src/server/rsc-entry/action-dispatcher.ts +40 -34
- package/src/server/rsc-entry/error-renderer.ts +2 -1
- package/src/server/rsc-entry/index.ts +1 -0
- package/src/server/rsc-entry/render-route.ts +16 -0
- package/src/server/rsc-entry/rsc-stream.ts +20 -11
- package/src/server/rsc-entry/ssr-renderer.ts +11 -0
- package/src/server/ssr-bridge-types.ts +10 -0
- package/src/server/ssr-entry.ts +16 -2
- package/src/server/ssr-form-state.ts +58 -0
- package/src/server/ssr-render.ts +5 -0
- package/src/shared/form-state-flight.ts +74 -0
- package/dist/_chunks/actions-Rjk4htmA.js.map +0 -1
- package/dist/_chunks/als-registry-DaxkVjt5.js.map +0 -1
- package/dist/server/form-flash.d.ts +0 -78
- package/dist/server/form-flash.d.ts.map +0 -1
- package/src/server/form-flash.ts +0 -89
package/dist/server/logger.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/server/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAIlD,6FAA6F;AAC7F,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxD,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxD,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACzD,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC1D;AAQD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAEpD;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,Y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D,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAEhE;AAED,sEAAsE;AACtE,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAED,sDAAsD;AACtD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAEnE;AAED,6DAA6D;AAC7D,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAEpF;AAED,qFAAqF;AACrF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQlF;AAED,oCAAoC;AACpC,wBAAgB,YAAY,CAAC,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAE7D;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CAAE,GAAG,IAAI,CAO/F"}
|
|
@@ -20,6 +20,8 @@ import type { MiddlewareFn } from './middleware-runner.ts';
|
|
|
20
20
|
import { DenySignal } from './primitives.ts';
|
|
21
21
|
import type { ManifestSegmentNode } from './route-matcher.ts';
|
|
22
22
|
import type { CsrfConfig } from './csrf.ts';
|
|
23
|
+
import type { ReactFormState } from 'react-dom/client';
|
|
24
|
+
import type { ActionErrorForRender } from './als-registry.ts';
|
|
23
25
|
/**
|
|
24
26
|
* Result of matching a canonical pathname against the route tree.
|
|
25
27
|
*
|
|
@@ -201,17 +203,29 @@ export interface PipelineConfig {
|
|
|
201
203
|
* from `req.url` (which re-encodes).
|
|
202
204
|
*
|
|
203
205
|
* The `reenter` parameter is the full pipeline function (including proxy,
|
|
204
|
-
* ALS, tracing) for the no-JS
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
* the pipeline needing the same `Request` object to reach
|
|
206
|
+
* ALS, tracing) for the no-JS action rerender path — the synthetic GET
|
|
207
|
+
* flows through the complete pipeline. Its `cookies` become that request's
|
|
208
|
+
* parsed cookies and its `formState` the action's form state for SSR
|
|
209
|
+
* (`runWithRequestContext`'s options), so the rerender reads both without
|
|
210
|
+
* the pipeline needing the same `Request` object to reach them.
|
|
209
211
|
*
|
|
210
212
|
* Moved into the pipeline (TIM-1213) so proxy.ts runs on action POSTs,
|
|
211
213
|
* matching the design doc contract: "proxy.ts runs on every request,
|
|
212
214
|
* no exclusions."
|
|
213
215
|
*/
|
|
214
|
-
dispatchAction?: (req: Request, canonicalPath: string, reenter: (req: Request,
|
|
216
|
+
dispatchAction?: (req: Request, canonicalPath: string, reenter: (req: Request, reentry: PipelineReentry) => Promise<Response>) => Promise<Response | null>;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* What the no-JS action rerender hands the pipeline when it re-enters it:
|
|
220
|
+
* the action's post-mutation cookies and, when its form used
|
|
221
|
+
* `useActionState`, the form state React decoded from the submission — or,
|
|
222
|
+
* when the action threw, the error to render in place of the page.
|
|
223
|
+
*/
|
|
224
|
+
export interface PipelineReentry {
|
|
225
|
+
cookies: Map<string, string>;
|
|
226
|
+
formState?: ReactFormState;
|
|
227
|
+
/** The error a no-JS action threw, rendered where the page would be. */
|
|
228
|
+
actionError?: ActionErrorForRender;
|
|
215
229
|
}
|
|
216
230
|
/**
|
|
217
231
|
* Create the request handler from a pipeline configuration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/server/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,a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E,MAAM,EACrB,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC,QAAQ,CAAC,KACnE,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;CAC/B;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,wEAAwE;IACxE,WAAW,CAAC,EAAE,oBAAoB,CAAC;CACpC;AAID;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CA2Q1F"}
|
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
* and design/11-platform.md §"AsyncLocalStorage".
|
|
15
15
|
*/
|
|
16
16
|
import type { CoercedParams } from '../shared/param-value.ts';
|
|
17
|
-
import { requestContextAls } from './als-registry.ts';
|
|
17
|
+
import { requestContextAls, type ActionErrorForRender } from './als-registry.ts';
|
|
18
18
|
import { type SlotParamsRecord } from '../shared/slot-params.ts';
|
|
19
19
|
import { type ReactCacheScope } from './react-cache-scope.ts';
|
|
20
|
+
import type { ReactFormState } from 'react-dom/client';
|
|
20
21
|
export { requestContextAls };
|
|
21
22
|
/**
|
|
22
23
|
* Returns a read-only view of the current request's headers.
|
|
@@ -154,6 +155,16 @@ export interface RequestContextOptions {
|
|
|
154
155
|
* (TIM-868).
|
|
155
156
|
*/
|
|
156
157
|
cookies?: Map<string, string>;
|
|
158
|
+
/**
|
|
159
|
+
* The form state of the no-JS action this render answers. Only the
|
|
160
|
+
* action dispatcher's re-entry passes it; see `RequestContextStore.formState`.
|
|
161
|
+
*/
|
|
162
|
+
formState?: ReactFormState;
|
|
163
|
+
/**
|
|
164
|
+
* The error of the no-JS action this render answers. Only the action
|
|
165
|
+
* dispatcher's re-entry passes it; see `RequestContextStore.actionError`.
|
|
166
|
+
*/
|
|
167
|
+
actionError?: ActionErrorForRender;
|
|
157
168
|
}
|
|
158
169
|
/**
|
|
159
170
|
* Run a callback within a request context. Used by the pipeline to establish
|
|
@@ -171,7 +182,7 @@ export interface RequestContextOptions {
|
|
|
171
182
|
* @param req - The incoming Request object.
|
|
172
183
|
* @param fn - The function to run within the request context.
|
|
173
184
|
*/
|
|
174
|
-
export declare function runWithRequestContext<T>(req: Request, fn: () => T, { reactCacheScope, cookies }?: RequestContextOptions): T;
|
|
185
|
+
export declare function runWithRequestContext<T>(req: Request, fn: () => T, { reactCacheScope, cookies, formState, actionError }?: RequestContextOptions): T;
|
|
175
186
|
/**
|
|
176
187
|
* Enable cookie mutation for the current context. Called by the framework
|
|
177
188
|
* when entering middleware.ts, server actions, or route.ts handlers.
|
|
@@ -199,4 +210,18 @@ export declare function markResponseFlushed(): void;
|
|
|
199
210
|
* See design/07-routing.md §"Request Header Injection"
|
|
200
211
|
*/
|
|
201
212
|
export declare function applyRequestHeaderOverlay(overlay: Headers): void;
|
|
213
|
+
/**
|
|
214
|
+
* The form state of the no-JS action this render answers, or `null`. Read by
|
|
215
|
+
* the SSR renderer only (`rsc-entry/ssr-renderer.ts`), which passes it to
|
|
216
|
+
* Fizz and embeds it for `hydrateRoot`. Framework-internal: not exported
|
|
217
|
+
* from `@timber-js/app/server`.
|
|
218
|
+
*/
|
|
219
|
+
export declare function getFormStateForSsr(): ReactFormState | null;
|
|
220
|
+
/**
|
|
221
|
+
* The error of the no-JS action this render answers, or `null`. Read by the
|
|
222
|
+
* route element builder, which renders it in place of the page, and by the
|
|
223
|
+
* Flight `onError`, which gives it the ID the action logged it with.
|
|
224
|
+
* Framework-internal: not exported from `@timber-js/app/server`.
|
|
225
|
+
*/
|
|
226
|
+
export declare function getActionErrorForRender(): ActionErrorForRender | null;
|
|
202
227
|
//# sourceMappingURL=request-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/server/request-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,
|
|
1
|
+
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/server/request-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,iBAAiB,EACjB,KAAK,oBAAoB,EAE1B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAA0B,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAI7B;;;;;GAKG;AACH,wBAAgB,UAAU,IAAI,eAAe,CAU5C;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG1D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,eAAe,CAUjD;AAaD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,aAAa,CA2CpE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAM5D;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAK9E;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EACxC,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,UAAU,EAAE,aAA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D;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,GAAG,IAAI,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI,oBAAoB,GAAG,IAAI,CAErE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-element-builder.d.ts","sourceRoot":"","sources":["../../src/server/route-element-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAQ9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAMhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"route-element-builder.d.ts","sourceRoot":"","sources":["../../src/server/route-element-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAQ9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAMhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAS5D;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,UAAU,GAChB,MAAM,EAAE,CAGV;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAID,+CAA+C;AAC/C,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;IAC3C,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED,+CAA+C;AAC/C,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,OAAO,EAAE,cAAc,CAAC;IACxB,wDAAwD;IACxD,gBAAgB,EAAE,oBAAoB,EAAE,CAAC;IACzC,qCAAqC;IACrC,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,4DAA4D;IAC5D,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;OAIG;IACH,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;CACjC;AA2DD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,YAAY,CAAC,EAAE,mBAAmB,EAClC,eAAe,CAAC,EAAE,eAAe,GAAG,IAAI,EACxC,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3C,OAAO,CAAC,kBAAkB,CAAC,CAua7B"}
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* `createPipeline` calls it after proxy.ts runs (TIM-1213), so proxy.ts
|
|
9
9
|
* sees action POSTs — "proxy.ts runs on every request, no exclusions." It
|
|
10
10
|
* encapsulates action detection, the route-type check, action handler
|
|
11
|
-
* dispatch, and the no-JS
|
|
11
|
+
* dispatch, and the answer to a no-JS action that did not redirect: the
|
|
12
|
+
* page rerendered with React's form state, or the error page.
|
|
12
13
|
*
|
|
13
14
|
* The CSRF gate is not here: it runs in `createPipeline` before proxy.ts
|
|
14
15
|
* (`csrfGate` in pipeline-helpers.ts). The action handler repeats the
|
|
@@ -20,7 +21,7 @@
|
|
|
20
21
|
*/
|
|
21
22
|
import type { BodyLimitsConfig } from '../body-limits.ts';
|
|
22
23
|
import type { CsrfConfig } from '../csrf.ts';
|
|
23
|
-
import type { RouteMatcher } from '../pipeline.ts';
|
|
24
|
+
import type { PipelineReentry, RouteMatcher } from '../pipeline.ts';
|
|
24
25
|
import type { SensitiveFieldsOption } from '../sensitive-fields.ts';
|
|
25
26
|
import type { RevalidateRenderer } from '../actions.ts';
|
|
26
27
|
/**
|
|
@@ -57,11 +58,11 @@ export interface ActionDispatcherDeps {
|
|
|
57
58
|
*
|
|
58
59
|
* Called after proxy.ts runs (inside the pipeline) for every request.
|
|
59
60
|
* Checks if the request is a server action POST, handles the route-type
|
|
60
|
-
* check (TIM-870), dispatches to the action handler, and
|
|
61
|
-
*
|
|
61
|
+
* check (TIM-870), dispatches to the action handler, and answers a no-JS
|
|
62
|
+
* action that did not redirect.
|
|
62
63
|
*
|
|
63
64
|
* Returns `Response` if the request was handled as an action, `null` to
|
|
64
65
|
* fall through to normal routing.
|
|
65
66
|
*/
|
|
66
|
-
export declare function buildActionDispatcher(deps: ActionDispatcherDeps): (req: Request, canonicalPath: string, reenter: (req: Request,
|
|
67
|
+
export declare function buildActionDispatcher(deps: ActionDispatcherDeps): (req: Request, canonicalPath: string, reenter: (req: Request, reentry: PipelineReentry) => Promise<Response>) => Promise<Response | null>;
|
|
67
68
|
//# sourceMappingURL=action-dispatcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-dispatcher.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/action-dispatcher.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"action-dispatcher.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/action-dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAIxD;;;;;;;;GAQG;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,kBAAkB,CAAC;AAE7E,yEAAyE;AACzE,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,UAAU,EAAE,UAAU,CAAC;IACvB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACxC,oEAAoE;IACpE,eAAe,CAAC,EAAE,qBAAqB,CAAC;IACxC,8DAA8D;IAC9D,uBAAuB,EAAE,yBAAyB,CAAC;IACnD;;;;;;OAMG;IACH,UAAU,EAAE,YAAY,CAAC;CAC1B;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,oBAAoB,GACzB,CACD,GAAG,EAAE,OAAO,EACZ,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC,QAAQ,CAAC,KACnE,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAiE5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-renderer.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/error-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"error-renderer.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/error-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAevD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB;AA+GD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,gBAAgB,EAAE,WAAW,EAAE,EAC/B,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,eAAe,EAAE,OAAO,EACxB,eAAe,EAAE,qBAAqB,EACtC,WAAW,CAAC,EAAE,eAAe,EAC7B,gBAAgB,SAAW,GAC1B,OAAO,CAAC,QAAQ,CAAC,CA6DnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/index.ts"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AA8ClE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAEjD;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/index.ts"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AA8ClE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAEjD;AAiVD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAInE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAItE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,wBAAwB,EAAE,cAAc,GACvD,OAAO,CAAC,OAAO,wBAAwB,EAAE,cAAc,CAAC,CAE1D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,OAAO,wBAAwB,EAAE,uBAAuB,GAChE,OAAO,CAAC,OAAO,wBAAwB,EAAE,uBAAuB,CAAC,CAQnE;8BAwCoB,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC"}
|
|
@@ -31,6 +31,8 @@ export interface RenderRouteDeps {
|
|
|
31
31
|
clientSegmentCache: boolean;
|
|
32
32
|
renderDenyFallback: DenyFallbackRenderer;
|
|
33
33
|
buildManifest: BuildManifest;
|
|
34
|
+
/** The resolved `renderTimeoutMs`: bounds encoding a no-JS form state. */
|
|
35
|
+
renderTimeoutMs: number;
|
|
34
36
|
globalError?: {
|
|
35
37
|
load: () => Promise<unknown>;
|
|
36
38
|
filePath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-route.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/render-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAS1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"render-route.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/render-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAS1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAQ/D;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,qBAAqB,CAAC;IACvC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,oBAAoB,CAAC;IACzC,aAAa,EAAE,aAAa,CAAC;IAC7B,0EAA0E;IAC1E,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAClE;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,eAAe,EAAE,OAAO,EACxB,IAAI,EAAE,eAAe,EACrB,YAAY,CAAC,EAAE,mBAAmB,GACjC,OAAO,CAAC,QAAQ,CAAC,CAwKnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc-stream.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/rsc-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAKnE,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"rsc-stream.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/rsc-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAKnE,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAQ3E,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAG/E,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACtC,OAAO,EAAE,aAAa,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,cAAc,EACvB,GAAG,EAAE,OAAO,EACZ,aAAa,CAAC,EAAE,aAAa,EAAE,GAC9B,eAAe,CAiHjB"}
|
|
@@ -60,6 +60,12 @@ interface SsrRenderOptions {
|
|
|
60
60
|
/** Tier 2 global-error.tsx file, if present in app/. */
|
|
61
61
|
globalError?: GlobalErrorFile;
|
|
62
62
|
slotSkipInfo?: SlotSkipEntry[];
|
|
63
|
+
/**
|
|
64
|
+
* The Flight bytes of the no-JS action's form state this page answers
|
|
65
|
+
* (`encodeFormState`); absent on every other render. Fizz and hydrateRoot
|
|
66
|
+
* both decode them.
|
|
67
|
+
*/
|
|
68
|
+
formState?: Uint8Array | null;
|
|
63
69
|
}
|
|
64
70
|
/**
|
|
65
71
|
* Render the RSC stream to HTML via SSR.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-renderer.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/ssr-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAMlE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOzD,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA8BzD;;;;;;;;GAQG;AACH,eAAO,MAAM,gCAAgC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAiB,CAAC;AAEhF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iCAAiC,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAqB,CAAC;AAEtF,UAAU,gBAAgB;IACxB,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACtC,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,gBAAgB,EAAE,oBAAoB,EAAE,CAAC;IACzC,KAAK,EAAE,UAAU,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,qBAAqB,CAAC;IACvC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;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,wDAAwD;IACxD,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE,aAAa,EAAE,CAAC;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAgRjF"}
|
|
@@ -102,6 +102,16 @@ export interface NavContext {
|
|
|
102
102
|
/** Request cookies as name→value pairs. Used by useCookie() during SSR
|
|
103
103
|
* to return correct cookie values before hydration. */
|
|
104
104
|
cookies?: Map<string, string>;
|
|
105
|
+
/**
|
|
106
|
+
* The form state of the no-JS action this page answers (React's
|
|
107
|
+
* `decodeFormState`), as Flight bytes. SSR decodes them for Fizz and,
|
|
108
|
+
* once they decoded, embeds the same bytes for hydration
|
|
109
|
+
* (server/ssr-form-state.ts), so the `useActionState` hook that submitted
|
|
110
|
+
* renders with the value the browser hydrates with. Absent
|
|
111
|
+
* on every other render. See design/08-forms-and-actions.md §"No-JS Result
|
|
112
|
+
* Round-Trip".
|
|
113
|
+
*/
|
|
114
|
+
formState?: Uint8Array;
|
|
105
115
|
/**
|
|
106
116
|
* Lazy thunk that produces the `<script>self.__timber_segments=…</script>`
|
|
107
117
|
* tag. Invoked by the SSR entry AFTER `renderSsrNodeStream` /
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-bridge-types.d.ts","sourceRoot":"","sources":["../../src/server/ssr-bridge-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;OAUG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,UAAU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,CAAC;IACnB,OAAO,EAAE,UAAU,CAAC;IACpB;;;;;;;;;;;;;;;;OAgBG;IACH,oBAAoB,EAAE,OAAO,CAAC;CAC/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-entry.d.ts","sourceRoot":"","sources":["../../src/server/ssr-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"ssr-entry.d.ts","sourceRoot":"","sources":["../../src/server/ssr-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAiCH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAiDzE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,EACrC,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,eAAe,CAAC,CAuM1B;eAEc,SAAS"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The no-JS action form state on the SSR side (TIM-1572, design/08
|
|
3
|
+
* §"No-JS Result Round-Trip").
|
|
4
|
+
*
|
|
5
|
+
* SSR is the one owner of both consumers of the Flight bytes the RSC
|
|
6
|
+
* environment encoded (`NavContext.formState`): it decodes them for Fizz,
|
|
7
|
+
* and emits the script that embeds the same bytes for `hydrateRoot` only
|
|
8
|
+
* when that decode succeeded. A browser must never hydrate with a state Fizz
|
|
9
|
+
* did not render, or the hook that submitted changes state during
|
|
10
|
+
* hydration. If SSR cannot decode them, neither side gets them.
|
|
11
|
+
*/
|
|
12
|
+
import type { ReactFormState } from 'react-dom/client';
|
|
13
|
+
import { type FormStateFlightDecoder } from '../shared/form-state-flight.ts';
|
|
14
|
+
export interface SsrFormState {
|
|
15
|
+
/** For Fizz's `formState` option. */
|
|
16
|
+
formState: ReactFormState | undefined;
|
|
17
|
+
/** The `<script>` that embeds the same bytes for hydration, or `''`. */
|
|
18
|
+
script: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function formStateForSsr(bytes: Uint8Array | undefined, options: {
|
|
21
|
+
/**
|
|
22
|
+
* Whether the page hydrates: its RSC payload is inlined. Without it the
|
|
23
|
+
* browser never calls `hydrateRoot`, so nothing is embedded.
|
|
24
|
+
*/
|
|
25
|
+
hydrates: boolean;
|
|
26
|
+
nonce: string | undefined;
|
|
27
|
+
decode: FormStateFlightDecoder;
|
|
28
|
+
timeoutMs: number;
|
|
29
|
+
}): Promise<SsrFormState>;
|
|
30
|
+
//# sourceMappingURL=ssr-form-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssr-form-state.d.ts","sourceRoot":"","sources":["../../src/server/ssr-form-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAmB,KAAK,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAI9F,MAAM,WAAW,YAAY;IAC3B,qCAAqC;IACrC,SAAS,EAAE,cAAc,GAAG,SAAS,CAAC;IACtC,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;CAChB;AAID,wBAAsB,eAAe,CACnC,KAAK,EAAE,UAAU,GAAG,SAAS,EAC7B,OAAO,EAAE;IACP;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,sBAAsB,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB,GACA,OAAO,CAAC,YAAY,CAAC,CAmBvB"}
|
|
@@ -20,11 +20,14 @@
|
|
|
20
20
|
* 18-build-system.md §"Entry Files"
|
|
21
21
|
*/
|
|
22
22
|
import type { ReactNode } from 'react';
|
|
23
|
+
import type { ReactFormState } from 'react-dom/client';
|
|
23
24
|
/** Options shared by both SSR render paths (Node streams and Web Streams). */
|
|
24
25
|
export interface SsrStreamOptions {
|
|
25
26
|
bootstrapScriptContent?: string;
|
|
26
27
|
/** Request CSP nonce — stamped by Fizz on the bootstrap and runtime scripts. */
|
|
27
28
|
nonce?: string;
|
|
29
|
+
/** A no-JS action's form state, for the `useActionState` hook that submitted. */
|
|
30
|
+
formState?: ReactFormState;
|
|
28
31
|
deferSuspenseFor?: number;
|
|
29
32
|
signal?: AbortSignal;
|
|
30
33
|
renderTimeoutMs?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-render.d.ts","sourceRoot":"","sources":["../../src/server/ssr-render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ssr-render.d.ts","sourceRoot":"","sources":["../../src/server/ssr-render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAiGvD,8EAA8E;AAC9E,MAAM,WAAW,gBAAgB;IAC/B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kEAAkE;IAClE,WAAW,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CACtD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,SAAS,EAClB,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAErC;AAED,wEAAwE;AACxE,eAAO,MAAM,cAAc,SAAkB,CAAC;AAU9C;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,SAAS,EAClB,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,OAAO,aAAa,EAAE,QAAQ,CAAC,CAuGzC;AAED,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,OAAO,aAAa,EAAE,QAAQ,GACvC,cAAc,CAAC,UAAU,CAAC,CAE5B;AAsGD;;;;;;;;;;;;GAYG;AACH,2CAA2C;AAC3C,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,EAClC,MAAM,CAAC,EAAE,WAAW,EACpB,KAAK,CAAC,EAAE,MAAM,GACb,cAAc,CAAC,UAAU,CAAC,CA2B5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,cAAc,CAAC,UAAU,CAAC,EACtC,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,OAAO,GACvB,QAAQ,CAOV"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The no-JS action form state on its way to the two renders that need it
|
|
3
|
+
* (TIM-1572, design/08-forms-and-actions.md §"No-JS Result Round-Trip").
|
|
4
|
+
*
|
|
5
|
+
* The RSC environment serializes the form state with Flight
|
|
6
|
+
* (server/form-state-flight.ts). SSR decodes those bytes for Fizz, and the
|
|
7
|
+
* browser decodes the same bytes, embedded in the page, for `hydrateRoot`.
|
|
8
|
+
* Both sides call `decodeFormState` below with their own environment's
|
|
9
|
+
* Flight client, so the two renders get the same value, and the value a
|
|
10
|
+
* `useActionState` result has with JS (Flight, through the action response):
|
|
11
|
+
* a `Date` stays a `Date`, a `Map` a `Map`, and an `undefined` field is
|
|
12
|
+
* absent on both, because the Flight client drops it.
|
|
13
|
+
*
|
|
14
|
+
* The page carries the bytes as base64: Flight may write binary rows (a typed
|
|
15
|
+
* array in a result), which a text chunk would corrupt, and base64 has no
|
|
16
|
+
* character that can end a `<script>` element.
|
|
17
|
+
*/
|
|
18
|
+
import type { ReactFormState } from 'react-dom/client';
|
|
19
|
+
/**
|
|
20
|
+
* A Flight client's `createFromReadableStream`, SSR's or the browser's, typed
|
|
21
|
+
* to the form state tuple it decodes. React builds `ReactFormState`
|
|
22
|
+
* (`decodeFormState` on the server) and only React reads it; the Flight
|
|
23
|
+
* client's type parameter is the only place that type is asserted.
|
|
24
|
+
*/
|
|
25
|
+
export type FormStateFlightDecoder = (stream: ReadableStream<Uint8Array>) => PromiseLike<ReactFormState>;
|
|
26
|
+
/**
|
|
27
|
+
* Decode the form state's Flight bytes. Rejects if they do not decode within
|
|
28
|
+
* `timeoutMs`. Every byte is in hand, so only a Flight client bug could
|
|
29
|
+
* stall it, and the caller falls back to rendering without form state.
|
|
30
|
+
*/
|
|
31
|
+
export declare function decodeFormState(bytes: Uint8Array, decode: FormStateFlightDecoder, timeoutMs: number): Promise<ReactFormState>;
|
|
32
|
+
/** The form state's Flight bytes as the base64 the page embeds. */
|
|
33
|
+
export declare function formStateToBase64(bytes: Uint8Array): string;
|
|
34
|
+
/** The embedded base64 back to the Flight bytes. */
|
|
35
|
+
export declare function formStateFromBase64(text: string): Uint8Array;
|
|
36
|
+
//# sourceMappingURL=form-state-flight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-state-flight.d.ts","sourceRoot":"","sources":["../../src/shared/form-state-flight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,CACnC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,KAC/B,WAAW,CAAC,cAAc,CAAC,CAAC;AAEjC;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,sBAAsB,EAC9B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,cAAc,CAAC,CAmBzB;AAED,mEAAmE;AACnE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAI3D;AAED,oDAAoD;AACpD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAK5D"}
|
|
@@ -123,12 +123,18 @@ const params = useSegmentParams(); // Partial<AllSegmentParams>
|
|
|
123
123
|
|
|
124
124
|
## Form Hooks
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
Forms use React's own `useActionState`, imported from `react`. An action built with `createActionClient` passes to it directly: `result` is typed from the action, and the dispatch accepts the submitted `FormData` or the schema's input.
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
### `parseFormErrors(result)`
|
|
129
|
+
|
|
130
|
+
Reads the errors out of an action result. `_root` validation errors are form-level; every other key is a field.
|
|
129
131
|
|
|
130
132
|
```tsx
|
|
131
|
-
|
|
133
|
+
import { useActionState } from 'react';
|
|
134
|
+
import { parseFormErrors } from '@timber-js/app/client';
|
|
135
|
+
|
|
136
|
+
const [result, action, isPending] = useActionState(createTodo, null);
|
|
137
|
+
const errors = parseFormErrors(result);
|
|
132
138
|
|
|
133
139
|
errors.hasErrors; // boolean
|
|
134
140
|
errors.fieldErrors; // Record<string, string[]>
|
|
@@ -137,6 +143,28 @@ errors.serverError; // { code, data? } | null
|
|
|
137
143
|
errors.getFieldError('title'); // string | null
|
|
138
144
|
```
|
|
139
145
|
|
|
146
|
+
### `useFormField(defaultValue)`
|
|
147
|
+
|
|
148
|
+
State for a form field that needs JavaScript, such as a combobox or a chip list, that follows the form's reset like a native input with a `defaultValue`. React resets a form after every action, so use this instead of `useState` for any field inside a form. See [Keeping What the User Typed](/docs/forms-and-actions#keeping-what-the-user-typed).
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
import { useFormField } from '@timber-js/app/client';
|
|
152
|
+
|
|
153
|
+
// draft = toDraft(result?.submittedValues ?? post): the form's defaults
|
|
154
|
+
const [tags, setTags, ref] = useFormField(draft.tags);
|
|
155
|
+
|
|
156
|
+
<div ref={ref}>
|
|
157
|
+
<input type="hidden" name="tags" value={tags.join(',')} />
|
|
158
|
+
<TagPicker value={tags} onChange={setTags} />
|
|
159
|
+
</div>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
- `value`: `defaultValue` until `setValue` is called, then the edit. An unedited field follows a new `defaultValue`.
|
|
163
|
+
- `setValue`: like a `useState` setter; accepts a value or an updater.
|
|
164
|
+
- `ref`: attach to any element inside the `<form>`. When the form resets, the edit is dropped and `value` is `defaultValue` again, unless the form cancels the `reset` event.
|
|
165
|
+
|
|
166
|
+
An edit dispatches a bubbling `change` event from the `ref` element, so a native `change` listener on the form sees it. React's `onChange` prop does not: it only reports inputs, selects and textareas. Render the value into the form data yourself, usually with a hidden input.
|
|
167
|
+
|
|
140
168
|
### `useFormAction(action)`
|
|
141
169
|
|
|
142
170
|
Bind a server action to a form with pending state.
|
|
@@ -153,7 +153,7 @@ limits: {
|
|
|
153
153
|
- **Type:** `boolean | string[]`
|
|
154
154
|
- **Default:** `true`
|
|
155
155
|
|
|
156
|
-
Strip sensitive fields (passwords, tokens, CVV, SSN, etc.) from the `submittedValues` echoed back
|
|
156
|
+
Strip sensitive fields (passwords, tokens, CVV, SSN, etc.) from the `submittedValues` echoed back when an action fails. `true` uses the built-in deny-list; an array adds extra field names to the built-in list; `false` disables stripping (never do this in production). See [Forms & Server Actions](/docs/forms-and-actions) for the full pattern list.
|
|
157
157
|
|
|
158
158
|
### `pageExtensions`
|
|
159
159
|
|