@timber-js/app 0.2.0-alpha.2 → 0.2.0-alpha.20
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/{als-registry-k-AtAQ9R.js → als-registry-B7DbZ2hS.js} +1 -1
- package/dist/_chunks/{als-registry-k-AtAQ9R.js.map → als-registry-B7DbZ2hS.js.map} +1 -1
- package/dist/_chunks/debug-B3Gypr3D.js +108 -0
- package/dist/_chunks/debug-B3Gypr3D.js.map +1 -0
- package/dist/_chunks/{format-DNt20Kt8.js → format-RyoGQL74.js} +3 -2
- package/dist/_chunks/format-RyoGQL74.js.map +1 -0
- package/dist/_chunks/{interception-DGDIjDbR.js → interception-BOoWmLUA.js} +2 -2
- package/dist/_chunks/{interception-DGDIjDbR.js.map → interception-BOoWmLUA.js.map} +1 -1
- package/dist/_chunks/{metadata-routes-CQCnF4VK.js → metadata-routes-Cjmvi3rQ.js} +1 -1
- package/dist/_chunks/{metadata-routes-CQCnF4VK.js.map → metadata-routes-Cjmvi3rQ.js.map} +1 -1
- package/dist/_chunks/{request-context-CRj2Zh1E.js → request-context-BQUC8PHn.js} +5 -4
- package/dist/_chunks/request-context-BQUC8PHn.js.map +1 -0
- package/dist/_chunks/{ssr-data-DLnbYpj1.js → ssr-data-MjmprTmO.js} +1 -1
- package/dist/_chunks/{ssr-data-DLnbYpj1.js.map → ssr-data-MjmprTmO.js.map} +1 -1
- package/dist/_chunks/{tracing-DF0G3FB7.js → tracing-CemImE6h.js} +17 -3
- package/dist/_chunks/{tracing-DF0G3FB7.js.map → tracing-CemImE6h.js.map} +1 -1
- package/dist/_chunks/{use-cookie-dDbpCTx-.js → use-cookie-DX-l1_5E.js} +2 -2
- package/dist/_chunks/{use-cookie-dDbpCTx-.js.map → use-cookie-DX-l1_5E.js.map} +1 -1
- package/dist/_chunks/{use-query-states-DAhgj8Gx.js → use-query-states-D5KaffOK.js} +1 -1
- package/dist/_chunks/{use-query-states-DAhgj8Gx.js.map → use-query-states-D5KaffOK.js.map} +1 -1
- package/dist/adapters/nitro.d.ts +17 -1
- package/dist/adapters/nitro.d.ts.map +1 -1
- package/dist/adapters/nitro.js +17 -5
- package/dist/adapters/nitro.js.map +1 -1
- package/dist/cache/fast-hash.d.ts +22 -0
- package/dist/cache/fast-hash.d.ts.map +1 -0
- package/dist/cache/index.js +52 -10
- package/dist/cache/index.js.map +1 -1
- package/dist/cache/register-cached-function.d.ts.map +1 -1
- package/dist/cache/timber-cache.d.ts.map +1 -1
- package/dist/client/error-boundary.js +1 -1
- package/dist/client/index.js +3 -3
- package/dist/client/index.js.map +1 -1
- package/dist/client/link.d.ts.map +1 -1
- package/dist/client/router.d.ts.map +1 -1
- package/dist/client/segment-context.d.ts +1 -1
- package/dist/client/segment-context.d.ts.map +1 -1
- package/dist/client/segment-merger.d.ts.map +1 -1
- package/dist/client/stale-reload.d.ts.map +1 -1
- package/dist/client/top-loader.d.ts.map +1 -1
- package/dist/client/transition-root.d.ts +1 -1
- package/dist/client/transition-root.d.ts.map +1 -1
- package/dist/cookies/index.js +4 -4
- package/dist/fonts/css.d.ts +1 -0
- package/dist/fonts/css.d.ts.map +1 -1
- package/dist/fonts/local.d.ts +4 -2
- package/dist/fonts/local.d.ts.map +1 -1
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +249 -21
- package/dist/index.js.map +1 -1
- package/dist/plugins/build-report.d.ts +11 -1
- package/dist/plugins/build-report.d.ts.map +1 -1
- package/dist/plugins/entries.d.ts +7 -0
- package/dist/plugins/entries.d.ts.map +1 -1
- package/dist/plugins/fonts.d.ts +9 -1
- package/dist/plugins/fonts.d.ts.map +1 -1
- package/dist/plugins/mdx.d.ts +6 -0
- package/dist/plugins/mdx.d.ts.map +1 -1
- package/dist/plugins/server-bundle.d.ts.map +1 -1
- package/dist/routing/index.js +1 -1
- package/dist/search-params/index.js +1 -1
- package/dist/server/access-gate.d.ts.map +1 -1
- package/dist/server/action-client.d.ts.map +1 -1
- package/dist/server/debug.d.ts +82 -0
- package/dist/server/debug.d.ts.map +1 -0
- package/dist/server/deny-renderer.d.ts.map +1 -1
- package/dist/server/dev-warnings.d.ts.map +1 -1
- package/dist/server/html-injectors.d.ts.map +1 -1
- package/dist/server/index.js +32 -23
- package/dist/server/index.js.map +1 -1
- package/dist/server/logger.d.ts.map +1 -1
- package/dist/server/pipeline.d.ts +7 -4
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/primitives.d.ts.map +1 -1
- 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/index.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-stream.d.ts +6 -0
- package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
- package/dist/server/rsc-prop-warnings.d.ts.map +1 -1
- package/dist/server/tracing.d.ts +10 -0
- package/dist/server/tracing.d.ts.map +1 -1
- package/dist/server/waituntil-bridge.d.ts.map +1 -1
- package/dist/shims/image.d.ts +15 -15
- package/package.json +2 -1
- package/src/adapters/nitro.ts +43 -5
- package/src/cache/fast-hash.ts +34 -0
- package/src/cache/register-cached-function.ts +7 -3
- package/src/cache/timber-cache.ts +17 -10
- package/src/client/browser-entry.ts +10 -6
- package/src/client/link.tsx +14 -9
- package/src/client/router.ts +4 -6
- package/src/client/segment-context.ts +6 -1
- package/src/client/segment-merger.ts +2 -8
- package/src/client/stale-reload.ts +5 -7
- package/src/client/top-loader.tsx +23 -19
- package/src/client/transition-root.tsx +7 -1
- package/src/fonts/css.ts +2 -1
- package/src/fonts/local.ts +7 -3
- package/src/index.ts +35 -2
- package/src/plugins/build-report.ts +23 -3
- package/src/plugins/entries.ts +9 -4
- package/src/plugins/fonts.ts +171 -19
- package/src/plugins/mdx.ts +9 -5
- package/src/plugins/server-bundle.ts +4 -0
- package/src/server/access-gate.tsx +3 -2
- package/src/server/action-client.ts +15 -5
- package/src/server/debug.ts +137 -0
- package/src/server/deny-renderer.ts +3 -2
- package/src/server/dev-warnings.ts +2 -1
- package/src/server/html-injectors.ts +30 -10
- package/src/server/logger.ts +4 -3
- package/src/server/pipeline.ts +34 -20
- package/src/server/primitives.ts +2 -1
- package/src/server/request-context.ts +3 -2
- package/src/server/route-element-builder.ts +1 -6
- package/src/server/rsc-entry/index.ts +50 -7
- package/src/server/rsc-entry/rsc-payload.ts +42 -7
- package/src/server/rsc-entry/rsc-stream.ts +10 -5
- package/src/server/rsc-entry/ssr-renderer.ts +12 -5
- package/src/server/rsc-prop-warnings.ts +3 -1
- package/src/server/tracing.ts +23 -0
- package/src/server/waituntil-bridge.ts +4 -1
- package/dist/_chunks/format-DNt20Kt8.js.map +0 -1
- package/dist/_chunks/request-context-CRj2Zh1E.js.map +0 -1
|
@@ -39,7 +39,17 @@ interface RouteInfo {
|
|
|
39
39
|
segments: SegmentNode[];
|
|
40
40
|
entryFilePath: string | null;
|
|
41
41
|
}
|
|
42
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Walk the route tree and collect all leaf routes (pages + API endpoints).
|
|
44
|
+
*
|
|
45
|
+
* Parallel slots (`@artists`, `@shows`, etc.) are intentionally skipped —
|
|
46
|
+
* they render alongside the parent page at the same URL and are not
|
|
47
|
+
* separately URL-addressable. Their JS is captured in shared/layout chunks.
|
|
48
|
+
*
|
|
49
|
+
* After collection, entries are deduplicated by URL path so that overlapping
|
|
50
|
+
* route groups (e.g. `(browse)` and `(marketing)` both producing `/`) only
|
|
51
|
+
* appear once. The entry with the largest route-specific size wins.
|
|
52
|
+
*/
|
|
43
53
|
export declare function collectRoutes(tree: RouteTree): RouteInfo[];
|
|
44
54
|
/** Produce formatted report lines for the Vite logger. */
|
|
45
55
|
export declare function buildRouteReport(entries: RouteEntry[], sharedSize: number): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-report.d.ts","sourceRoot":"","sources":["../../src/plugins/build-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAU,MAAM,MAAM,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;CACvB;AAUD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,WAAW,EAAE,EACvB,UAAU,GAAE,QAAQ,GAAG,QAAmB,GACzC,SAAS,CAYX;AAID,OAAO,EAAE,UAAU,EAAE,CAAC;AAQtB,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED
|
|
1
|
+
{"version":3,"file":"build-report.d.ts","sourceRoot":"","sources":["../../src/plugins/build-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAU,MAAM,MAAM,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,MAAM,MAAM,SA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AS,CAAC,CAYjG;AAOD,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GACtC,MAAM,GAAG,IAAI,CAOf;AAwED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAwE5D"}
|
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import type { Plugin } from 'vite';
|
|
14
14
|
import type { PluginContext } from '#/index.js';
|
|
15
|
+
/**
|
|
16
|
+
* Detect the user's instrumentation.ts file at the project root.
|
|
17
|
+
*
|
|
18
|
+
* Checks for instrumentation.ts, .js, and .mjs — matching the same
|
|
19
|
+
* extensions as timber.config.ts detection.
|
|
20
|
+
*/
|
|
21
|
+
export declare function detectInstrumentationFile(root: string): string | null;
|
|
15
22
|
/**
|
|
16
23
|
* Generate the virtual:timber-instrumentation module source.
|
|
17
24
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../src/plugins/entries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../src/plugins/entries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA6GhD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAwBxF;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAwExD"}
|
package/dist/plugins/fonts.d.ts
CHANGED
|
@@ -56,10 +56,18 @@ export declare function parseGoogleFontImports(source: string): string[];
|
|
|
56
56
|
* e.g. { Inter: 'Inter', JetBrains_Mono: 'JetBrains Mono' }
|
|
57
57
|
*/
|
|
58
58
|
export declare function parseGoogleFontFamilies(source: string): Map<string, string>;
|
|
59
|
+
/**
|
|
60
|
+
* Generate CSS for a single extracted font.
|
|
61
|
+
*
|
|
62
|
+
* Includes @font-face rules (for local fonts), fallback @font-face,
|
|
63
|
+
* and the scoped class rule.
|
|
64
|
+
*/
|
|
65
|
+
export declare function generateFontCss(font: ExtractedFont): string;
|
|
59
66
|
/**
|
|
60
67
|
* Generate the CSS output for all extracted fonts.
|
|
61
68
|
*
|
|
62
|
-
* Includes @font-face rules, fallback @font-face rules,
|
|
69
|
+
* Includes @font-face rules for local fonts, fallback @font-face rules,
|
|
70
|
+
* and scoped classes.
|
|
63
71
|
*/
|
|
64
72
|
export declare function generateAllFontCss(registry: FontRegistry): string;
|
|
65
73
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../src/plugins/fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../src/plugins/fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAGlD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAmCxE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AA4CtD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAE7E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAE5F;AAUD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAkB/D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAqB3E;AAwED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAmB3D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAMjE;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKtE;AAqED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAwVtD"}
|
package/dist/plugins/mdx.d.ts
CHANGED
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { Plugin } from 'vite';
|
|
11
11
|
import type { PluginContext } from '#/index.js';
|
|
12
|
+
/**
|
|
13
|
+
* Check if mdx-components.tsx (or .ts, .jsx, .js) exists at the project root
|
|
14
|
+
* or in src/. Root takes precedence, matching Next.js behavior.
|
|
15
|
+
* Returns the absolute path if found, otherwise undefined.
|
|
16
|
+
*/
|
|
17
|
+
export declare function findMdxComponents(root: string): string | undefined;
|
|
12
18
|
/**
|
|
13
19
|
* Create the timber-mdx Vite plugin.
|
|
14
20
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../../src/plugins/mdx.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../../src/plugins/mdx.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAIhD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAelE;AA+BD;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA0GpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-bundle.d.ts","sourceRoot":"","sources":["../../src/plugins/server-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"server-bundle.d.ts","sourceRoot":"","sources":["../../src/plugins/server-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CA6H7C"}
|
package/dist/routing/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as DEFAULT_PAGE_EXTENSIONS, i as scanRoutes, n as generateRouteMap, o as INTERCEPTION_MARKERS, r as classifySegment, t as collectInterceptionRewrites } from "../_chunks/interception-
|
|
1
|
+
import { a as DEFAULT_PAGE_EXTENSIONS, i as scanRoutes, n as generateRouteMap, o as INTERCEPTION_MARKERS, r as classifySegment, t as collectInterceptionRewrites } from "../_chunks/interception-BOoWmLUA.js";
|
|
2
2
|
export { DEFAULT_PAGE_EXTENSIONS, INTERCEPTION_MARKERS, classifySegment, collectInterceptionRewrites, generateRouteMap, scanRoutes };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as registerSearchParams, n as useQueryStates, r as getSearchParams } from "../_chunks/use-query-states-
|
|
1
|
+
import { i as registerSearchParams, n as useQueryStates, r as getSearchParams } from "../_chunks/use-query-states-D5KaffOK.js";
|
|
2
2
|
//#region src/search-params/create.ts
|
|
3
3
|
/**
|
|
4
4
|
* createSearchParams — factory for SearchParamsDefinition<T>.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access-gate.d.ts","sourceRoot":"","sources":["../../src/server/access-gate.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"access-gate.d.ts","sourceRoot":"","sources":["../../src/server/access-gate.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAM5F;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAmBvF;AAoCD;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC,CAyCtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-client.d.ts","sourceRoot":"","sources":["../../src/server/action-client.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MAAM;IACnD,mDAAmD;IACnD,MAAM,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;CAC1F;AAED;;;;GAIG;AACH,MAAM,MAAM,QAAQ,CAAC,KAAK,IAAI;IAC5B,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAChD,CAAC,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;CAC3F,CAAC;AA2EF;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,CAqBrE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAC7D,MAAM,GAAE,kBAAkB,CAAC,IAAI,CAAM,GACpC,aAAa,CAAC,IAAI,CAAC,CAuGrB;AAID;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,KAAK,EACrC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,EAC5B,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,GACzC,QAAQ,CAAC,KAAK,CAAC,CAIjB"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime debug flag for timber.js.
|
|
3
|
+
*
|
|
4
|
+
* Two distinct functions for two distinct security levels:
|
|
5
|
+
*
|
|
6
|
+
* ## `isDebug()` — server-side logging only
|
|
7
|
+
*
|
|
8
|
+
* Returns true when timber's debug/warning messages should be written to
|
|
9
|
+
* stderr / the server console. This NEVER affects what is sent to the
|
|
10
|
+
* client (no error details, no timing headers, no stack traces).
|
|
11
|
+
*
|
|
12
|
+
* Active when any of:
|
|
13
|
+
* - `NODE_ENV !== 'production'` (standard dev mode)
|
|
14
|
+
* - `TIMBER_DEBUG` env var is set to a truthy value at runtime
|
|
15
|
+
* - `timber.config.ts` has `debug: true`
|
|
16
|
+
*
|
|
17
|
+
* ## `isDevMode()` — client-visible dev behavior
|
|
18
|
+
*
|
|
19
|
+
* Returns true ONLY when `NODE_ENV !== 'production'`. This gates anything
|
|
20
|
+
* that changes what clients can observe:
|
|
21
|
+
* - Dev error pages with stack traces (fallback-error.ts)
|
|
22
|
+
* - Detailed Server-Timing headers (pipeline.ts)
|
|
23
|
+
* - Error messages in action INTERNAL_ERROR payloads (action-client.ts)
|
|
24
|
+
* - Pipeline error handler wiring (Vite overlay)
|
|
25
|
+
*
|
|
26
|
+
* `isDevMode()` is statically replaced in production builds → the guarded
|
|
27
|
+
* code is tree-shaken to zero bytes. TIMBER_DEBUG cannot enable it.
|
|
28
|
+
*
|
|
29
|
+
* Usage:
|
|
30
|
+
* In Cloudflare Workers wrangler.toml:
|
|
31
|
+
* [vars]
|
|
32
|
+
* TIMBER_DEBUG = "1"
|
|
33
|
+
*
|
|
34
|
+
* In Node.js:
|
|
35
|
+
* TIMBER_DEBUG=1 node server.js
|
|
36
|
+
*
|
|
37
|
+
* In timber.config.ts:
|
|
38
|
+
* export default { debug: true }
|
|
39
|
+
*
|
|
40
|
+
* See design/13-security.md for the security taxonomy.
|
|
41
|
+
* See design/18-build-system.md for build pipeline details.
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* Check if the application is running in development mode.
|
|
45
|
+
*
|
|
46
|
+
* This is the ONLY function that should gate client-visible dev behavior:
|
|
47
|
+
* - Dev error pages with stack traces
|
|
48
|
+
* - Server-Timing mode default (`'detailed'` in dev, `'total'` in prod)
|
|
49
|
+
* - Error messages in action `INTERNAL_ERROR` payloads
|
|
50
|
+
* - Pipeline error handler wiring (Vite overlay)
|
|
51
|
+
*
|
|
52
|
+
* Returns `process.env.NODE_ENV !== 'production'`, which is statically
|
|
53
|
+
* replaced by the bundler in production builds. Code guarded by this
|
|
54
|
+
* function is tree-shaken to zero bytes in production.
|
|
55
|
+
*
|
|
56
|
+
* TIMBER_DEBUG does NOT enable this — that would leak server internals
|
|
57
|
+
* to clients. Use `isDebug()` for server-side-only logging.
|
|
58
|
+
*/
|
|
59
|
+
export declare function isDevMode(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Set the debug flag from timber.config.ts.
|
|
62
|
+
* Called during handler initialization.
|
|
63
|
+
*/
|
|
64
|
+
export declare function setDebugFromConfig(debug: boolean): void;
|
|
65
|
+
/**
|
|
66
|
+
* Check if timber debug logging is active (server-side only).
|
|
67
|
+
*
|
|
68
|
+
* Returns true if ANY of these conditions hold:
|
|
69
|
+
* - NODE_ENV is not 'production' (standard dev mode)
|
|
70
|
+
* - TIMBER_DEBUG environment variable is set to a truthy value at runtime
|
|
71
|
+
* - timber.config.ts has `debug: true`
|
|
72
|
+
*
|
|
73
|
+
* This function controls ONLY server-side logging — messages written to
|
|
74
|
+
* stderr or the server console. It NEVER affects client-visible behavior
|
|
75
|
+
* (error pages, response headers, action payloads). For client-visible
|
|
76
|
+
* behavior, use `isDevMode()`.
|
|
77
|
+
*
|
|
78
|
+
* The TIMBER_DEBUG check is deliberately written as a dynamic property
|
|
79
|
+
* access so bundlers cannot statically replace it.
|
|
80
|
+
*/
|
|
81
|
+
export declare function isDebug(): boolean;
|
|
82
|
+
//# sourceMappingURL=debug.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/server/debug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAIH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAUD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAEvD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,IAAI,OAAO,CAYjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deny-renderer.d.ts","sourceRoot":"","sources":["../../src/server/deny-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"deny-renderer.d.ts","sourceRoot":"","sources":["../../src/server/deny-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAK7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAMjE,qDAAqD;AACrD,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;IAC3C,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED,iEAAiE;AACjE,MAAM,MAAM,mBAAmB,GAAG,MAAM;IACtC,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF,6DAA6D;AAC7D,MAAM,MAAM,SAAS,GAAG,CACtB,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,EACrC,UAAU,EAAE,UAAU,KACnB,OAAO,CAAC,QAAQ,CAAC,CAAC;AAUvB;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,UAAU,EAChB,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,sBAAsB,EAAE,mBAAmB,EAC3C,OAAO,EAAE,SAAS,GACjB,OAAO,CAAC,QAAQ,CAAC,CA6GnB;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,gBAAgB,EAAE,WAAW,EAAE,EAC/B,eAAe,EAAE,OAAO,EACxB,sBAAsB,EAAE,mBAAmB,GAC1C,OAAO,CAAC,QAAQ,CAAC,CAgDnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-warnings.d.ts","sourceRoot":"","sources":["../../src/server/dev-warnings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"dev-warnings.d.ts","sourceRoot":"","sources":["../../src/server/dev-warnings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAK1C,eAAO,MAAM,SAAS;;;;;;;;CAQZ,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAInE,8CAA8C;AAC9C,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AASD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI,CAEhE;AA0CD;;;;;;;;;GASG;AACH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injectors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAiEH;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,EAClC,QAAQ,EAAE,MAAM,GACf,cAAc,CAAC,UAAU,CAAC,CAE5B;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,EAClC,WAAW,EAAE,MAAM,GAClB,cAAc,CAAC,UAAU,CAAC,CAE5B;AAkBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,GACpC,cAAc,CAAC,UAAU,CAAC,CA4B5B;
|
|
1
|
+
{"version":3,"file":"html-injectors.d.ts","sourceRoot":"","sources":["../../src/server/html-injectors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAiEH;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,EAClC,QAAQ,EAAE,MAAM,GACf,cAAc,CAAC,UAAU,CAAC,CAE5B;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,EAClC,WAAW,EAAE,MAAM,GAClB,cAAc,CAAC,UAAU,CAAC,CAE5B;AAkBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,GACpC,cAAc,CAAC,UAAU,CAAC,CA4B5B;AA6JD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,cAAc,CAAC,UAAU,CAAC,EACtC,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,SAAS,GAChD,cAAc,CAAC,UAAU,CAAC,CAS5B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,qBAAqB;IACpC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;CACtB;AAqBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,cAAc,EAAE,OAAO,CAAA;KAAE,CAAC;IACjE,GAAG,EAAE,OAAO,CAAC;IACb,aAAa,CAAC,EAAE,OAAO,qBAAqB,EAAE,aAAa,CAAC;CAC7D,GAAG,qBAAqB,CA8DxB"}
|
package/dist/server/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
5
|
-
import { a as
|
|
1
|
+
import { n as isDevMode, t as isDebug } from "../_chunks/debug-B3Gypr3D.js";
|
|
2
|
+
import { a as warnDenyAfterFlush, c as warnRedirectInAccess, d as warnSlowSlotWithoutSuspense, f as warnStaticRequestApi, i as warnCacheRequestProps, l as warnRedirectInSlotAccess, n as WarningId, o as warnDenyInSuspense, p as warnSuspenseWrappingChildren, r as setViteServer, s as warnDynamicApiInStaticBuild, t as formatSize, u as warnRedirectInSuspense } from "../_chunks/format-RyoGQL74.js";
|
|
3
|
+
import { i as getMetadataRouteServePath, n as classifyMetadataRoute, r as getMetadataRouteAutoLink, t as METADATA_ROUTE_CONVENTIONS } from "../_chunks/metadata-routes-Cjmvi3rQ.js";
|
|
4
|
+
import { a as timingAls, i as revalidationAls, n as formFlashAls, s as waitUntilAls, t as earlyHintsSenderAls } from "../_chunks/als-registry-B7DbZ2hS.js";
|
|
5
|
+
import { a as markResponseFlushed, c as setCookieSecrets, i as headers, l as setMutableCookieContext, n as cookies, o as runWithRequestContext, r as getSetCookieHeaders, s as searchParams, t as applyRequestHeaderOverlay, u as setParsedSearchParams } from "../_chunks/request-context-BQUC8PHn.js";
|
|
6
|
+
import { a as getTraceStore, c as setSpanAttribute, d as withSpan, i as getOtelTraceId, l as spanId, o as replaceTraceId, r as generateTraceId, s as runWithTraceId, t as addSpanEvent, u as traceId } from "../_chunks/tracing-CemImE6h.js";
|
|
6
7
|
import { readFile } from "node:fs/promises";
|
|
7
8
|
//#region src/server/waituntil-bridge.ts
|
|
8
9
|
/**
|
|
@@ -72,7 +73,7 @@ function findNonSerializable(value, path = "data") {
|
|
|
72
73
|
* No-op in production.
|
|
73
74
|
*/
|
|
74
75
|
function warnIfNotSerializable(data, callerName) {
|
|
75
|
-
if (
|
|
76
|
+
if (!isDebug()) return;
|
|
76
77
|
if (data === void 0) return;
|
|
77
78
|
const issue = findNonSerializable(data);
|
|
78
79
|
if (issue) console.warn(`[timber] ${callerName}: ${issue}. Data passed to deny() or RenderError must be JSON-serializable because the post-flush path uses JSON.stringify, not React Flight.`);
|
|
@@ -603,17 +604,17 @@ function logMiddlewareShortCircuit(data) {
|
|
|
603
604
|
/** Log unhandled error in middleware phase. Level: error. */
|
|
604
605
|
function logMiddlewareError(data) {
|
|
605
606
|
if (_logger) _logger.error("unhandled error in middleware phase", withTraceContext(data));
|
|
606
|
-
else if (
|
|
607
|
+
else if (isDebug()) console.error("[timber] middleware error", data.error);
|
|
607
608
|
}
|
|
608
609
|
/** Log unhandled render-phase error. Level: error. */
|
|
609
610
|
function logRenderError(data) {
|
|
610
611
|
if (_logger) _logger.error("unhandled render-phase error", withTraceContext(data));
|
|
611
|
-
else if (
|
|
612
|
+
else if (isDebug()) console.error("[timber] render error:", formatSsrError(data.error));
|
|
612
613
|
}
|
|
613
614
|
/** Log proxy.ts uncaught error. Level: error. */
|
|
614
615
|
function logProxyError(data) {
|
|
615
616
|
if (_logger) _logger.error("proxy.ts threw uncaught error", withTraceContext(data));
|
|
616
|
-
else if (
|
|
617
|
+
else if (isDebug()) console.error("[timber] proxy error", data.error);
|
|
617
618
|
}
|
|
618
619
|
/** Log waitUntil() adapter missing (once at startup). Level: warn. */
|
|
619
620
|
function logWaitUntilUnsupported() {
|
|
@@ -818,7 +819,7 @@ function pathnameMatchesPattern(pathname, pattern) {
|
|
|
818
819
|
* and produces a Response. This is the top-level entry point for the server.
|
|
819
820
|
*/
|
|
820
821
|
function createPipeline(config) {
|
|
821
|
-
const { proxy, matchRoute, render, earlyHints, stripTrailingSlash = true, slowRequestMs = 3e3,
|
|
822
|
+
const { proxy, matchRoute, render, earlyHints, stripTrailingSlash = true, slowRequestMs = 3e3, serverTiming = "total", onPipelineError } = config;
|
|
822
823
|
let activeRequests = 0;
|
|
823
824
|
return async (req) => {
|
|
824
825
|
const url = new URL(req.url);
|
|
@@ -843,13 +844,13 @@ function createPipeline(config) {
|
|
|
843
844
|
if (proxy || config.proxyLoader) result = await runProxyPhase(req, method, path);
|
|
844
845
|
else result = await handleRequest(req, method, path);
|
|
845
846
|
await setSpanAttribute("http.response.status_code", result.status);
|
|
846
|
-
if (
|
|
847
|
-
const
|
|
848
|
-
if (
|
|
847
|
+
if (serverTiming === "detailed") {
|
|
848
|
+
const timingHeader = getServerTimingHeader();
|
|
849
|
+
if (timingHeader) {
|
|
849
850
|
result = ensureMutableResponse(result);
|
|
850
|
-
result.headers.set("Server-Timing",
|
|
851
|
+
result.headers.set("Server-Timing", timingHeader);
|
|
851
852
|
}
|
|
852
|
-
} else {
|
|
853
|
+
} else if (serverTiming === "total") {
|
|
853
854
|
const totalMs = Math.round(performance.now() - startTime);
|
|
854
855
|
result = ensureMutableResponse(result);
|
|
855
856
|
result.headers.set("Server-Timing", `total;dur=${totalMs}`);
|
|
@@ -876,7 +877,7 @@ function createPipeline(config) {
|
|
|
876
877
|
});
|
|
877
878
|
return response;
|
|
878
879
|
};
|
|
879
|
-
return
|
|
880
|
+
return serverTiming === "detailed" ? runWithTimingCollector(runRequest) : runRequest();
|
|
880
881
|
});
|
|
881
882
|
});
|
|
882
883
|
};
|
|
@@ -886,7 +887,7 @@ function createPipeline(config) {
|
|
|
886
887
|
if (config.proxyLoader) proxyExport = (await config.proxyLoader()).default;
|
|
887
888
|
else proxyExport = config.proxy;
|
|
888
889
|
const proxyFn = () => runProxy(proxyExport, req, () => handleRequest(req, method, path));
|
|
889
|
-
return await withSpan("timber.proxy", {}, () =>
|
|
890
|
+
return await withSpan("timber.proxy", {}, () => serverTiming === "detailed" ? withTiming("proxy", "proxy.ts", proxyFn) : proxyFn());
|
|
890
891
|
} catch (error) {
|
|
891
892
|
logProxyError({ error });
|
|
892
893
|
await fireOnRequestError(error, req, "proxy");
|
|
@@ -972,7 +973,7 @@ function createPipeline(config) {
|
|
|
972
973
|
try {
|
|
973
974
|
setMutableCookieContext(true);
|
|
974
975
|
const middlewareFn = () => runMiddleware(match.middleware, ctx);
|
|
975
|
-
const middlewareResponse = await withSpan("timber.middleware", {}, () =>
|
|
976
|
+
const middlewareResponse = await withSpan("timber.middleware", {}, () => serverTiming === "detailed" ? withTiming("mw", "middleware.ts", middlewareFn) : middlewareFn());
|
|
976
977
|
setMutableCookieContext(false);
|
|
977
978
|
if (middlewareResponse) {
|
|
978
979
|
const finalResponse = ensureMutableResponse(middlewareResponse);
|
|
@@ -1016,12 +1017,19 @@ function createPipeline(config) {
|
|
|
1016
1017
|
applyCookieJar(responseHeaders);
|
|
1017
1018
|
try {
|
|
1018
1019
|
const renderFn = () => render(req, match, responseHeaders, requestHeaderOverlay, interception);
|
|
1019
|
-
const response = await withSpan("timber.render", { "http.route": canonicalPathname }, () =>
|
|
1020
|
+
const response = await withSpan("timber.render", { "http.route": canonicalPathname }, () => serverTiming === "detailed" ? withTiming("render", "RSC + SSR render", renderFn) : renderFn());
|
|
1020
1021
|
markResponseFlushed();
|
|
1021
1022
|
return response;
|
|
1022
1023
|
} catch (error) {
|
|
1023
1024
|
if (error instanceof DenySignal) return new Response(null, { status: error.status });
|
|
1024
1025
|
if (error instanceof RedirectSignal) {
|
|
1026
|
+
if ((req.headers.get("Accept") ?? "").includes("text/x-component")) {
|
|
1027
|
+
responseHeaders.set("X-Timber-Redirect", error.location);
|
|
1028
|
+
return new Response(null, {
|
|
1029
|
+
status: 204,
|
|
1030
|
+
headers: responseHeaders
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1025
1033
|
responseHeaders.set("Location", error.location);
|
|
1026
1034
|
return new Response(null, {
|
|
1027
1035
|
status: error.status,
|
|
@@ -1503,10 +1511,10 @@ async function SlotAccessGate(props) {
|
|
|
1503
1511
|
} catch (error) {
|
|
1504
1512
|
if (error instanceof DenySignal) return deniedFallback ?? defaultFallback ?? null;
|
|
1505
1513
|
if (error instanceof RedirectSignal) {
|
|
1506
|
-
if (
|
|
1514
|
+
if (isDebug()) console.error("[timber] redirect() is not allowed in slot access.ts. Slots use deny() for graceful degradation — denied.tsx → default.tsx → null. If you need to redirect, move the logic to the parent segment's access.ts.");
|
|
1507
1515
|
return deniedFallback ?? defaultFallback ?? null;
|
|
1508
1516
|
}
|
|
1509
|
-
if (
|
|
1517
|
+
if (isDebug()) console.warn("[timber] Unhandled error in slot access.ts. Use deny() for access control, not unhandled throws.", error);
|
|
1510
1518
|
throw error;
|
|
1511
1519
|
}
|
|
1512
1520
|
return children;
|
|
@@ -2791,7 +2799,7 @@ function handleActionError(error) {
|
|
|
2791
2799
|
} };
|
|
2792
2800
|
return { serverError: {
|
|
2793
2801
|
code: "INTERNAL_ERROR",
|
|
2794
|
-
...
|
|
2802
|
+
...isDevMode() && error instanceof Error ? { data: { message: error.message } } : {}
|
|
2795
2803
|
} };
|
|
2796
2804
|
}
|
|
2797
2805
|
/**
|
|
@@ -2821,6 +2829,7 @@ function createActionClient(config = {}) {
|
|
|
2821
2829
|
const ctx = await runActionMiddleware(config.middleware);
|
|
2822
2830
|
let rawInput;
|
|
2823
2831
|
if (args.length === 2 && args[1] instanceof FormData) rawInput = schema ? parseFormData(args[1]) : args[1];
|
|
2832
|
+
else if (args.length === 1 && args[0] instanceof FormData) rawInput = schema ? parseFormData(args[0]) : args[0];
|
|
2824
2833
|
else rawInput = args[0];
|
|
2825
2834
|
if (config.fileSizeLimit !== void 0 && rawInput && typeof rawInput === "object") {
|
|
2826
2835
|
const fileSizeErrors = validateFileSizes(rawInput, config.fileSizeLimit);
|
|
@@ -2912,7 +2921,7 @@ function validated(schema, handler) {
|
|
|
2912
2921
|
* In production, validation errors are only returned to the client.
|
|
2913
2922
|
*/
|
|
2914
2923
|
function logValidationFailure(errors) {
|
|
2915
|
-
if (!(
|
|
2924
|
+
if (!isDebug()) return;
|
|
2916
2925
|
const fields = Object.entries(errors).map(([field, messages]) => ` ${field}: ${messages.join(", ")}`).join("\n");
|
|
2917
2926
|
console.warn(`[timber] action schema validation failed:\n${fields}`);
|
|
2918
2927
|
}
|