@timber-js/app 0.2.0-alpha.116 → 0.2.0-alpha.118
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-DAVm0FQe.js → actions-Cw-7NfJJ.js} +8 -1
- package/dist/_chunks/actions-Cw-7NfJJ.js.map +1 -0
- package/dist/_chunks/{resolve-schema-DO8B0mO9.js → resolve-schema-23Mc8aLi.js} +1 -1
- package/dist/_chunks/{resolve-schema-DO8B0mO9.js.map → resolve-schema-23Mc8aLi.js.map} +1 -1
- package/dist/_chunks/{segment-context-EsfQpS--.js → segment-context-Bg0pFbLT.js} +1 -1
- package/dist/_chunks/{segment-context-EsfQpS--.js.map → segment-context-Bg0pFbLT.js.map} +1 -1
- package/dist/_chunks/tracing-DvKLzCFa.js.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/internal.js +1 -1
- package/dist/fonts/virtual-modules.d.ts +0 -9
- package/dist/fonts/virtual-modules.d.ts.map +1 -1
- package/dist/index.js +9 -2
- package/dist/index.js.map +1 -1
- package/dist/params/index.js +1 -1
- package/dist/plugins/fonts.d.ts.map +1 -1
- package/dist/server/als-registry.d.ts +12 -0
- package/dist/server/als-registry.d.ts.map +1 -1
- package/dist/server/html-injector-core.d.ts +2 -1
- package/dist/server/html-injector-core.d.ts.map +1 -1
- package/dist/server/html-injectors.d.ts +1 -1
- package/dist/server/html-injectors.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/internal.js +68 -67
- package/dist/server/internal.js.map +1 -1
- package/dist/server/node-stream-transforms.d.ts +2 -0
- package/dist/server/node-stream-transforms.d.ts.map +1 -1
- package/dist/server/param-coercion.d.ts +18 -0
- package/dist/server/param-coercion.d.ts.map +1 -1
- package/dist/server/pipeline-phases.d.ts.map +1 -1
- package/dist/server/pipeline.d.ts +7 -0
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/request-context.d.ts +9 -0
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/route-element-builder.d.ts.map +1 -1
- package/dist/server/route-matcher.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-stream.d.ts +3 -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/slot-resolver.d.ts +1 -1
- package/dist/server/slot-resolver.d.ts.map +1 -1
- package/dist/server/ssr-entry.d.ts +7 -0
- package/dist/server/ssr-entry.d.ts.map +1 -1
- package/dist/server/tree-match.d.ts +41 -0
- package/dist/server/tree-match.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/fonts/virtual-modules.ts +8 -2
- package/src/plugins/fonts.ts +2 -0
- package/src/server/als-registry.ts +12 -0
- package/src/server/html-injector-core.ts +15 -1
- package/src/server/html-injectors.ts +6 -4
- package/src/server/node-stream-transforms.ts +3 -1
- package/src/server/param-coercion.ts +58 -0
- package/src/server/pipeline-phases.ts +5 -0
- package/src/server/pipeline.ts +7 -0
- package/src/server/request-context.ts +31 -0
- package/src/server/route-element-builder.ts +12 -2
- package/src/server/route-matcher.ts +8 -168
- package/src/server/rsc-entry/rsc-stream.ts +4 -0
- package/src/server/rsc-entry/ssr-renderer.ts +16 -0
- package/src/server/slot-resolver.ts +79 -112
- package/src/server/ssr-entry.ts +15 -1
- package/src/server/tree-match.ts +198 -0
- package/dist/_chunks/actions-DAVm0FQe.js.map +0 -1
|
@@ -68,6 +68,8 @@ export interface NodeFlightInjectorOptions {
|
|
|
68
68
|
* Default: 30000 (30s).
|
|
69
69
|
*/
|
|
70
70
|
renderTimeoutMs?: number;
|
|
71
|
+
/** Signal that fires when an unhandled RSC error is detected. */
|
|
72
|
+
errorSignal?: AbortSignal;
|
|
71
73
|
}
|
|
72
74
|
/**
|
|
73
75
|
* Node.js `Transform` that merges RSC script tags into the HTML stream.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-stream-transforms.d.ts","sourceRoot":"","sources":["../../src/server/node-stream-transforms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAGL,YAAY,EAOb,MAAM,yBAAyB,CAAC;AAMjC,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CACvC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,4BAAiC,GAAG,SAAS,CA2BjG;AAID;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,IAAI,SAAS,CAoBzD;AAGD,OAAO,EAAE,YAAY,EAAE,CAAC;AAIxB;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CA2BlE;AAID;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"node-stream-transforms.d.ts","sourceRoot":"","sources":["../../src/server/node-stream-transforms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAGL,YAAY,EAOb,MAAM,yBAAyB,CAAC;AAMjC,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CACvC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,4BAAiC,GAAG,SAAS,CA2BjG;AAID;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,IAAI,SAAS,CAoBzD;AAGD,OAAO,EAAE,YAAY,EAAE,CAAC;AAIxB;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CA2BlE;AAID;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,SAAS,EACjD,OAAO,CAAC,EAAE,yBAAyB,GAClC,SAAS,CA6DX;AAOD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAwBtE;AAmBD;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,OAAO,EACvB,eAAe,EAAE,OAAO,GACvB,SAAS,GAAG,IAAI,CA8BlB"}
|
|
@@ -19,6 +19,24 @@ import type { RouteMatch } from './pipeline.js';
|
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
21
|
export declare function setGlobalSchemaCodecs(codecs: Record<string, Codec<unknown>> | null): void;
|
|
22
|
+
/**
|
|
23
|
+
* Coerce raw slot params through global schema codecs.
|
|
24
|
+
*
|
|
25
|
+
* Each slot segment that has a paramName is looked up in the global codec
|
|
26
|
+
* map by its bracket key (e.g. '[...year]' for catch-all). If a codec
|
|
27
|
+
* exists, the raw value is parsed through it. If no codec exists or no
|
|
28
|
+
* global codecs are registered, the raw value passes through unchanged.
|
|
29
|
+
*
|
|
30
|
+
* Unlike main route coercion, this does NOT throw ParamCoercionError on
|
|
31
|
+
* failure — slots degrade gracefully. A failed coercion logs a warning
|
|
32
|
+
* in dev mode and keeps the raw value.
|
|
33
|
+
*
|
|
34
|
+
* @internal — framework use only
|
|
35
|
+
*/
|
|
36
|
+
export declare function coerceSlotParams(slotChain: Array<{
|
|
37
|
+
segmentType: string;
|
|
38
|
+
paramName?: string;
|
|
39
|
+
}>, rawParams: Record<string, string | string[]>): Record<string, string | string[]>;
|
|
22
40
|
/**
|
|
23
41
|
* Run segment param coercion on the matched route's segments.
|
|
24
42
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"param-coercion.d.ts","sourceRoot":"","sources":["../../src/server/param-coercion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAahD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAEzF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAgG1E"}
|
|
1
|
+
{"version":3,"file":"param-coercion.d.ts","sourceRoot":"","sources":["../../src/server/param-coercion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAahD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAEzF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,KAAK,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EAC7D,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,GAC3C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAuCnC;AAED;;;;;;;;;;;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Aa,CACjC,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,QAAQ,CAAC,CAiQnB"}
|
|
@@ -32,6 +32,13 @@ export interface RouteMatch {
|
|
|
32
32
|
segments: ManifestSegmentNode[];
|
|
33
33
|
/** Extracted segment params (catch-all segments produce string[]). */
|
|
34
34
|
segmentParams: Record<string, string | string[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Raw segment params before codec coercion. Always string or string[].
|
|
37
|
+
* Used by slot resolution to reconstruct URL parts — coerced params may
|
|
38
|
+
* have been transformed by codecs and are unsuitable for URL matching.
|
|
39
|
+
* Set by the pipeline before coercion runs.
|
|
40
|
+
*/
|
|
41
|
+
rawSegmentParams?: Record<string, string | string[]>;
|
|
35
42
|
/** Middleware chain from the segment tree, ordered root-to-leaf. */
|
|
36
43
|
middlewareChain: MiddlewareFn[];
|
|
37
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/server/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAY3D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAO9D;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,mDAAmD;IACnD,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,sEAAsE;IACtE,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IACjD,oEAAoE;IACpE,eAAe,EAAE,YAAY,EAAE,CAAC;CACjC;AAED,6DAA6D;AAC7D,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AAE,mBAAmB,EAAE,CAAC;IAClF;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,KAAK,CAAC;IAC5C;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IACpE;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAExD;;;;;;;;;;;;OAYG;IACH,uBAAuB,CAAC,EAAE,CACxB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,eAAe,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;KAAE,CAAC,KACnF,IAAI,CAAC;IAEV;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,EAAE,CACpB,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,OAAO,KACrB,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClC;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,CACnB,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,OAAO;IACxB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,UAAU,KACf,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACnC;AAID;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAmG1F"}
|
|
@@ -57,6 +57,15 @@ export declare function getSegmentParams(segmentPath?: string): Record<string, s
|
|
|
57
57
|
* @internal — framework use only
|
|
58
58
|
*/
|
|
59
59
|
export declare function setSegmentParams(params: Record<string, string | string[]>): void;
|
|
60
|
+
/**
|
|
61
|
+
* Store per-slot coerced segment params in the current request context.
|
|
62
|
+
* Called by the route element builder when resolving parallel slots.
|
|
63
|
+
*
|
|
64
|
+
* @param segmentPath — The slot's full tree path (e.g. '/(browse)/@shows/[artistSlug]/[...year]')
|
|
65
|
+
* @param params — The slot's coerced segment params
|
|
66
|
+
* @internal — framework use only
|
|
67
|
+
*/
|
|
68
|
+
export declare function setSlotParams(segmentPath: string, params: Record<string, string | string[]>): void;
|
|
60
69
|
/**
|
|
61
70
|
* Store the matched segment path (e.g. '/(browse)/[artistSlug]/[year]') for
|
|
62
71
|
* dev-mode validation in getSegmentParams().
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/server/request-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,iBAAiB,EAA4B,MAAM,mBAAmB,CAAC;AAOhF,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAQ7B;;;;;GAKG;AACH,wBAAgB,UAAU,IAAI,eAAe,CAS5C;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG1D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,eAAe,CASjD;AAaD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/server/request-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,iBAAiB,EAA4B,MAAM,mBAAmB,CAAC;AAOhF,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAQ7B;;;;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C,QAAQ,EAAE,YAAY,GACrB,CAAC,QAAQ,EAAE,MAAM,KAAK,kBAAkB,GAAG,IAAI,CAMjD"}
|
|
@@ -40,6 +40,9 @@ export interface RenderSignals {
|
|
|
40
40
|
lastUnhandledError: unknown | null;
|
|
41
41
|
/** Callback fired when a redirect or deny signal is captured in onError. */
|
|
42
42
|
onSignal?: () => void;
|
|
43
|
+
/** Callback fired when an unhandled error (non-signal) is captured. Used
|
|
44
|
+
* to halt Flight data injection into the inline stream. */
|
|
45
|
+
onUnhandledError?: () => void;
|
|
43
46
|
}
|
|
44
47
|
export interface RscStreamResult {
|
|
45
48
|
rscStream: ReadableStream<Uint8Array> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc-stream.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/rsc-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAe,MAAM,kBAAkB,CAAC;AAG3E,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAC;AAItB;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,WAAW,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACvD;;;;;;;;OAQG;IACH,kBAAkB,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"rsc-stream.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/rsc-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAe,MAAM,kBAAkB,CAAC;AAG3E,OAA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AgC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAiB,CAAC;AAEhF,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;IACzB,wDAAwD;IACxD,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAiSjF"}
|
|
@@ -29,6 +29,6 @@ type CreateElementFn = (...args: unknown[]) => React.ReactElement;
|
|
|
29
29
|
* 2. Layouts from each segment in the slot's matched chain
|
|
30
30
|
* 3. SlotAccessGate if the slot root has access.ts
|
|
31
31
|
*/
|
|
32
|
-
export declare function resolveSlotElement(slotNode: ManifestSegmentNode, match: RouteMatch, h: CreateElementFn, interception?: InterceptionContext): Promise<React.ReactElement | null>;
|
|
32
|
+
export declare function resolveSlotElement(slotNode: ManifestSegmentNode, match: RouteMatch, h: CreateElementFn, interception?: InterceptionContext, parentTreePath?: string): Promise<React.ReactElement | null>;
|
|
33
33
|
export {};
|
|
34
34
|
//# sourceMappingURL=slot-resolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slot-resolver.d.ts","sourceRoot":"","sources":["../../src/server/slot-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"slot-resolver.d.ts","sourceRoot":"","sources":["../../src/server/slot-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAK9D,KAAK,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,KAAK,CAAC,YAAY,CAAC;AAgClE;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,EAAE,UAAU,EACjB,CAAC,EAAE,eAAe,EAClB,YAAY,CAAC,EAAE,mBAAmB,EAClC,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,CAgHpC"}
|
|
@@ -76,6 +76,13 @@ export interface NavContext {
|
|
|
76
76
|
/** Whether the Node.js native stream path was used */
|
|
77
77
|
nodeStreams: boolean;
|
|
78
78
|
};
|
|
79
|
+
/**
|
|
80
|
+
* Signal that fires when an unhandled RSC error is detected.
|
|
81
|
+
* The Flight injector checks this before writing each script tag —
|
|
82
|
+
* when aborted, it stops injecting Flight data to prevent corrupted
|
|
83
|
+
* chunks from crashing the client's Flight decoder.
|
|
84
|
+
*/
|
|
85
|
+
_errorSignal?: AbortSignal;
|
|
79
86
|
}
|
|
80
87
|
/**
|
|
81
88
|
* Handle SSR: decode an RSC stream and render it to hydration-ready HTML.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-entry.d.ts","sourceRoot":"","sources":["../../src/server/ssr-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG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Ac,CAAC,UAAU,CAAC,EACrC,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,QAAQ,CAAC,CA6LnB;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared URL-matching tree walker for segment trees.
|
|
3
|
+
*
|
|
4
|
+
* Both the main route matcher (`route-matcher.ts`) and slot resolver
|
|
5
|
+
* (`slot-resolver.ts`) need to walk a SegmentNode tree, matching URL
|
|
6
|
+
* parts against children with the same priority semantics:
|
|
7
|
+
*
|
|
8
|
+
* static > dynamic > catch-all > optional-catch-all
|
|
9
|
+
*
|
|
10
|
+
* Before this module, each had its own walker with subtle divergences
|
|
11
|
+
* (different group handling, missing backtracking, incomplete
|
|
12
|
+
* optional-catch-all support). This shared walker is the single
|
|
13
|
+
* source of truth for URL-to-segment matching.
|
|
14
|
+
*
|
|
15
|
+
* See design/07-routing.md §"Request Lifecycle" and TIM-940.
|
|
16
|
+
*/
|
|
17
|
+
import type { SegmentNode } from '../routing/types.js';
|
|
18
|
+
/** Result of matching URL parts against a segment tree. */
|
|
19
|
+
export interface TreeMatchResult<TFile> {
|
|
20
|
+
/** Matched segment chain from root to leaf, inclusive. */
|
|
21
|
+
chain: SegmentNode<TFile>[];
|
|
22
|
+
/** Collected params, keyed by param name. Catch-all params are string[]. */
|
|
23
|
+
params: Record<string, string | string[]>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Match URL path parts against a segment tree.
|
|
27
|
+
*
|
|
28
|
+
* Walks the tree depth-first with backtracking, applying priority
|
|
29
|
+
* ordering globally across group boundaries. Returns the matched
|
|
30
|
+
* segment chain and collected params, or null if no route matches.
|
|
31
|
+
*
|
|
32
|
+
* A match requires a terminal node (one with `page` or `route`) at
|
|
33
|
+
* the leaf. Catch-all and optional-catch-all segments only match if
|
|
34
|
+
* they are terminal.
|
|
35
|
+
*
|
|
36
|
+
* @param root The root segment node to start matching from.
|
|
37
|
+
* @param parts URL path parts (e.g. ['blog', 'hello-world']).
|
|
38
|
+
* Empty array matches the root itself (if terminal).
|
|
39
|
+
*/
|
|
40
|
+
export declare function matchUrlParts<TFile>(root: SegmentNode<TFile>, parts: string[]): TreeMatchResult<TFile> | null;
|
|
41
|
+
//# sourceMappingURL=tree-match.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-match.d.ts","sourceRoot":"","sources":["../../src/server/tree-match.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIvD,2DAA2D;AAC3D,MAAM,WAAW,eAAe,CAAC,KAAK;IACpC,0DAA0D;IAC1D,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;IAC5B,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;CAC3C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,KAAK,EACjC,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,EACxB,KAAK,EAAE,MAAM,EAAE,GACd,eAAe,CAAC,KAAK,CAAC,GAAG,IAAI,CAQ/B"}
|
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.118",
|
|
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",
|
|
@@ -59,6 +59,12 @@ export const RESOLVED_FONT_CSS_PREFIX = '\0' + VIRTUAL_FONT_CSS_PREFIX;
|
|
|
59
59
|
* Scoped to a single `FontPipeline` instance to avoid cross-plugin-
|
|
60
60
|
* instance collisions during multi-build pipelines.
|
|
61
61
|
*/
|
|
62
|
+
function stripIdDecorations(id: string): string {
|
|
63
|
+
const bare = id.startsWith('\0') ? id.slice(1) : id;
|
|
64
|
+
const qIdx = bare.indexOf('?');
|
|
65
|
+
return qIdx === -1 ? bare : bare.slice(0, qIdx);
|
|
66
|
+
}
|
|
67
|
+
|
|
62
68
|
export class VirtualFontCssIdMap {
|
|
63
69
|
private readonly map = new Map<string, string>();
|
|
64
70
|
|
|
@@ -75,7 +81,7 @@ export class VirtualFontCssIdMap {
|
|
|
75
81
|
|
|
76
82
|
/** Decode the importer from a resolved (or unresolved) virtual css id. */
|
|
77
83
|
importerFor(id: string): string | undefined {
|
|
78
|
-
const body =
|
|
84
|
+
const body = stripIdDecorations(id);
|
|
79
85
|
if (!body.startsWith(VIRTUAL_FONT_CSS_PREFIX)) return undefined;
|
|
80
86
|
if (!body.endsWith(VIRTUAL_FONT_CSS_SUFFIX)) return undefined;
|
|
81
87
|
const hash = body.slice(
|
|
@@ -87,7 +93,7 @@ export class VirtualFontCssIdMap {
|
|
|
87
93
|
|
|
88
94
|
/** True if `id` is any form of the virtual font css module. */
|
|
89
95
|
matches(id: string): boolean {
|
|
90
|
-
const body =
|
|
96
|
+
const body = stripIdDecorations(id);
|
|
91
97
|
return body.startsWith(VIRTUAL_FONT_CSS_PREFIX) && body.endsWith(VIRTUAL_FONT_CSS_SUFFIX);
|
|
92
98
|
}
|
|
93
99
|
|
package/src/plugins/fonts.ts
CHANGED
|
@@ -97,6 +97,8 @@ export function timberFonts(ctx: PluginContext): Plugin {
|
|
|
97
97
|
*/
|
|
98
98
|
resolveId(id: string) {
|
|
99
99
|
let cleanId = id.startsWith('\0') ? id.slice(1) : id;
|
|
100
|
+
const qIdx = cleanId.indexOf('?');
|
|
101
|
+
if (qIdx !== -1) cleanId = cleanId.slice(0, qIdx);
|
|
100
102
|
if (cleanId.startsWith(ctx.root)) {
|
|
101
103
|
const stripped = cleanId.slice(ctx.root.length);
|
|
102
104
|
if (stripped.startsWith('/') || stripped.startsWith('\\')) {
|
|
@@ -67,6 +67,18 @@ export interface RequestContextStore {
|
|
|
67
67
|
* See design/41-global-params.md §Runtime Validation
|
|
68
68
|
*/
|
|
69
69
|
matchedSegmentPath?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Per-slot coerced segment params, keyed by the slot's full tree path
|
|
72
|
+
* (e.g. '/(browse)/@shows/[artistSlug]/[...year]').
|
|
73
|
+
*
|
|
74
|
+
* Each slot walks its own segment tree and may interpret URL parts
|
|
75
|
+
* differently from the main route (e.g. catch-all vs dynamic). This
|
|
76
|
+
* map stores slot-specific params so getSegmentParams(segmentPath)
|
|
77
|
+
* returns the correct types for slot pages.
|
|
78
|
+
*
|
|
79
|
+
* See design/07-routing.md §"Parallel Slot Params"
|
|
80
|
+
*/
|
|
81
|
+
slotParamsMap?: Map<string, Record<string, string | string[]>>;
|
|
70
82
|
/** Outgoing Set-Cookie entries (name → serialized value + options). Last write wins. */
|
|
71
83
|
cookieJar: Map<string, CookieEntry>;
|
|
72
84
|
/** Whether the response has flushed (headers committed). */
|
|
@@ -299,12 +299,18 @@ export class FlightInjectorCore {
|
|
|
299
299
|
|
|
300
300
|
private readonly rscReader: ReadableStreamDefaultReader<Uint8Array>;
|
|
301
301
|
private readonly timeoutMs: number;
|
|
302
|
+
private readonly errorSignal?: AbortSignal;
|
|
302
303
|
private readonly decoder = new TextDecoder('utf-8', { fatal: true });
|
|
303
304
|
private pullPromise: Promise<void> | null = null;
|
|
304
305
|
|
|
305
|
-
constructor(
|
|
306
|
+
constructor(
|
|
307
|
+
rscStream: ReadableStream<Uint8Array>,
|
|
308
|
+
renderTimeoutMs?: number,
|
|
309
|
+
errorSignal?: AbortSignal
|
|
310
|
+
) {
|
|
306
311
|
this.rscReader = rscStream.getReader();
|
|
307
312
|
this.timeoutMs = renderTimeoutMs ?? 30_000;
|
|
313
|
+
this.errorSignal = errorSignal;
|
|
308
314
|
this.machine = createMachine<FlightInjectionState, FlightInjectionEvent>({
|
|
309
315
|
initial: { phase: 'init' },
|
|
310
316
|
transitions: flightInjectionTransitions,
|
|
@@ -377,6 +383,14 @@ export class FlightInjectorCore {
|
|
|
377
383
|
return;
|
|
378
384
|
}
|
|
379
385
|
|
|
386
|
+
// If an unhandled RSC error was detected, stop injecting Flight
|
|
387
|
+
// data. Continue reading (to prevent tee buffer divergence) but
|
|
388
|
+
// discard the chunks so corrupted data never reaches the client.
|
|
389
|
+
// See TIM-938.
|
|
390
|
+
if (this.errorSignal?.aborted) {
|
|
391
|
+
continue;
|
|
392
|
+
}
|
|
393
|
+
|
|
380
394
|
const decoded = this.decoder.decode(value, { stream: true });
|
|
381
395
|
this.pending.push(encoder.encode(flightChunkScript(decoded)));
|
|
382
396
|
|
|
@@ -250,9 +250,10 @@ export function createInlinedRscStream(
|
|
|
250
250
|
*/
|
|
251
251
|
function createFlightInjectionTransform(
|
|
252
252
|
rscStream: ReadableStream<Uint8Array>,
|
|
253
|
-
renderTimeoutMs?: number
|
|
253
|
+
renderTimeoutMs?: number,
|
|
254
|
+
errorSignal?: AbortSignal
|
|
254
255
|
): TransformStream<Uint8Array, Uint8Array> {
|
|
255
|
-
const core = new FlightInjectorCore(rscStream, renderTimeoutMs);
|
|
256
|
+
const core = new FlightInjectorCore(rscStream, renderTimeoutMs, errorSignal);
|
|
256
257
|
// Controller reference — set on first transform() call so the pull
|
|
257
258
|
// loop can drain pending scripts between HTML chunks (after yielding).
|
|
258
259
|
let _controller: TransformStreamDefaultController<Uint8Array> | null = null;
|
|
@@ -322,7 +323,8 @@ function createFlightInjectionTransform(
|
|
|
322
323
|
export function injectRscPayload(
|
|
323
324
|
htmlStream: ReadableStream<Uint8Array>,
|
|
324
325
|
rscStream: ReadableStream<Uint8Array> | undefined,
|
|
325
|
-
renderTimeoutMs?: number
|
|
326
|
+
renderTimeoutMs?: number,
|
|
327
|
+
errorSignal?: AbortSignal
|
|
326
328
|
): ReadableStream<Uint8Array> {
|
|
327
329
|
if (!rscStream) return htmlStream;
|
|
328
330
|
// Pass the raw RSC stream directly to the flight injection transform.
|
|
@@ -330,7 +332,7 @@ export function injectRscPayload(
|
|
|
330
332
|
// <script> via flightChunkScript itself — do NOT pre-wrap with
|
|
331
333
|
// createInlinedRscStream here, that would double-wrap.
|
|
332
334
|
return htmlStream
|
|
333
|
-
.pipeThrough(createFlightInjectionTransform(rscStream, renderTimeoutMs))
|
|
335
|
+
.pipeThrough(createFlightInjectionTransform(rscStream, renderTimeoutMs, errorSignal))
|
|
334
336
|
.pipeThrough(createMoveSuffixStream());
|
|
335
337
|
}
|
|
336
338
|
|
|
@@ -172,6 +172,8 @@ export interface NodeFlightInjectorOptions {
|
|
|
172
172
|
* Default: 30000 (30s).
|
|
173
173
|
*/
|
|
174
174
|
renderTimeoutMs?: number;
|
|
175
|
+
/** Signal that fires when an unhandled RSC error is detected. */
|
|
176
|
+
errorSignal?: AbortSignal;
|
|
175
177
|
}
|
|
176
178
|
|
|
177
179
|
/**
|
|
@@ -204,7 +206,7 @@ export function createNodeFlightInjector(
|
|
|
204
206
|
});
|
|
205
207
|
}
|
|
206
208
|
|
|
207
|
-
const core = new FlightInjectorCore(rscStream, options?.renderTimeoutMs);
|
|
209
|
+
const core = new FlightInjectorCore(rscStream, options?.renderTimeoutMs, options?.errorSignal);
|
|
208
210
|
|
|
209
211
|
const drain = (): void => {
|
|
210
212
|
while (core.pending.length > 0) transform.push(Buffer.from(core.pending.shift()!));
|
|
@@ -36,6 +36,64 @@ export function setGlobalSchemaCodecs(codecs: Record<string, Codec<unknown>> | n
|
|
|
36
36
|
_globalCodecs = codecs;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Coerce raw slot params through global schema codecs.
|
|
41
|
+
*
|
|
42
|
+
* Each slot segment that has a paramName is looked up in the global codec
|
|
43
|
+
* map by its bracket key (e.g. '[...year]' for catch-all). If a codec
|
|
44
|
+
* exists, the raw value is parsed through it. If no codec exists or no
|
|
45
|
+
* global codecs are registered, the raw value passes through unchanged.
|
|
46
|
+
*
|
|
47
|
+
* Unlike main route coercion, this does NOT throw ParamCoercionError on
|
|
48
|
+
* failure — slots degrade gracefully. A failed coercion logs a warning
|
|
49
|
+
* in dev mode and keeps the raw value.
|
|
50
|
+
*
|
|
51
|
+
* @internal — framework use only
|
|
52
|
+
*/
|
|
53
|
+
export function coerceSlotParams(
|
|
54
|
+
slotChain: Array<{ segmentType: string; paramName?: string }>,
|
|
55
|
+
rawParams: Record<string, string | string[]>
|
|
56
|
+
): Record<string, string | string[]> {
|
|
57
|
+
const globalCodecs = _globalCodecs;
|
|
58
|
+
if (!globalCodecs) return rawParams;
|
|
59
|
+
|
|
60
|
+
const result: Record<string, string | string[]> = Object.create(null);
|
|
61
|
+
for (const key of Object.keys(rawParams)) {
|
|
62
|
+
result[key] = rawParams[key];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
for (const segment of slotChain) {
|
|
66
|
+
if (!segment.paramName) continue;
|
|
67
|
+
const bracketKey = toBracketKey(segment.segmentType, segment.paramName);
|
|
68
|
+
const codec = globalCodecs[bracketKey];
|
|
69
|
+
if (!codec) continue;
|
|
70
|
+
|
|
71
|
+
const key = segment.paramName;
|
|
72
|
+
if (!(key in result)) continue;
|
|
73
|
+
|
|
74
|
+
try {
|
|
75
|
+
result[key] = sanitizeParamValue(codec.parse(result[key] as string | string[])) as
|
|
76
|
+
| string
|
|
77
|
+
| string[];
|
|
78
|
+
} catch (err) {
|
|
79
|
+
// Slot param coercion failures are non-fatal — keep the raw value.
|
|
80
|
+
// The main route already validated the URL; the slot just interprets
|
|
81
|
+
// the same parts differently.
|
|
82
|
+
if (isDebug()) {
|
|
83
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
84
|
+
console.warn(
|
|
85
|
+
`[timber] Slot param coercion failed for "${key}" (codec: ${bracketKey})\n` +
|
|
86
|
+
` Error: ${message}\n` +
|
|
87
|
+
` Raw value: ${JSON.stringify(result[key])}\n` +
|
|
88
|
+
` Keeping raw value.`
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return result as Record<string, string | string[]>;
|
|
95
|
+
}
|
|
96
|
+
|
|
39
97
|
/**
|
|
40
98
|
* Run segment param coercion on the matched route's segments.
|
|
41
99
|
*
|
|
@@ -380,6 +380,11 @@ export async function handleRequest(
|
|
|
380
380
|
// Load params.ts modules from matched segments and coerce raw string
|
|
381
381
|
// params through defineSegmentParams codecs. Coercion failure → 404
|
|
382
382
|
// (middleware never runs). See design/07-routing.md §"Where Coercion Runs"
|
|
383
|
+
//
|
|
384
|
+
// Snapshot raw params before coercion — slot resolution needs the
|
|
385
|
+
// original string values to reconstruct URL parts for tree matching.
|
|
386
|
+
// Coerced params may have been transformed by codecs.
|
|
387
|
+
match.rawSegmentParams = { ...match.segmentParams };
|
|
383
388
|
try {
|
|
384
389
|
await coerceSegmentParams(match);
|
|
385
390
|
} catch (error) {
|
package/src/server/pipeline.ts
CHANGED
|
@@ -50,6 +50,13 @@ export interface RouteMatch {
|
|
|
50
50
|
segments: ManifestSegmentNode[];
|
|
51
51
|
/** Extracted segment params (catch-all segments produce string[]). */
|
|
52
52
|
segmentParams: Record<string, string | string[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Raw segment params before codec coercion. Always string or string[].
|
|
55
|
+
* Used by slot resolution to reconstruct URL parts — coerced params may
|
|
56
|
+
* have been transformed by codecs and are unsuitable for URL matching.
|
|
57
|
+
* Set by the pipeline before coercion runs.
|
|
58
|
+
*/
|
|
59
|
+
rawSegmentParams?: Record<string, string | string[]>;
|
|
53
60
|
/** Middleware chain from the segment tree, ordered root-to-leaf. */
|
|
54
61
|
middlewareChain: MiddlewareFn[];
|
|
55
62
|
}
|
|
@@ -113,9 +113,22 @@ export function getSegmentParams(segmentPath?: string): Record<string, string |
|
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
// Check slot params map first — parallel slots may have different param
|
|
117
|
+
// types than the main route (e.g. catch-all [..year] → string[] vs
|
|
118
|
+
// dynamic [year] → string). If the requested segment path matches a
|
|
119
|
+
// stored slot, return its params merged with the main route's.
|
|
120
|
+
if (segmentPath && store.slotParamsMap?.has(segmentPath)) {
|
|
121
|
+
const slotParams = store.slotParamsMap.get(segmentPath)!;
|
|
122
|
+
// Merge: main params as base, slot-specific params override.
|
|
123
|
+
// This ensures params from segments above the slot (that the slot
|
|
124
|
+
// doesn't re-derive) are still available.
|
|
125
|
+
return { ...store.segmentParams, ...slotParams };
|
|
126
|
+
}
|
|
127
|
+
|
|
116
128
|
// Dev-mode validation: warn when the segment path expects dynamic
|
|
117
129
|
// segments that don't exist on the actual matched segment. This catches
|
|
118
130
|
// bugs like passing a child segment's $segment to a parent layout.
|
|
131
|
+
// Skip for slot paths — they're validated against their own chain.
|
|
119
132
|
// See design/41-global-params.md §Runtime Validation
|
|
120
133
|
if (segmentPath && isDebug() && store.matchedSegmentPath) {
|
|
121
134
|
const expected = extractDynamicSegments(segmentPath);
|
|
@@ -148,6 +161,24 @@ export function setSegmentParams(params: Record<string, string | string[]>): voi
|
|
|
148
161
|
store.segmentParams = params;
|
|
149
162
|
}
|
|
150
163
|
|
|
164
|
+
/**
|
|
165
|
+
* Store per-slot coerced segment params in the current request context.
|
|
166
|
+
* Called by the route element builder when resolving parallel slots.
|
|
167
|
+
*
|
|
168
|
+
* @param segmentPath — The slot's full tree path (e.g. '/(browse)/@shows/[artistSlug]/[...year]')
|
|
169
|
+
* @param params — The slot's coerced segment params
|
|
170
|
+
* @internal — framework use only
|
|
171
|
+
*/
|
|
172
|
+
export function setSlotParams(
|
|
173
|
+
segmentPath: string,
|
|
174
|
+
params: Record<string, string | string[]>
|
|
175
|
+
): void {
|
|
176
|
+
const store = requestContextAls.getStore();
|
|
177
|
+
if (!store) return; // non-throwing — optional diagnostic
|
|
178
|
+
if (!store.slotParamsMap) store.slotParamsMap = new Map();
|
|
179
|
+
store.slotParamsMap.set(segmentPath, params);
|
|
180
|
+
}
|
|
181
|
+
|
|
151
182
|
/**
|
|
152
183
|
* Store the matched segment path (e.g. '/(browse)/[artistSlug]/[year]') for
|
|
153
184
|
* dev-mode validation in getSegmentParams().
|
|
@@ -465,7 +465,16 @@ export async function buildRouteElement(
|
|
|
465
465
|
// This prevents leaking layout UI (sidebars, nav) on denied pages.
|
|
466
466
|
// See design/04-authorization.md §"Access Failure".
|
|
467
467
|
if (layoutComponent) {
|
|
468
|
-
// Resolve parallel slots for this layout
|
|
468
|
+
// Resolve parallel slots for this layout.
|
|
469
|
+
// Compute the parent tree path so slots can build their full
|
|
470
|
+
// segment path for per-slot param storage in ALS.
|
|
471
|
+
const parentTreePath =
|
|
472
|
+
'/' +
|
|
473
|
+
segments
|
|
474
|
+
.slice(0, i + 1)
|
|
475
|
+
.map((s) => s.segmentName)
|
|
476
|
+
.filter(Boolean)
|
|
477
|
+
.join('/');
|
|
469
478
|
const slotProps: Record<string, unknown> = {};
|
|
470
479
|
const slotEntries = Object.entries(segment.slots ?? {});
|
|
471
480
|
for (const [slotName, slotNode] of slotEntries) {
|
|
@@ -473,7 +482,8 @@ export async function buildRouteElement(
|
|
|
473
482
|
slotNode as ManifestSegmentNode,
|
|
474
483
|
match,
|
|
475
484
|
h,
|
|
476
|
-
interception
|
|
485
|
+
interception,
|
|
486
|
+
parentTreePath
|
|
477
487
|
);
|
|
478
488
|
}
|
|
479
489
|
|