@timber-js/app 0.2.0-alpha.209 → 0.2.0-alpha.210
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/dist/_chunks/{actions-BerlqoXA.js → actions-Rjk4htmA.js} +19 -25
- package/dist/_chunks/{actions-BerlqoXA.js.map → actions-Rjk4htmA.js.map} +1 -1
- package/dist/_chunks/als-registry-DaxkVjt5.js.map +1 -1
- package/dist/_chunks/{cache-api-CR23J_NC.js → cache-api-DGdYfNJn.js} +4 -4
- package/dist/_chunks/{cache-api-CR23J_NC.js.map → cache-api-DGdYfNJn.js.map} +1 -1
- package/dist/_chunks/{chains-CpFg56UB.js → chains-BoO51joc.js} +2 -2
- package/dist/_chunks/{chains-CpFg56UB.js.map → chains-BoO51joc.js.map} +1 -1
- package/dist/_chunks/{cli-check-C6Ev6wBO.js → cli-check-ajNY3B2e.js} +3 -3
- package/dist/_chunks/{cli-check-C6Ev6wBO.js.map → cli-check-ajNY3B2e.js.map} +1 -1
- package/dist/_chunks/{cli-schema-sync-CbT2AUUI.js → cli-schema-sync-D2eI8jEg.js} +2 -2
- package/dist/_chunks/{cli-schema-sync-CbT2AUUI.js.map → cli-schema-sync-D2eI8jEg.js.map} +1 -1
- package/dist/_chunks/{file-cache-Dw6BJPG7.js → codegen-Bps1sLKJ.js} +3 -29
- package/dist/_chunks/codegen-Bps1sLKJ.js.map +1 -0
- package/dist/_chunks/{convention-lint-jKTwKwPe.js → convention-lint-DLmhGsRS.js} +54 -316
- package/dist/_chunks/convention-lint-DLmhGsRS.js.map +1 -0
- package/dist/_chunks/{dev-server-C4WZdB7L.js → dev-server-v97rQH4b.js} +99 -9
- package/dist/_chunks/dev-server-v97rQH4b.js.map +1 -0
- package/dist/_chunks/{error-boundary-tA7kVfs4.js → error-boundary-DsNScGRM.js} +4 -4
- package/dist/_chunks/{error-boundary-tA7kVfs4.js.map → error-boundary-DsNScGRM.js.map} +1 -1
- package/dist/_chunks/{json-lossy-check-ip0Qi0MT.js → json-lossy-check-CVuRs2hG.js} +2 -2
- package/dist/_chunks/{json-lossy-check-ip0Qi0MT.js.map → json-lossy-check-CVuRs2hG.js.map} +1 -1
- package/dist/_chunks/{live-graph-Dv-JJCZw.js → live-graph-9cSnn_h9.js} +3 -3
- package/dist/_chunks/{live-graph-Dv-JJCZw.js.map → live-graph-9cSnn_h9.js.map} +1 -1
- package/dist/_chunks/{logger-DiDt5ppH.js → logger-BP0LN6vP.js} +17 -2
- package/dist/_chunks/{logger-DiDt5ppH.js.map → logger-BP0LN6vP.js.map} +1 -1
- package/dist/_chunks/metadata-routes-DSDjM_hJ.js.map +1 -1
- package/dist/_chunks/navigation-root-BQfo1-kG.js.map +1 -1
- package/dist/_chunks/{poison-scan-CpeT6_OJ.js → poison-scan-vGV7Re0B.js} +2 -2
- package/dist/_chunks/{poison-scan-CpeT6_OJ.js.map → poison-scan-vGV7Re0B.js.map} +1 -1
- package/dist/_chunks/{scanner-Bw0oq1HB.js → scanner-DmqdxzbW.js} +392 -7
- package/dist/_chunks/scanner-DmqdxzbW.js.map +1 -0
- package/dist/_chunks/segment-classify-C539Pa2O.js.map +1 -1
- package/dist/_chunks/{sizeof-UwzwB1uM.js → sizeof-BM1409x2.js} +2 -2
- package/dist/_chunks/{sizeof-UwzwB1uM.js.map → sizeof-BM1409x2.js.map} +1 -1
- package/dist/_chunks/{status-page-marker-gaihi0KZ.js → status-page-marker-BRX9Ib-d.js} +1 -45
- package/dist/_chunks/status-page-marker-BRX9Ib-d.js.map +1 -0
- package/dist/_chunks/{walkers-BXExhzzk.js → walkers-Czu2jXFq.js} +3 -3
- package/dist/_chunks/{walkers-BXExhzzk.js.map → walkers-Czu2jXFq.js.map} +1 -1
- package/dist/adapters/cloudflare-kv-cache.js +1 -1
- package/dist/analyze/crawl-entry.js +2 -2
- 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/cli.js +3 -3
- package/dist/client/browser-entry/post-hydration.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/history.d.ts +0 -9
- package/dist/client/history.d.ts.map +1 -1
- package/dist/client/index.d.ts +2 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +9 -3
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.js +25 -38
- package/dist/client/internal.js.map +1 -1
- package/dist/client/link.d.ts +22 -0
- package/dist/client/link.d.ts.map +1 -1
- package/dist/client/navigation-api.d.ts +14 -2
- package/dist/client/navigation-api.d.ts.map +1 -1
- package/dist/client/navigation-root.d.ts +9 -1
- package/dist/client/navigation-root.d.ts.map +1 -1
- package/dist/client/navigation-transition.d.ts +6 -1
- package/dist/client/navigation-transition.d.ts.map +1 -1
- package/dist/client/react-root.d.ts.map +1 -1
- package/dist/client/router-effects.d.ts +10 -3
- package/dist/client/router-effects.d.ts.map +1 -1
- package/dist/client/router-pipeline.d.ts +3 -1
- package/dist/client/router-pipeline.d.ts.map +1 -1
- package/dist/client/router-types.d.ts +65 -9
- package/dist/client/router-types.d.ts.map +1 -1
- package/dist/client/router.d.ts.map +1 -1
- package/dist/client/segment-cache.d.ts +0 -15
- package/dist/client/segment-cache.d.ts.map +1 -1
- package/dist/client/use-router.d.ts +13 -6
- package/dist/client/use-router.d.ts.map +1 -1
- package/dist/config-validation.d.ts +19 -2
- package/dist/config-validation.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/routing/convention-lint.d.ts.map +1 -1
- package/dist/routing/export-detect.d.ts +19 -0
- package/dist/routing/export-detect.d.ts.map +1 -1
- package/dist/routing/index.js +3 -3
- package/dist/routing/manifest-codegen.d.ts.map +1 -1
- package/dist/routing/scanner.d.ts.map +1 -1
- package/dist/routing/types.d.ts +7 -0
- package/dist/routing/types.d.ts.map +1 -1
- package/dist/server/action-handler.d.ts +1 -1
- package/dist/server/action-handler.d.ts.map +1 -1
- package/dist/server/actions.d.ts +9 -4
- package/dist/server/actions.d.ts.map +1 -1
- package/dist/server/csrf.d.ts +38 -19
- package/dist/server/csrf.d.ts.map +1 -1
- package/dist/server/error-boundary-wrapper.d.ts +8 -4
- package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
- package/dist/server/fallback-error.d.ts.map +1 -1
- package/dist/server/form-flash.d.ts +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/internal.js +249 -16
- package/dist/server/internal.js.map +1 -1
- package/dist/server/logger.d.ts +16 -3
- package/dist/server/logger.d.ts.map +1 -1
- package/dist/server/metadata-collector.d.ts +2 -0
- package/dist/server/metadata-collector.d.ts.map +1 -1
- package/dist/server/metadata-routes.d.ts +12 -1
- package/dist/server/metadata-routes.d.ts.map +1 -1
- package/dist/server/pipeline-helpers.d.ts +29 -1
- package/dist/server/pipeline-helpers.d.ts.map +1 -1
- package/dist/server/pipeline.d.ts +8 -1
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/route-element-builder.d.ts.map +1 -1
- package/dist/server/route-matcher.d.ts +8 -0
- package/dist/server/route-matcher.d.ts.map +1 -1
- package/dist/server/rsc-entry/{wrap-action-dispatch.d.ts → action-dispatcher.d.ts} +18 -40
- package/dist/server/rsc-entry/action-dispatcher.d.ts.map +1 -0
- package/dist/server/rsc-entry/index.d.ts.map +1 -1
- package/dist/server/safe-load.d.ts +5 -12
- package/dist/server/safe-load.d.ts.map +1 -1
- package/docs/api/30-api-server.mdx +1 -1
- package/docs/api/31-api-client.mdx +23 -20
- package/docs/api/34-api-config.mdx +4 -2
- package/package.json +1 -1
- package/src/client/browser-entry/action-dispatch.ts +28 -28
- package/src/client/browser-entry/post-hydration.ts +11 -1
- package/src/client/browser-entry/router-init.ts +10 -4
- package/src/client/history.ts +0 -22
- package/src/client/index.ts +2 -1
- package/src/client/link.tsx +30 -1
- package/src/client/navigation-api.ts +36 -3
- package/src/client/navigation-root.tsx +13 -1
- package/src/client/navigation-transition.ts +17 -7
- package/src/client/react-root.ts +11 -2
- package/src/client/router-effects.ts +11 -4
- package/src/client/router-pipeline.ts +4 -0
- package/src/client/router-types.ts +80 -6
- package/src/client/router.ts +36 -24
- package/src/client/segment-cache.ts +0 -65
- package/src/client/use-router.ts +25 -6
- package/src/config-validation.ts +121 -5
- package/src/index.ts +5 -8
- package/src/routing/convention-lint.ts +75 -0
- package/src/routing/export-detect.ts +88 -0
- package/src/routing/manifest-codegen.ts +6 -0
- package/src/routing/scanner.ts +9 -0
- package/src/routing/types.ts +7 -0
- package/src/server/action-handler.ts +14 -11
- package/src/server/actions.ts +37 -42
- package/src/server/als-registry.ts +1 -1
- package/src/server/csrf.ts +100 -72
- package/src/server/error-boundary-wrapper.ts +11 -12
- package/src/server/fallback-error.ts +13 -21
- package/src/server/form-flash.ts +1 -1
- package/src/server/logger.ts +19 -3
- package/src/server/metadata-collector.ts +4 -1
- package/src/server/metadata-routes.ts +23 -8
- package/src/server/pipeline-helpers.ts +89 -8
- package/src/server/pipeline.ts +27 -2
- package/src/server/route-element-builder.ts +1 -0
- package/src/server/route-matcher.ts +11 -0
- package/src/server/rsc-entry/{wrap-action-dispatch.ts → action-dispatcher.ts} +20 -62
- package/src/server/rsc-entry/index.ts +14 -27
- package/src/server/safe-load.ts +5 -12
- package/dist/_chunks/convention-lint-jKTwKwPe.js.map +0 -1
- package/dist/_chunks/dev-server-C4WZdB7L.js.map +0 -1
- package/dist/_chunks/file-cache-Dw6BJPG7.js.map +0 -1
- package/dist/_chunks/scanner-Bw0oq1HB.js.map +0 -1
- package/dist/_chunks/status-page-marker-gaihi0KZ.js.map +0 -1
- package/dist/server/rsc-entry/wrap-action-dispatch.d.ts.map +0 -1
package/dist/server/logger.d.ts
CHANGED
|
@@ -31,9 +31,10 @@ export declare function getLogger(): TimberLogger;
|
|
|
31
31
|
* so this line is the only place the rejected origin is visible (TIM-1459).
|
|
32
32
|
* `detail` names the observed origin and, where one exists, the expected one.
|
|
33
33
|
*
|
|
34
|
-
* The
|
|
35
|
-
*
|
|
36
|
-
* present (design/17-logging.md §"trace_id is
|
|
34
|
+
* The gate runs inside the pipeline's trace scope, so the line carries the
|
|
35
|
+
* request's `trace_id`. A caller outside any scope still gets one minted
|
|
36
|
+
* here — the field is always present (design/17-logging.md §"trace_id is
|
|
37
|
+
* Always Set").
|
|
37
38
|
*/
|
|
38
39
|
export declare function logCsrfRejected(detail: string, data: {
|
|
39
40
|
method: string;
|
|
@@ -88,6 +89,18 @@ export declare function logRenderError(data: {
|
|
|
88
89
|
error: unknown;
|
|
89
90
|
errorId?: string;
|
|
90
91
|
}): void;
|
|
92
|
+
/**
|
|
93
|
+
* Log a status page, error page, `global-error.tsx` or fallback layout that
|
|
94
|
+
* failed to load and was skipped: the next fallback tier answers in its place.
|
|
95
|
+
* Level: error — a boundary that vanished is a bug in the app, even though the
|
|
96
|
+
* request still gets a page. The caller writes it once per file and failure.
|
|
97
|
+
*/
|
|
98
|
+
export declare function logSkippedModule(data: {
|
|
99
|
+
method: string;
|
|
100
|
+
path: string;
|
|
101
|
+
file: string;
|
|
102
|
+
error: unknown;
|
|
103
|
+
}): void;
|
|
91
104
|
/** Log proxy.ts uncaught error. Level: error. */
|
|
92
105
|
export declare function logProxyError(data: {
|
|
93
106
|
error: unknown;
|
|
@@ -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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D;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"}
|
|
@@ -46,6 +46,8 @@ export interface MetadataCollectorProps {
|
|
|
46
46
|
export declare function MetadataCollector(props: MetadataCollectorProps): ReactNode;
|
|
47
47
|
export interface MetadataHeadProps {
|
|
48
48
|
segments: ManifestSegmentNode[];
|
|
49
|
+
/** The matcher's raw (pre-coercion) params — fill the owning segment's URL for auto-links. */
|
|
50
|
+
rawSegmentParams: Record<string, string | string[]>;
|
|
49
51
|
requestUrl: string;
|
|
50
52
|
metadataRouteHashes?: Record<string, string>;
|
|
51
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata-collector.d.ts","sourceRoot":"","sources":["../../src/server/metadata-collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AA4C9D,MAAM,WAAW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F;IAC9F,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC,CAkC/E"}
|
|
@@ -137,7 +137,18 @@ export declare function getMetadataRouteAutoLink(type: MetadataRouteType, href:
|
|
|
137
137
|
* emits HeadElement descriptors for <link> and <meta> tags that React Float
|
|
138
138
|
* hoists into <head>.
|
|
139
139
|
*
|
|
140
|
+
* A metadata file is served under the URL of the segment that owns it, not
|
|
141
|
+
* under every descendant URL: a root `app/icon.tsx` rendered on `/map` links
|
|
142
|
+
* `/icon.png`, and `app/posts/[id]/opengraph-image.tsx` on `/posts/42/comments`
|
|
143
|
+
* links `/posts/42/opengraph-image.png`. The owner's prefix is the URL parts
|
|
144
|
+
* the chain has consumed through that segment (`extractUrlParts`, the same
|
|
145
|
+
* walk slot matching uses), filled with the request's raw param values — the
|
|
146
|
+
* parts the metadata route matcher walks back to the same owner.
|
|
147
|
+
*
|
|
148
|
+
* Segments at or below an intercepting segment are skipped: the metadata
|
|
149
|
+
* matcher only walks the canonical tree, so nothing serves their files.
|
|
150
|
+
*
|
|
140
151
|
* See design/16-metadata.md §"Auto-Linking"
|
|
141
152
|
*/
|
|
142
|
-
export declare function collectMetadataRouteHeadElements(segments: ManifestSegmentNode[], firstDeniedIndex: number, resolvedMetadata: Metadata, requestUrl: URL, metadataRouteHashes?: Record<string, string>): HeadElement[];
|
|
153
|
+
export declare function collectMetadataRouteHeadElements(segments: ManifestSegmentNode[], firstDeniedIndex: number, resolvedMetadata: Metadata, requestUrl: URL, rawSegmentParams: Record<string, string | string[]>, metadataRouteHashes?: Record<string, string>): HeadElement[];
|
|
143
154
|
//# sourceMappingURL=metadata-routes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata-routes.d.ts","sourceRoot":"","sources":["../../src/server/metadata-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"metadata-routes.d.ts","sourceRoot":"","sources":["../../src/server/metadata-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAK9D,+CAA+C;AAC/C,MAAM,WAAW,iBAAiB;IAChC,+BAA+B;IAC/B,IAAI,EAAE,iBAAiB,CAAC;IACxB,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,QAAQ,GACR,UAAU,GACV,SAAS,GACT,MAAM,GACN,iBAAiB,GACjB,YAAY,CAAC;AAIjB;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAC7C,MAAM,EACN;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;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AAM,GAAG,WAAW,EAAE,CAgB7F;AAYD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,EAAE,QAAQ,EAC1B,UAAU,EAAE,GAAG,EACf,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EACnD,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3C,WAAW,EAAE,CAiEf"}
|
|
@@ -12,8 +12,25 @@ import type { ProxyExport } from './proxy.ts';
|
|
|
12
12
|
import { RedirectSignal } from './primitives.ts';
|
|
13
13
|
import { type ManifestLoader } from './safe-load.ts';
|
|
14
14
|
import { type ManifestSegmentNode } from './route-matcher.ts';
|
|
15
|
-
import type { ProxyConfig } from './pipeline.ts';
|
|
15
|
+
import type { ProxyConfig, RouteMatcher } from './pipeline.ts';
|
|
16
|
+
import { type CsrfConfig } from './csrf.ts';
|
|
16
17
|
import type { PhaseName } from './pipeline-outcome.ts';
|
|
18
|
+
/**
|
|
19
|
+
* The pipeline-boundary CSRF gate: the 403 to answer with, or null to go on.
|
|
20
|
+
*
|
|
21
|
+
* Runs on every request after canonicalization and before proxy.ts, so it
|
|
22
|
+
* covers route.ts handlers and server actions alike, and no user code has
|
|
23
|
+
* run when it decides. The per-route exemption is looked up only for a
|
|
24
|
+
* request the check would reject — the common accepted request never pays
|
|
25
|
+
* for a match. The lookup uses the pipeline's own matcher on the canonical
|
|
26
|
+
* path, the same match `handleRequest` dispatches on, and reads a flag the
|
|
27
|
+
* scanner took from route.ts source, so deciding it loads no module.
|
|
28
|
+
*
|
|
29
|
+
* A matcher that throws leaves the request unexempted: fail closed.
|
|
30
|
+
*
|
|
31
|
+
* See design/08-forms-and-actions.md §"CSRF Protection".
|
|
32
|
+
*/
|
|
33
|
+
export declare function csrfGate(req: Request, canonicalPath: string, csrf: CsrfConfig, matchRoute: RouteMatcher): Response | null;
|
|
17
34
|
/**
|
|
18
35
|
* Resolver closure produced once at pipeline construction. The lazy variant
|
|
19
36
|
* still calls `loader()` per-request (HMR relies on re-importing), but the
|
|
@@ -141,6 +158,17 @@ export declare function reportRenderError(error: unknown, req: Request, details?
|
|
|
141
158
|
* taking the page down. Every such load goes through here, whether it builds
|
|
142
159
|
* a boundary for a normal render or a fallback page, so a broken module is
|
|
143
160
|
* never skipped silently.
|
|
161
|
+
*
|
|
162
|
+
* Logged and reported once per broken file, not once per request: every
|
|
163
|
+
* request that renders under a broken `error.tsx` loads it again (TIM-1458).
|
|
164
|
+
* See `skippedFiles` for how "the same failure" is recognised. The first
|
|
165
|
+
* request to hit a failure is the one that reports it; if that request has
|
|
166
|
+
* already aborted, `fireOnRequestError()` drops the report and the failure is
|
|
167
|
+
* only logged.
|
|
168
|
+
*
|
|
169
|
+
* Never rejects, including when a user logger throws: building an error
|
|
170
|
+
* boundary must not itself throw (TIM-584), and the boundary walk does not
|
|
171
|
+
* catch for it.
|
|
144
172
|
*/
|
|
145
173
|
export declare function loadFallbackModule(file: ManifestLoader, req: Request, segments?: readonly ManifestSegmentNode[]): Promise<Record<string, unknown> | null>;
|
|
146
174
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline-helpers.d.ts","sourceRoot":"","sources":["../../src/server/pipeline-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAS9C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,OAAO,EAA+B,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAElF,OAAO,
|
|
1
|
+
{"version":3,"file":"pipeline-helpers.d.ts","sourceRoot":"","sources":["../../src/server/pipeline-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE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ests.
|
|
3
3
|
*
|
|
4
4
|
* Pipeline stages (in order):
|
|
5
|
-
* proxy.ts →
|
|
5
|
+
* canonicalize → CSRF gate → proxy.ts → route match → 103 Early Hints → middleware.ts → render
|
|
6
6
|
*
|
|
7
7
|
* The phase functions live in `pipeline-phases.ts` so each phase can be
|
|
8
8
|
* tested in isolation. The terminal `outcomeToResponse` translator and
|
|
@@ -19,6 +19,7 @@ import type { ProxyExport } from './proxy.ts';
|
|
|
19
19
|
import type { MiddlewareFn } from './middleware-runner.ts';
|
|
20
20
|
import { DenySignal } from './primitives.ts';
|
|
21
21
|
import type { ManifestSegmentNode } from './route-matcher.ts';
|
|
22
|
+
import type { CsrfConfig } from './csrf.ts';
|
|
22
23
|
/**
|
|
23
24
|
* Result of matching a canonical pathname against the route tree.
|
|
24
25
|
*
|
|
@@ -93,6 +94,12 @@ export interface PipelineConfig {
|
|
|
93
94
|
proxy?: ProxyConfig | ProxyExport;
|
|
94
95
|
/** Route matcher — resolves a canonical pathname to a RouteMatch. */
|
|
95
96
|
matchRoute: RouteMatcher;
|
|
97
|
+
/**
|
|
98
|
+
* CSRF configuration (`allowedOrigins`, the `csrf: false` switch). The
|
|
99
|
+
* gate is on when this is omitted — protection is never opt-in. See
|
|
100
|
+
* design/08-forms-and-actions.md §"CSRF Protection".
|
|
101
|
+
*/
|
|
102
|
+
csrf?: CsrfConfig;
|
|
96
103
|
/** Metadata route matcher — resolves metadata route pathnames (sitemap.xml, robots.txt, etc.) */
|
|
97
104
|
matchMetadataRoute?: MetadataRouteMatcher;
|
|
98
105
|
/** Renderer — produces the final Response for a matched route. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/server/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YA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,+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,CA6Z7B"}
|
|
@@ -62,6 +62,14 @@ export declare function collectMiddlewareChain(chain: ManifestSegmentNode[]): Mi
|
|
|
62
62
|
* format, error reporting — agrees with what actually ran.
|
|
63
63
|
*/
|
|
64
64
|
export declare function isApiRouteChain(segments: readonly ManifestSegmentNode[]): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Whether a matched chain is a route.ts handler that opted out of the CSRF
|
|
67
|
+
* check with `export const csrf = false`. Keyed on the same leaf
|
|
68
|
+
* `isApiRouteChain` dispatches on, so the exemption can only ever apply to
|
|
69
|
+
* the route.ts that will actually run — never to a page, and so never to a
|
|
70
|
+
* server action. See design/08-forms-and-actions.md §"Per-route exemption".
|
|
71
|
+
*/
|
|
72
|
+
export declare function isCsrfExemptRoute(segments: readonly ManifestSegmentNode[]): boolean;
|
|
65
73
|
/** Result of matching a metadata route. */
|
|
66
74
|
export interface MetadataRouteMatch {
|
|
67
75
|
/** The metadata route type (sitemap, robots, icon, etc.) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-matcher.d.ts","sourceRoot":"","sources":["../../src/server/route-matcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAY9B,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,YAAY,CAAC;IAC3D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,YAAY,GACrB,CAAC,QAAQ,EAAE,MAAM,KAAK,UAAU,GAAG,IAAI,CAEzC;AAwBD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,YAAY,EAAE,CAcnF;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,GAAG,OAAO,CAGjF;AAID,2CAA2C;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B,CAAC,QAAQ,EAAE,MAAM,KAAK,UAAU,GAAG,IAAI,CAEzC;AAwBD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,YAAY,EAAE,CAcnF;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,GAAG,OAAO,CAGjF;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,GAAG,OAAO,CAEnF;AAID,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,IAAI,EAAE,iBAAiB,CAAC;IACxB,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,IAAI,EAAE,YAAY,CAAC;IACnB,0DAA0D;IAC1D,OAAO,EAAE,mBAAmB,CAAC;IAC7B;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,wEAAwE;IACxE,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;CAClD;AAcD;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,YAAY,GACrB,CAAC,QAAQ,EAAE,MAAM,KAAK,kBAAkB,GAAG,IAAI,CAEjD"}
|
|
@@ -1,33 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Server action dispatcher — the `dispatchAction` callback for
|
|
3
|
+
* `PipelineConfig`.
|
|
3
4
|
*
|
|
4
5
|
* Extracted from rsc-entry/index.ts so the wiring can be unit-tested in
|
|
5
6
|
* isolation from Vite's virtual modules.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* **Pipeline-boundary CSRF validation** — runs on EVERY unsafe-method
|
|
12
|
-
* request, before any dispatch decision. This is the only line of
|
|
13
|
-
* defense for `route.ts` API handlers and server actions. See LOCAL-773.
|
|
14
|
-
*
|
|
15
|
-
* Server action dispatch has moved INTO the pipeline (`PipelineConfig.
|
|
16
|
-
* dispatchAction`) so that `proxy.ts` runs on action POSTs — matching the
|
|
17
|
-
* design doc contract: "proxy.ts runs on every request, no exclusions."
|
|
18
|
-
*
|
|
19
|
-
* The `buildActionDispatcher` function constructs the `dispatchAction`
|
|
20
|
-
* callback that `createPipeline` calls after proxy.ts runs. It
|
|
21
|
-
* encapsulates action detection, route-type check, action handler
|
|
8
|
+
* `createPipeline` calls it after proxy.ts runs (TIM-1213), so proxy.ts
|
|
9
|
+
* sees action POSTs — "proxy.ts runs on every request, no exclusions." It
|
|
10
|
+
* encapsulates action detection, the route-type check, action handler
|
|
22
11
|
* dispatch, and the no-JS validation rerender path.
|
|
23
12
|
*
|
|
13
|
+
* The CSRF gate is not here: it runs in `createPipeline` before proxy.ts
|
|
14
|
+
* (`csrfGate` in pipeline-helpers.ts). The action handler repeats the
|
|
15
|
+
* check as defense-in-depth, with no per-route exemption.
|
|
16
|
+
*
|
|
24
17
|
* Per-segment `middleware.ts` does NOT run on action POSTs (TIM-1134).
|
|
25
|
-
* Actions are dispatched by action ID, not by route segment.
|
|
26
|
-
* validation
|
|
27
|
-
* belongs in `createActionClient({ middleware })`.
|
|
18
|
+
* Actions are dispatched by action ID, not by route segment. Per-action
|
|
19
|
+
* auth/validation belongs in `createActionClient({ middleware })`.
|
|
28
20
|
*/
|
|
29
21
|
import type { BodyLimitsConfig } from '../body-limits.ts';
|
|
30
|
-
import {
|
|
22
|
+
import type { CsrfConfig } from '../csrf.ts';
|
|
31
23
|
import type { RouteMatcher } from '../pipeline.ts';
|
|
32
24
|
import type { SensitiveFieldsOption } from '../sensitive-fields.ts';
|
|
33
25
|
import type { RevalidateRenderer } from '../actions.ts';
|
|
@@ -41,11 +33,6 @@ import type { RevalidateRenderer } from '../actions.ts';
|
|
|
41
33
|
* `rsc-entry/index.ts`.
|
|
42
34
|
*/
|
|
43
35
|
export type RevalidateRendererFactory = (req: Request) => RevalidateRenderer;
|
|
44
|
-
/** Dependencies for the CSRF wrapper. */
|
|
45
|
-
export interface ActionDispatchDeps {
|
|
46
|
-
/** CSRF configuration (Origin allow-list, on/off switch). */
|
|
47
|
-
csrfConfig: CsrfConfig;
|
|
48
|
-
}
|
|
49
36
|
/** Dependencies for the action dispatcher (used inside the pipeline). */
|
|
50
37
|
export interface ActionDispatcherDeps {
|
|
51
38
|
/** CSRF configuration — defense-in-depth check inside the action handler. */
|
|
@@ -58,22 +45,13 @@ export interface ActionDispatcherDeps {
|
|
|
58
45
|
buildRevalidateRenderer: RevalidateRendererFactory;
|
|
59
46
|
/**
|
|
60
47
|
* Route matcher — used for the route-type check that skips action
|
|
61
|
-
* detection on `route.ts` API handlers (TIM-870).
|
|
48
|
+
* detection on `route.ts` API handlers (TIM-870). Required: without it,
|
|
49
|
+
* every form POST to a route.ts would enter the action handler, whose
|
|
50
|
+
* CSRF check has no per-route exemption, and a `csrf = false` route
|
|
51
|
+
* would 403 its cross-site callbacks.
|
|
62
52
|
*/
|
|
63
|
-
matchRoute
|
|
53
|
+
matchRoute: RouteMatcher;
|
|
64
54
|
}
|
|
65
|
-
/**
|
|
66
|
-
* Wrap a pipeline function with pipeline-boundary CSRF validation.
|
|
67
|
-
*
|
|
68
|
-
* The returned handler is the framework's outermost request entry point.
|
|
69
|
-
* It validates the `Origin` header on every unsafe-method request before
|
|
70
|
-
* any dispatch decision — this is the ONLY line of defense for `route.ts`
|
|
71
|
-
* API handlers, which never see the action handler.
|
|
72
|
-
*
|
|
73
|
-
* Action dispatch has moved inside the pipeline (TIM-1213) so proxy.ts
|
|
74
|
-
* runs on every request. This wrapper now only handles CSRF.
|
|
75
|
-
*/
|
|
76
|
-
export declare function wrapPipelineWithActionDispatch(pipeline: (req: Request) => Promise<Response>, deps: ActionDispatchDeps): (req: Request) => Promise<Response>;
|
|
77
55
|
/**
|
|
78
56
|
* Build the `dispatchAction` callback for `PipelineConfig`.
|
|
79
57
|
*
|
|
@@ -86,4 +64,4 @@ export declare function wrapPipelineWithActionDispatch(pipeline: (req: Request)
|
|
|
86
64
|
* fall through to normal routing.
|
|
87
65
|
*/
|
|
88
66
|
export declare function buildActionDispatcher(deps: ActionDispatcherDeps): (req: Request, canonicalPath: string, reenter: (req: Request, cookies: Map<string, string>) => Promise<Response>) => Promise<Response | null>;
|
|
89
|
-
//# sourceMappingURL=
|
|
67
|
+
//# sourceMappingURL=action-dispatcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-dispatcher.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/action-dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,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,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,OAAO,CAAC,QAAQ,CAAC,KACvE,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CA0D5B"}
|
|
@@ -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;AAgVD,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"}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
* Wraps the lazy `load()` functions from the route manifest with a
|
|
5
5
|
* try/catch that re-throws with the file path and original cause.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Loads the render can do without (status, error and fallback pages) go
|
|
8
|
+
* through `loadFallbackModule()` in pipeline-helpers.ts instead, which logs
|
|
9
|
+
* and reports the failure and resolves to `null` — never a bare
|
|
10
|
+
* `.catch(() => null)`, which skips a broken page silently (TIM-1458).
|
|
9
11
|
*
|
|
10
12
|
* See design/spike-TIM-551-dynamic-import-audit.md §"Proposed Wrapping Strategy"
|
|
11
13
|
*/
|
|
@@ -31,16 +33,7 @@ export declare class ModuleLoadError extends Error {
|
|
|
31
33
|
* On success: returns the module object (same as `loader.load()`).
|
|
32
34
|
* On failure: throws `ModuleLoadError` with file path and original cause.
|
|
33
35
|
*
|
|
34
|
-
*
|
|
35
|
-
* callers should catch at the call site:
|
|
36
|
-
*
|
|
37
|
-
* ```ts
|
|
38
|
-
* // Throwing (default) — route-element-builder, api-handler, etc.
|
|
39
|
-
* const mod = await loadModule(segment.page);
|
|
40
|
-
*
|
|
41
|
-
* // Fallthrough — error-renderer, error-boundary-wrapper
|
|
42
|
-
* const mod = await loadModule(segment.error).catch(() => null);
|
|
43
|
-
* ```
|
|
36
|
+
* Error rendering paths that need fallthrough use `loadFallbackModule()`.
|
|
44
37
|
*/
|
|
45
38
|
export declare function loadModule<T = Record<string, unknown>>(loader: ManifestLoader): Promise<T>;
|
|
46
39
|
//# sourceMappingURL=safe-load.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-load.d.ts","sourceRoot":"","sources":["../../src/server/safe-load.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"safe-load.d.ts","sourceRoot":"","sources":["../../src/server/safe-load.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,YAAY,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAK3C;CACF;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,CAMhG"}
|
|
@@ -130,7 +130,7 @@ throw new ActionError('VALIDATION_FAILED', { field: 'email' });
|
|
|
130
130
|
|
|
131
131
|
### `revalidatePath(path)`
|
|
132
132
|
|
|
133
|
-
Re-render a path and return the RSC payload as part of the action response. Server actions only: called anywhere else, it throws, because there is no action response to attach the render to. From a `route.ts` handler or a job, use `revalidateTag()` or `cache.invalidate()`.
|
|
133
|
+
Re-render a path and return the RSC payload as part of the action response. Naming a page other than the one the action ran on makes the browser drop its cached pages, so the next navigation fetches fresh data. Server actions only: called anywhere else, it throws, because there is no action response to attach the render to. From a `route.ts` handler or a job, use `revalidateTag()` or `cache.invalidate()`.
|
|
134
134
|
|
|
135
135
|
### `revalidateTag(tag)`
|
|
136
136
|
|
|
@@ -24,12 +24,13 @@ import { Link } from '@timber-js/app/client';
|
|
|
24
24
|
|
|
25
25
|
#### Props
|
|
26
26
|
|
|
27
|
-
| Prop
|
|
28
|
-
|
|
|
29
|
-
| `href`
|
|
30
|
-
| `replace`
|
|
31
|
-
| `prefetch`
|
|
32
|
-
| `onNavigate`
|
|
27
|
+
| Prop | Type | Description |
|
|
28
|
+
| ----------------- | ------------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
29
|
+
| `href` | `string` | Target URL (type-checked against route map) |
|
|
30
|
+
| `replace` | `boolean` | Use `replaceState` instead of `pushState` |
|
|
31
|
+
| `prefetch` | `boolean` | Prefetch the RSC payload on hover |
|
|
32
|
+
| `onNavigate` | `OnNavigateHandler` | Intercept navigation before routing |
|
|
33
|
+
| `transitionTypes` | `string[]` | View transition types for this navigation (see [View transitions](/docs/client-navigation#view-transitions)) |
|
|
33
34
|
|
|
34
35
|
`prefetch` also works for previously visited URLs. A click can reuse the prefetched payload for 30 seconds; after expiry, navigation fetches a fresh payload. Same-page fragment links only scroll within the page and do not prefetch.
|
|
35
36
|
|
|
@@ -54,13 +55,15 @@ router.forward();
|
|
|
54
55
|
|
|
55
56
|
#### `RouterInstance`
|
|
56
57
|
|
|
57
|
-
| Method
|
|
58
|
-
|
|
|
59
|
-
| `push(href)` | Navigate, add history entry |
|
|
60
|
-
| `replace(href)` | Navigate, replace history entry |
|
|
61
|
-
| `refresh()`
|
|
62
|
-
| `back()`
|
|
63
|
-
| `forward()`
|
|
58
|
+
| Method | Description |
|
|
59
|
+
| ------------------------- | ---------------------------------- |
|
|
60
|
+
| `push(href, options?)` | Navigate, add history entry |
|
|
61
|
+
| `replace(href, options?)` | Navigate, replace history entry |
|
|
62
|
+
| `refresh()` | Re-fetch current route RSC payload |
|
|
63
|
+
| `back()` | Go back |
|
|
64
|
+
| `forward()` | Go forward |
|
|
65
|
+
|
|
66
|
+
`options` is `{ scroll?: boolean; transitionTypes?: string[] }`. Set `scroll: false` to keep the scroll position. `transitionTypes` are view transition types for this navigation.
|
|
64
67
|
|
|
65
68
|
A `deny()` reached by a client navigation renders your status page in place, without a page load — the denial travels in the navigation payload, and the boundary for the matching status file renders it. The payload response itself is always HTTP 200; the status code contract is a property of full page loads, where the browser, crawlers, and CDNs are the ones reading it.
|
|
66
69
|
|
|
@@ -114,8 +117,8 @@ Returns the current route segment params. Pass `SEGMENT_PATH` from `$segment` fo
|
|
|
114
117
|
import { SEGMENT_PATH } from './$segment';
|
|
115
118
|
import { useSegmentParams } from '@timber-js/app/client';
|
|
116
119
|
|
|
117
|
-
const { id } = useSegmentParams(SEGMENT_PATH);
|
|
118
|
-
const params = useSegmentParams();
|
|
120
|
+
const { id } = useSegmentParams(SEGMENT_PATH); // Exact types from schema
|
|
121
|
+
const params = useSegmentParams(); // Partial<AllSegmentParams>
|
|
119
122
|
```
|
|
120
123
|
|
|
121
124
|
## Form Hooks
|
|
@@ -127,11 +130,11 @@ Typed wrapper around React 19's `useActionState`. Returns `[result, formAction,
|
|
|
127
130
|
```tsx
|
|
128
131
|
const [result, action, isPending, errors] = useActionState(createTodo, flash);
|
|
129
132
|
|
|
130
|
-
errors.hasErrors
|
|
131
|
-
errors.fieldErrors
|
|
132
|
-
errors.formErrors
|
|
133
|
-
errors.serverError
|
|
134
|
-
errors.getFieldError('title') // string | null
|
|
133
|
+
errors.hasErrors; // boolean
|
|
134
|
+
errors.fieldErrors; // Record<string, string[]>
|
|
135
|
+
errors.formErrors; // string[]
|
|
136
|
+
errors.serverError; // { code, data? } | null
|
|
137
|
+
errors.getFieldError('title'); // string | null
|
|
135
138
|
```
|
|
136
139
|
|
|
137
140
|
### `useFormAction(action)`
|
|
@@ -125,14 +125,16 @@ Controls the `Server-Timing` response header. See [Instrumentation & Tracing](/d
|
|
|
125
125
|
- **Type:** `string[]`
|
|
126
126
|
- **Default:** none
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
Other origins whose requests pass CSRF validation. Your own origin is always accepted and never needs to be listed. This option does not configure CORS.
|
|
129
|
+
|
|
130
|
+
Matching is exact, so each entry must be a canonical origin: `scheme://host[:port]`, lowercase, with no path or trailing slash. The build fails on an entry that can never match, and the error names the form you meant. For example, `https://myapp.com/` suggests `https://myapp.com`. Wildcards aren't supported. `"null"` is refused because it would admit every sandboxed iframe. To accept cross-site POSTs on one endpoint, [exempt its `route.ts`](/docs/security).
|
|
129
131
|
|
|
130
132
|
### `csrf`
|
|
131
133
|
|
|
132
134
|
- **Type:** `boolean`
|
|
133
135
|
- **Default:** `true` (in server mode)
|
|
134
136
|
|
|
135
|
-
Enable CSRF protection for server actions
|
|
137
|
+
Enable CSRF protection for server actions, form submissions, and `route.ts` handlers. `false` turns it off for the whole app. To exempt one endpoint, use `export const csrf = false` in its `route.ts` ([Security](/docs/security)).
|
|
136
138
|
|
|
137
139
|
### `limits`
|
|
138
140
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timber-js/app",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.210",
|
|
4
4
|
"description": "Vite-native React framework built for Servers and Serverless Platforms — correct HTTP semantics, real status codes, pages that work without JavaScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare-workers",
|