@timber-js/app 0.2.0-alpha.171 → 0.2.0-alpha.172
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-O_LsyCE4.js → actions-pN8r5Vnh.js} +3 -3
- package/dist/_chunks/{actions-O_LsyCE4.js.map → actions-pN8r5Vnh.js.map} +1 -1
- package/dist/_chunks/{cache-api-B-lhk9p4.js → cache-api-2hT5kfsr.js} +2 -2
- package/dist/_chunks/{cache-api-B-lhk9p4.js.map → cache-api-2hT5kfsr.js.map} +1 -1
- package/dist/_chunks/{canonicalize-Du3o_ptW.js → canonicalize-DQHyFClh.js} +2 -1
- package/dist/_chunks/canonicalize-DQHyFClh.js.map +1 -0
- package/dist/_chunks/{cli-schema-sync-B5FDplGI.js → cli-schema-sync-DvdvFwwE.js} +3 -3
- package/dist/_chunks/{cli-schema-sync-B5FDplGI.js.map → cli-schema-sync-DvdvFwwE.js.map} +1 -1
- package/dist/_chunks/{logger-AWfuX-KJ.js → logger-kUT0QH0K.js} +23 -1
- package/dist/_chunks/logger-kUT0QH0K.js.map +1 -0
- package/dist/_chunks/{walkers-DCoE-LJf.js → walkers-Bv63zfAC.js} +2 -2
- package/dist/_chunks/{walkers-DCoE-LJf.js.map → walkers-Bv63zfAC.js.map} +1 -1
- package/dist/cache/index.js +1 -1
- package/dist/cli.d.ts +3 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +9 -5
- package/dist/cli.js.map +1 -1
- package/dist/client/internal.js +40 -6
- package/dist/client/internal.js.map +1 -1
- package/dist/client/rsc-fetch.d.ts +1 -1
- package/dist/client/segment-cache.d.ts +20 -3
- package/dist/client/segment-cache.d.ts.map +1 -1
- package/dist/client/segment-outlet.d.ts +10 -2
- package/dist/client/segment-outlet.d.ts.map +1 -1
- package/dist/client/slot-context.d.ts +10 -8
- package/dist/client/slot-context.d.ts.map +1 -1
- package/dist/client/slot-provider.d.ts +5 -0
- package/dist/client/slot-provider.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/routing/index.js +2 -2
- package/dist/server/access-gate.d.ts.map +1 -1
- package/dist/server/als-registry.d.ts +26 -0
- package/dist/server/als-registry.d.ts.map +1 -1
- package/dist/server/cookie-context.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/internal.js +1614 -1667
- package/dist/server/internal.js.map +1 -1
- package/dist/server/metadata-routes.d.ts +13 -0
- package/dist/server/metadata-routes.d.ts.map +1 -1
- package/dist/server/metadata.d.ts +8 -0
- package/dist/server/metadata.d.ts.map +1 -1
- package/dist/server/prebuilt/slots.d.ts +33 -8
- package/dist/server/prebuilt/slots.d.ts.map +1 -1
- package/dist/server/prebuilt-builder.d.ts.map +1 -1
- package/dist/server/request-context.d.ts +15 -0
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/route-element-builder.d.ts +9 -11
- package/dist/server/route-element-builder.d.ts.map +1 -1
- package/dist/server/rsc-entry/helpers.d.ts +18 -10
- package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
- package/dist/server/rsc-entry/render-route.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-payload.d.ts +2 -1
- package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-renderer.d.ts +2 -0
- package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
- package/dist/server/slot-resolver.d.ts +46 -1
- package/dist/server/slot-resolver.d.ts.map +1 -1
- package/dist/server/state-tree-diff.d.ts +36 -3
- package/dist/server/state-tree-diff.d.ts.map +1 -1
- package/dist/server/tree-builder.d.ts +7 -0
- package/dist/server/tree-builder.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cli.ts +15 -5
- package/src/client/rsc-fetch.ts +1 -1
- package/src/client/segment-cache.ts +83 -10
- package/src/client/segment-outlet.tsx +24 -2
- package/src/client/slot-context.ts +10 -8
- package/src/client/slot-provider.tsx +9 -2
- package/src/server/access-gate.tsx +28 -1
- package/src/server/als-registry.ts +44 -0
- package/src/server/cookie-context.ts +7 -1
- package/src/server/deny-renderer.ts +1 -1
- package/src/server/metadata-routes.ts +95 -0
- package/src/server/metadata.ts +21 -0
- package/src/server/prebuilt/slots.ts +39 -16
- package/src/server/prebuilt-builder.ts +6 -5
- package/src/server/prebuilt-runtime.ts +11 -11
- package/src/server/request-context.ts +47 -1
- package/src/server/route-element-builder.ts +72 -144
- package/src/server/rsc-entry/helpers.ts +68 -14
- package/src/server/rsc-entry/render-route.ts +11 -3
- package/src/server/rsc-entry/rsc-payload.ts +16 -3
- package/src/server/rsc-entry/ssr-renderer.ts +3 -1
- package/src/server/slot-resolver.ts +299 -8
- package/src/server/state-tree-diff.ts +104 -8
- package/src/server/tree-builder.ts +10 -0
- package/dist/_chunks/canonicalize-Du3o_ptW.js.map +0 -1
- package/dist/_chunks/logger-AWfuX-KJ.js.map +0 -1
- package/dist/client/child-segment-context.d.ts +0 -22
- package/dist/client/child-segment-context.d.ts.map +0 -1
- package/dist/client/child-segment-outlet.d.ts +0 -18
- package/dist/client/child-segment-outlet.d.ts.map +0 -1
- package/dist/client/child-segment-provider.d.ts +0 -21
- package/dist/client/child-segment-provider.d.ts.map +0 -1
- package/src/client/child-segment-context.ts +0 -40
- package/src/client/child-segment-outlet.tsx +0 -25
- package/src/client/child-segment-provider.tsx +0 -27
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See design/16-metadata.md §"Metadata Routes"
|
|
11
11
|
*/
|
|
12
|
+
import type { HeadElement } from './metadata.js';
|
|
13
|
+
import type { Metadata } from './types.js';
|
|
14
|
+
import type { ManifestSegmentNode } from './route-matcher.js';
|
|
12
15
|
/** Classification of a metadata route file. */
|
|
13
16
|
export interface MetadataRouteInfo {
|
|
14
17
|
/** The metadata route type. */
|
|
@@ -127,4 +130,14 @@ export type AutoLinkTag = AutoLinkLink | AutoLinkMeta;
|
|
|
127
130
|
* @returns Tag descriptor(s) for the <head>, or null if no auto-link
|
|
128
131
|
*/
|
|
129
132
|
export declare function getMetadataRouteAutoLink(type: MetadataRouteType, href: string): AutoLinkTag[];
|
|
133
|
+
/**
|
|
134
|
+
* Collect auto-linked head elements from metadata route files in the segment chain.
|
|
135
|
+
*
|
|
136
|
+
* Walks each segment's metadataRoutes, resolves serve paths and URLs, and
|
|
137
|
+
* emits HeadElement descriptors for <link> and <meta> tags that React Float
|
|
138
|
+
* hoists into <head>.
|
|
139
|
+
*
|
|
140
|
+
* See design/16-metadata.md §"Auto-Linking"
|
|
141
|
+
*/
|
|
142
|
+
export declare function collectMetadataRouteHeadElements(segments: ManifestSegmentNode[], firstDeniedIndex: number, resolvedMetadata: Metadata, requestUrl: URL, metadataRouteHashes?: Record<string, string>): HeadElement[];
|
|
130
143
|
//# 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;
|
|
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;AAI9D,+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;A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C9B,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,YAAY,CAAC;AAEtD;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CAgB7F;AAYD;;;;;;;;GAQG;AACH,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,EAAE,QAAQ,EAC1B,UAAU,EAAE,GAAG,EACf,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3C,WAAW,EAAE,CA+Df"}
|
|
@@ -13,6 +13,14 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import type { Metadata } from './types.js';
|
|
15
15
|
export { renderMetadataToElements } from './metadata-render.js';
|
|
16
|
+
/**
|
|
17
|
+
* Convert HeadElement descriptors to React elements for Float hoisting.
|
|
18
|
+
*
|
|
19
|
+
* React 19 Float hoists <title>, <meta>, and <link> rendered anywhere in
|
|
20
|
+
* the tree into <head> during SSR, and manages them in document.head
|
|
21
|
+
* during client-side rendering.
|
|
22
|
+
*/
|
|
23
|
+
export declare function headElementsToReact(elements: HeadElement[]): React.ReactElement;
|
|
16
24
|
/** A single metadata entry from a layout or page module. */
|
|
17
25
|
export interface SegmentMetadataEntry {
|
|
18
26
|
/** The resolved metadata object (from static or async `metadata` export). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/server/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/server/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,YAAY,CAW/E;AAID,4DAA4D;AAC5D,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,QAAQ,EAAE,QAAQ,CAAC;IACnB,yDAAyD;IACzD,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,mCAAmC;AACnC,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,0CAA0C;AAC1C,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAID;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,EACxB,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,MAAM,GAAG,SAAS,CAmBpB;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,oBAAoB,EAAE,EAC/B,OAAO,GAAE,sBAA2B,GACnC,QAAQ,CAwDV;AAmBD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAmFhE"}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* as a shell with a stable <SlotOutlet slot={name} /> client-reference
|
|
6
6
|
* hole per declared slot prop; live slot content composes in per instance
|
|
7
7
|
* at request time via SlotsProvider/SlotContext. This generalizes the
|
|
8
|
-
* TIM-1181 layout mechanism
|
|
9
|
-
*
|
|
8
|
+
* TIM-1181 layout mechanism to explicitly declared, named slots on any
|
|
9
|
+
* cached component. Layouts use the same mechanism with a `children` slot.
|
|
10
10
|
*
|
|
11
11
|
* Both the production wrapper (cache path) and the dev wrapper (no cache,
|
|
12
12
|
* same tree shape for dev/prod parity) build their render from these
|
|
@@ -14,13 +14,38 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import type { PrebuiltComponentOptions } from '../prebuilt-runtime.js';
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
17
|
+
* Framework-internal slot name for layout children. Uses a prefix that
|
|
18
|
+
* cannot collide with user-declared slot names (which are React prop
|
|
19
|
+
* names). Layout children flow through SlotsProvider/SlotOutlet with
|
|
20
|
+
* this key instead of the bare "children" key, so a cached component
|
|
21
|
+
* with `slots: ['children']` inside a layout never shadows the layout's
|
|
22
|
+
* own children delivery.
|
|
23
|
+
*
|
|
24
|
+
* Defined here (a server module) rather than in `client/slot-context.ts`
|
|
25
|
+
* (`'use client'`) because RSC's client-reference proxying would replace
|
|
26
|
+
* the string value with a proxy object in the server environment. The
|
|
27
|
+
* client-side SlotOutlet receives this value via props, so it doesn't
|
|
28
|
+
* need the constant. See TIM-1191.
|
|
29
|
+
*/
|
|
30
|
+
export declare const LAYOUT_CHILDREN_SLOT = "\0timber:children";
|
|
31
|
+
/**
|
|
32
|
+
* Is this value the framework-injected layout children slot outlet
|
|
33
|
+
* (`<SlotOutlet slot={LAYOUT_CHILDREN_SLOT} />`)? Layout components
|
|
34
|
+
* receive this as their `children` prop — a stable client reference
|
|
35
|
+
* whose cache key is stripped so layout `cache.component` hits work
|
|
36
|
+
* (design/45 §Layout Propagation).
|
|
37
|
+
*
|
|
38
|
+
* Uses a framework-reserved slot name (LAYOUT_CHILDREN_SLOT) that
|
|
39
|
+
* cannot collide with user-declared slot names, preventing context
|
|
40
|
+
* shadowing when a cached component with its own SlotsProvider is
|
|
41
|
+
* nested inside a layout. See TIM-1191.
|
|
42
|
+
*
|
|
43
|
+
* Total: the probes run against a user-controlled value, and a Proxy
|
|
44
|
+
* trap can throw — that must classify as "not the outlet" (the
|
|
45
|
+
* canonicalizer then rejects the value as unkeyable → live render), not
|
|
46
|
+
* abort the request (codex P2 on PR #890).
|
|
22
47
|
*/
|
|
23
|
-
export declare function
|
|
48
|
+
export declare function isChildrenSlotOutletElement(value: unknown): boolean;
|
|
24
49
|
/**
|
|
25
50
|
* Outcome of validating a `slots` declaration at registration time.
|
|
26
51
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../src/server/prebuilt/slots.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../src/server/prebuilt/slots.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEvE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AAExD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CASnE;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAqBjG;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB,GAAG,cAAc,CA0B9F;AAED,MAAM,WAAW,UAAU;IACzB,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,oEAAoE;IACpE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,UAAU,GAAG,IAAI,CAiBnB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,EACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,KAAK,CAAC,YAAY,CAMpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prebuilt-builder.d.ts","sourceRoot":"","sources":["../../src/server/prebuilt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;
|
|
1
|
+
{"version":3,"file":"prebuilt-builder.d.ts","sourceRoot":"","sources":["../../src/server/prebuilt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAwBH,OAAO,KAAK,EAAgB,YAAY,EAAuB,MAAM,oBAAoB,CAAC;AAO1F,4EAA4E;AAC5E,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,QAAQ,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC1C,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,KAAK,EAAE,UAAU,CAAC;IAClB,gGAAgG;IAChG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AAY,EACtB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,cAAc,CAAC,CA2TzB"}
|
|
@@ -83,6 +83,21 @@ export declare function setMatchedSegmentPath(segmentPath: string): void;
|
|
|
83
83
|
* @internal — used by redirect() for preserveSearchParams support.
|
|
84
84
|
*/
|
|
85
85
|
export declare function getRequestSearchString(): string;
|
|
86
|
+
/**
|
|
87
|
+
* Run a callback inside a taint tracking scope. Returns whether any
|
|
88
|
+
* request accessor (getHeaders, getSearchParams, cookies) was called
|
|
89
|
+
* during the callback's execution.
|
|
90
|
+
*
|
|
91
|
+
* Uses a dedicated ALS so concurrent async components (Flight renders
|
|
92
|
+
* siblings in parallel) each get their own isolated scope. The shared
|
|
93
|
+
* push/pop stack model was unsound under concurrency.
|
|
94
|
+
*
|
|
95
|
+
* Results are stored in the request context's taintResults map, keyed
|
|
96
|
+
* by segment/slot ID, for buildSegmentInfo() to consume.
|
|
97
|
+
*
|
|
98
|
+
* @internal — framework use only (route-element-builder.ts, slot-resolver.ts)
|
|
99
|
+
*/
|
|
100
|
+
export declare function runInTaintScope<T>(segmentKey: string, fn: () => T | Promise<T>): Promise<T>;
|
|
86
101
|
/**
|
|
87
102
|
* Read-only Headers interface. The standard Headers class is mutable;
|
|
88
103
|
* this type narrows it to read-only methods. The underlying object is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/server/request-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/server/request-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,iBAAiB,EAKlB,MAAM,mBAAmB,CAAC;AAO3B,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAI7B;;;;;GAKG;AACH,wBAAgB,UAAU,IAAI,eAAe,CAU5C;AAED;;;;;;;GAOG;AACH,w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AE,OAAO,GAAG,IAAI,CAK9D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAK1C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmBhE"}
|
|
@@ -16,17 +16,9 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import type { RouteMatch } from './pipeline.js';
|
|
18
18
|
import type { ManifestSegmentNode } from './route-matcher.js';
|
|
19
|
+
import { type SlotSkipEntry } from './slot-resolver.js';
|
|
19
20
|
import type { InterceptionContext } from './pipeline.js';
|
|
20
|
-
import type
|
|
21
|
-
/**
|
|
22
|
-
* Convert HeadElement descriptors to React elements for Float hoisting.
|
|
23
|
-
*
|
|
24
|
-
* React 19 Float hoists <title>, <meta>, and <link> rendered anywhere in
|
|
25
|
-
* the tree into <head> during SSR, and manages them in document.head
|
|
26
|
-
* during client-side rendering. This replaces the X-Timber-Head header
|
|
27
|
-
* side-channel and the imperative client DOM applier.
|
|
28
|
-
*/
|
|
29
|
-
export declare function headElementsToReact(elements: HeadElement[]): React.ReactElement;
|
|
21
|
+
import { type ClientStateTree } from './state-tree-diff.js';
|
|
30
22
|
/**
|
|
31
23
|
* Detect whether a component is a React client reference.
|
|
32
24
|
* Client references have $$typeof set to Symbol.for('react.client.reference')
|
|
@@ -82,6 +74,12 @@ export interface RouteElementResult {
|
|
|
82
74
|
* See TIM-1045 (pages), TIM-1208 (layouts).
|
|
83
75
|
*/
|
|
84
76
|
shellSettled?: Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Slot metadata for the X-Timber-Segments header. Contains info about
|
|
79
|
+
* all parallel route slots encountered during element tree construction,
|
|
80
|
+
* enabling the client to populate its segment cache with slot entries.
|
|
81
|
+
*/
|
|
82
|
+
slotSkipInfo: SlotSkipEntry[];
|
|
85
83
|
}
|
|
86
84
|
/**
|
|
87
85
|
* Build a React element tree from a matched route.
|
|
@@ -99,5 +97,5 @@ export interface RouteElementResult {
|
|
|
99
97
|
* segments, the pre-computed verdict is replayed — no re-execution,
|
|
100
98
|
* no metadata side effects, no head leak (TIM-1027).
|
|
101
99
|
*/
|
|
102
|
-
export declare function buildRouteElement(req: Request, match: RouteMatch, interception?: InterceptionContext, clientStateTree?:
|
|
100
|
+
export declare function buildRouteElement(req: Request, match: RouteMatch, interception?: InterceptionContext, clientStateTree?: ClientStateTree | null, metadataRouteHashes?: Record<string, string>): Promise<RouteElementResult>;
|
|
103
101
|
//# sourceMappingURL=route-element-builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-element-builder.d.ts","sourceRoot":"","sources":["../../src/server/route-element-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"route-element-builder.d.ts","sourceRoot":"","sources":["../../src/server/route-element-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAe9D,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAO1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AA0CnG;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAM7D;AAID;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAID,+CAA+C;AAC/C,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;IAC3C,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED,+CAA+C;AAC/C,MAAM,WAAW,kBAAkB;IACjC,wFAAwF;IACxF,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B,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;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B;;;;OAIG;IACH,YAAY,EAAE,aAAa,EAAE,CAAC;CAC/B;AA8DD;;;;;;;;;;;;;;;GAeG;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,CAygB7B"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Small, stateless functions used across the RSC entry modules.
|
|
5
5
|
*/
|
|
6
6
|
import type { ManifestSegmentNode } from '../route-matcher.js';
|
|
7
|
+
import type { SlotSkipEntry } from '../slot-resolver.js';
|
|
7
8
|
/** RSC content type for client navigation payload requests. */
|
|
8
9
|
export declare const RSC_CONTENT_TYPE = "text/x-component";
|
|
9
10
|
/**
|
|
@@ -69,22 +70,29 @@ export declare function createDebugChannelCollector(): DebugChannelCollector;
|
|
|
69
70
|
export declare function parseDebugRows(text: string): DebugComponentEntry[];
|
|
70
71
|
/**
|
|
71
72
|
* Build segment metadata for the X-Timber-Segments response header.
|
|
72
|
-
* Describes the rendered segment chain with
|
|
73
|
-
* the client to populate its segment cache for state tree diffing.
|
|
73
|
+
* Describes the rendered segment chain with request-dependency status,
|
|
74
|
+
* enabling the client to populate its segment cache for state tree diffing.
|
|
75
|
+
*
|
|
76
|
+
* Request-dependency is determined by render-time taint tracking via
|
|
77
|
+
* runInTaintScope(). If taint results are available (RSC payload path),
|
|
78
|
+
* segments/slots that called getHeaders()/getSearchParams()/cookies()
|
|
79
|
+
* are marked request-dependent. Missing taint data (SSR path) defaults
|
|
80
|
+
* to true (safe fallback — never incorrectly cached).
|
|
74
81
|
*
|
|
75
|
-
* Async detection: server components defined as `async function` have
|
|
76
|
-
* constructor.name === 'AsyncFunction'. These layouts always re-render
|
|
77
|
-
* on navigation (they may depend on request context like cookies/params).
|
|
78
82
|
* See design/07-routing.md §"Server Diffing Rules".
|
|
79
83
|
*/
|
|
84
|
+
interface SegmentInfoEntry {
|
|
85
|
+
path: string;
|
|
86
|
+
segmentId?: string;
|
|
87
|
+
isRequestDependent: boolean;
|
|
88
|
+
slot?: boolean;
|
|
89
|
+
parentSegment?: string;
|
|
90
|
+
denied?: boolean;
|
|
91
|
+
}
|
|
80
92
|
export declare function buildSegmentInfo(segments: ManifestSegmentNode[], layoutComponents: Array<{
|
|
81
93
|
component: (...args: unknown[]) => unknown;
|
|
82
94
|
segment: ManifestSegmentNode;
|
|
83
|
-
}
|
|
84
|
-
path: string;
|
|
85
|
-
segmentId?: string;
|
|
86
|
-
isAsync: boolean;
|
|
87
|
-
}>;
|
|
95
|
+
}>, slotSkipInfo?: SlotSkipEntry[], taintResults?: Map<string, boolean>, orphanTaint?: boolean, skippedSegmentKeys?: string[]): SegmentInfoEntry[];
|
|
88
96
|
/**
|
|
89
97
|
* Check if a request is asking for an RSC payload (client navigation)
|
|
90
98
|
* rather than full HTML. Client-side navigation sends Accept: text/x-component.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/hel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e,EAAE,OAAO,EACxB,IAAI,EAAE,eAAe,EACrB,YAAY,CAAC,EAAE,mBAAmB,GACjC,OAAO,CAAC,QAAQ,CAAC,CA0NnB"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import type { RouteMatch } from '../pipeline.js';
|
|
11
11
|
import type { LayoutComponentEntry } from '../route-element-builder.js';
|
|
12
12
|
import type { ManifestSegmentNode } from '../route-matcher.js';
|
|
13
|
+
import type { SlotSkipEntry } from '../slot-resolver.js';
|
|
13
14
|
import type { RenderSignals } from './rsc-stream.js';
|
|
14
15
|
/**
|
|
15
16
|
* Build an RSC payload Response for a client-side navigation request.
|
|
@@ -20,5 +21,5 @@ import type { RenderSignals } from './rsc-stream.js';
|
|
|
20
21
|
* initial component tree, allowing onError to capture DenySignal/
|
|
21
22
|
* RedirectSignal before we commit the response. See TIM-344.
|
|
22
23
|
*/
|
|
23
|
-
export declare function buildRscPayloadResponse(req: Request, rscStream: ReadableStream<Uint8Array>, signals: RenderSignals, segments: ManifestSegmentNode[], layoutComponents: LayoutComponentEntry[], match: RouteMatch, responseHeaders: Headers, skippedSegments?: string[]): Promise<Response>;
|
|
24
|
+
export declare function buildRscPayloadResponse(req: Request, rscStream: ReadableStream<Uint8Array>, signals: RenderSignals, segments: ManifestSegmentNode[], layoutComponents: LayoutComponentEntry[], match: RouteMatch, responseHeaders: Headers, skippedSegments?: string[], slotSkipInfo?: SlotSkipEntry[]): Promise<Response>;
|
|
24
25
|
//# sourceMappingURL=rsc-payload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc-payload.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/rsc-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"rsc-payload.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/rsc-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AASzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,EACrC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,gBAAgB,EAAE,oBAAoB,EAAE,EACxC,KAAK,EAAE,UAAU,EACjB,eAAe,EAAE,OAAO,EACxB,eAAe,CAAC,EAAE,MAAM,EAAE,EAC1B,YAAY,CAAC,EAAE,aAAa,EAAE,GAC7B,OAAO,CAAC,QAAQ,CAAC,CA8LnB"}
|
|
@@ -15,6 +15,7 @@ import type { ClientBootstrapConfig } from '../html-injectors.js';
|
|
|
15
15
|
import type { RouteMatch } from '../pipeline.js';
|
|
16
16
|
import type { LayoutComponentEntry } from '../route-element-builder.js';
|
|
17
17
|
import type { ManifestSegmentNode } from '../route-matcher.js';
|
|
18
|
+
import type { SlotSkipEntry } from '../slot-resolver.js';
|
|
18
19
|
import { type GlobalErrorFile } from './error-renderer.js';
|
|
19
20
|
import type { RenderSignals } from './rsc-stream.js';
|
|
20
21
|
/**
|
|
@@ -58,6 +59,7 @@ interface SsrRenderOptions {
|
|
|
58
59
|
deferSuspenseFor: number;
|
|
59
60
|
/** Tier 2 global-error.tsx file, if present in app/. */
|
|
60
61
|
globalError?: GlobalErrorFile;
|
|
62
|
+
slotSkipInfo?: SlotSkipEntry[];
|
|
61
63
|
}
|
|
62
64
|
/**
|
|
63
65
|
* Render the RSC stream to HTML via SSR.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-renderer.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/ssr-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAIlE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ssr-renderer.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/ssr-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAIlE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAYzD,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AA4BrD;;;;;;;;GAQG;AACH,eAAO,MAAM,gCAAgC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAiB,CAAC;AAEhF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iCAAiC,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAqB,CAAC;AAEtF,UAAU,gBAAgB;IACxB,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACtC,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,gBAAgB,EAAE,oBAAoB,EAAE,CAAC;IACzC,KAAK,EAAE,UAAU,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,qBAAqB,CAAC;IACvC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE,aAAa,EAAE,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAoVjF"}
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
* See design/02-rendering-pipeline.md §"Parallel Slots"
|
|
17
17
|
*/
|
|
18
18
|
import type { InterceptionContext, RouteMatch } from './pipeline.js';
|
|
19
|
+
import { DenySignal, RedirectSignal } from './primitives.js';
|
|
19
20
|
import type { ManifestSegmentNode } from './route-matcher.js';
|
|
21
|
+
import { type ClientStateTree } from './state-tree-diff.js';
|
|
20
22
|
type CreateElementFn = (...args: unknown[]) => React.ReactElement;
|
|
21
23
|
/**
|
|
22
24
|
* Resolve the element for a parallel slot.
|
|
@@ -31,6 +33,49 @@ type CreateElementFn = (...args: unknown[]) => React.ReactElement;
|
|
|
31
33
|
* 3. SlotAccessGate if the segment has access.ts (gate OUTSIDE the layout,
|
|
32
34
|
* so a denied layout never executes — see TIM-1074)
|
|
33
35
|
*/
|
|
34
|
-
export declare function resolveSlotElement(slotNode: ManifestSegmentNode, match: RouteMatch, h: CreateElementFn, interception?: InterceptionContext, parentTreePath?: string): Promise<React.ReactElement | null>;
|
|
36
|
+
export declare function resolveSlotElement(slotNode: ManifestSegmentNode, match: RouteMatch, h: CreateElementFn, interception?: InterceptionContext, parentTreePath?: string, accessVerdicts?: SlotAccessVerdict[], taintKey?: string): Promise<React.ReactElement | null>;
|
|
37
|
+
/** Result of eagerly evaluating one segment's access.ts. */
|
|
38
|
+
export interface SlotAccessVerdict {
|
|
39
|
+
node: ManifestSegmentNode;
|
|
40
|
+
/**
|
|
41
|
+
* 'pass' — access allowed.
|
|
42
|
+
* DenySignal/RedirectSignal — access denied, replayed in SlotAccessGate.
|
|
43
|
+
* 'error' — unknown error. Forces full render. No verdict passed to
|
|
44
|
+
* SlotAccessGate, so it calls accessFn during render and the error
|
|
45
|
+
* reaches the slot's error boundary.
|
|
46
|
+
*/
|
|
47
|
+
verdict: 'pass' | 'error' | DenySignal | RedirectSignal;
|
|
48
|
+
}
|
|
49
|
+
export interface SlotSkipEntry {
|
|
50
|
+
slotKey: string;
|
|
51
|
+
parentSegmentId: string;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the slot's components called request accessors (getHeaders,
|
|
54
|
+
* getSearchParams, cookies) during their last render. Replaces the
|
|
55
|
+
* unreliable AsyncFunction heuristic — taint-tracked via ALS.
|
|
56
|
+
*/
|
|
57
|
+
isRequestDependent: boolean;
|
|
58
|
+
/** Whether the slot's access.ts denied on this render. */
|
|
59
|
+
denied: boolean;
|
|
60
|
+
}
|
|
61
|
+
interface ResolveSlotPropsArgs {
|
|
62
|
+
segment: ManifestSegmentNode;
|
|
63
|
+
segmentId: string;
|
|
64
|
+
match: RouteMatch;
|
|
65
|
+
h: CreateElementFn;
|
|
66
|
+
interception?: InterceptionContext;
|
|
67
|
+
parentTreePath: string;
|
|
68
|
+
departingUrl: string | null;
|
|
69
|
+
destinationUrl: string;
|
|
70
|
+
clientStateTree: ClientStateTree | null;
|
|
71
|
+
slotSkipInfo: SlotSkipEntry[];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Resolve all parallel route slots for a layout, wrapping each in a
|
|
75
|
+
* SegmentOutlet for client-side caching. Slots whose matched content
|
|
76
|
+
* hasn't changed between the departing and destination URLs are rendered
|
|
77
|
+
* with `skip=true` so the client keeps its cached content.
|
|
78
|
+
*/
|
|
79
|
+
export declare function resolveSlotProps({ segment, segmentId, match, h, interception, parentTreePath, departingUrl, destinationUrl, clientStateTree, slotSkipInfo, }: ResolveSlotPropsArgs): Promise<Record<string, unknown>>;
|
|
35
80
|
export {};
|
|
36
81
|
//# 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;
|
|
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;AACrE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAK9D,OAAO,EAAkC,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5F,KAAK,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,KAAK,CAAC,YAAY,CAAC;AAgClE;;;;;;;;;;;;GAYG;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,EACvB,cAAc,CAAC,EAAE,iBAAiB,EAAE,EACpC,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,CAyHpC;AAiQD,4DAA4D;AAC5D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,mBAAmB,CAAC;IAC1B;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,CAAC;CACzD;AAwDD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAC5B,0DAA0D;IAC1D,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,UAAU,oBAAoB;IAC5B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,UAAU,CAAC;IAClB,CAAC,EAAE,eAAe,CAAC;IACnB,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;IACxC,YAAY,EAAE,aAAa,EAAE,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,OAAO,EACP,SAAS,EACT,KAAK,EACL,CAAC,EACD,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,cAAc,EACd,eAAe,EACf,YAAY,GACb,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA2JzD"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See design/19-client-navigation.md §"X-Timber-State-Tree Header"
|
|
14
14
|
* See design/13-security.md §"State tree manipulation"
|
|
15
15
|
*/
|
|
16
|
+
import type { ManifestSegmentNode } from './route-matcher.js';
|
|
16
17
|
/**
|
|
17
18
|
* Segment node shape expected by computeSegmentKeys.
|
|
18
19
|
* Matches the relevant fields from ManifestSegmentNode without
|
|
@@ -35,16 +36,26 @@ interface SegmentKeyInput {
|
|
|
35
36
|
* (X-Timber-Segments header), and the client cache/state tree.
|
|
36
37
|
*/
|
|
37
38
|
export declare function computeSegmentKeys(segments: SegmentKeyInput[]): string[];
|
|
39
|
+
/**
|
|
40
|
+
* Compute a unique key for a parallel route slot.
|
|
41
|
+
* Format: `{parentSegmentId}/@{slotName}`, e.g. `/@sidebar` or `/dashboard/@modal`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function computeSlotKey(parentSegmentId: string, slotName: string): string;
|
|
44
|
+
/** Parsed client state tree with segment paths and optional slot paths. */
|
|
45
|
+
export interface ClientStateTree extends Set<string> {
|
|
46
|
+
slots?: Set<string> | null;
|
|
47
|
+
}
|
|
38
48
|
/**
|
|
39
49
|
* Parse the X-Timber-State-Tree header from a request.
|
|
40
50
|
*
|
|
41
|
-
* Returns a Set of segment paths the client has cached
|
|
51
|
+
* Returns a Set of segment paths the client has cached (with an
|
|
52
|
+
* additional `slots` property for cached slot paths), or null if
|
|
42
53
|
* the header is missing, malformed, or empty. Parsing happens before
|
|
43
54
|
* renderToReadableStream — not inside the React render pass.
|
|
44
55
|
*
|
|
45
|
-
* @returns
|
|
56
|
+
* @returns ClientStateTree with segments and slots, or null if no valid state tree
|
|
46
57
|
*/
|
|
47
|
-
export declare function parseClientStateTree(req: Request):
|
|
58
|
+
export declare function parseClientStateTree(req: Request): ClientStateTree | null;
|
|
48
59
|
/**
|
|
49
60
|
* Determine whether a segment's layout rendering can be skipped.
|
|
50
61
|
*
|
|
@@ -69,5 +80,27 @@ export declare function parseClientStateTree(req: Request): Set<string> | null;
|
|
|
69
80
|
* @param clientSegments - Set of paths from X-Timber-State-Tree, or null
|
|
70
81
|
*/
|
|
71
82
|
export declare function shouldSkipSegment(segmentKey: string, layoutComponent: ((...args: unknown[]) => unknown) | undefined, isLeaf: boolean, clientSegments: Set<string> | null): boolean;
|
|
83
|
+
interface ShouldSkipSlotArgs {
|
|
84
|
+
slotKey: string;
|
|
85
|
+
clientSlots: Set<string> | null;
|
|
86
|
+
slotNode: ManifestSegmentNode;
|
|
87
|
+
departingUrlParts: string[];
|
|
88
|
+
destinationUrlParts: string[];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Determine whether a parallel route slot can be skipped.
|
|
92
|
+
*
|
|
93
|
+
* A slot is skipped when ALL of:
|
|
94
|
+
* 1. The client has this slot cached (slotKey is in clientSlots)
|
|
95
|
+
* 2. The slot's matched page is the SAME for both the departing and
|
|
96
|
+
* destination URLs (same page file + same extracted params)
|
|
97
|
+
*
|
|
98
|
+
* The comparison uses matchUrlParts to find what each URL would match
|
|
99
|
+
* in the slot's sub-tree, then compares the matched page file and params.
|
|
100
|
+
*
|
|
101
|
+
* This is a performance optimization only, NOT a security boundary.
|
|
102
|
+
* Slot access.ts always runs via SlotAccessGate regardless.
|
|
103
|
+
*/
|
|
104
|
+
export declare function shouldSkipSlot({ slotKey, clientSlots, slotNode, departingUrlParts, destinationUrlParts, }: ShouldSkipSlotArgs): boolean;
|
|
72
105
|
export {};
|
|
73
106
|
//# sourceMappingURL=state-tree-diff.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-tree-diff.d.ts","sourceRoot":"","sources":["../../src/server/state-tree-diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"state-tree-diff.d.ts","sourceRoot":"","sources":["../../src/server/state-tree-diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAI9D;;;;GAIG;AACH,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,CAAC;IACh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|
createElement: CreateElement;
|
|
111
111
|
defaultFallback: ReactNode;
|
|
112
112
|
children: ReactNode;
|
|
113
|
+
/**
|
|
114
|
+
* Pre-computed verdict from eager access evaluation. When provided,
|
|
115
|
+
* SlotAccessGate replays it synchronously instead of re-calling accessFn.
|
|
116
|
+
* 'pass' → render children. DenySignal → graceful degradation.
|
|
117
|
+
* undefined → call accessFn during render (backward compat, error re-run).
|
|
118
|
+
*/
|
|
119
|
+
verdict?: 'pass' | import('./primitives.js').DenySignal | import('./primitives.js').RedirectSignal;
|
|
113
120
|
}
|
|
114
121
|
/**
|
|
115
122
|
* Framework-injected error boundary wrapper.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-builder.d.ts","sourceRoot":"","sources":["../../src/server/tree-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIlE,mDAAmD;AACnD,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,iDAAiD;AACjD,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,SAAS,KAAK,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAErF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,SAAS,CAAC;AAoDhE;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,CAC1B,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,GAAG,QAAQ,EAAE,OAAO,EAAE,KACnB,SAAS,CAAC;AAEf;;;GAGG;AACH,MAAM,MAAM,YAAY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AmB;IAClC,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,wFAAwF;IACxF,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;IACxC,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,aAAa,EAAE,aAAa,CAAC;IAC7B,eAAe,EAAE,SAAS,CAAC;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,OAAO,CAAC,EACJ,MAAM,GACN,OAAO,iBAAiB,EAAE,UAAU,GACpC,OAAO,iBAAiB,EAAE,cAAc,CAAC;CAC9C;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,eAAe,CAAC;IACpC,sEAAsE;IACtE,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,uFAAuF;IACvF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAID;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB,gFAAgF;IAChF,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAoF1F"}
|
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.172",
|
|
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",
|
package/src/cli.ts
CHANGED
|
@@ -238,14 +238,15 @@ export async function runSchema(args: string[]): Promise<void> {
|
|
|
238
238
|
// ─── Init Subcommand ─────────────────────────────────────────────────────────
|
|
239
239
|
|
|
240
240
|
/**
|
|
241
|
-
* `timber init` — write AGENTS.md (and CLAUDE.md
|
|
242
|
-
* so AI coding agents can discover timber.js documentation and
|
|
241
|
+
* `timber init` — write AGENTS.md (and a CLAUDE.md symlink to it) to the
|
|
242
|
+
* project root so AI coding agents can discover timber.js documentation and
|
|
243
|
+
* conventions.
|
|
243
244
|
*
|
|
244
245
|
* The content is read from the installed @timber-js/app package itself, so it
|
|
245
246
|
* stays in sync with the installed version.
|
|
246
247
|
*/
|
|
247
248
|
export async function runInit(): Promise<void> {
|
|
248
|
-
const { readFileSync, writeFileSync, existsSync } = await import('node:fs');
|
|
249
|
+
const { readFileSync, writeFileSync, existsSync, symlinkSync } = await import('node:fs');
|
|
249
250
|
const { resolve, dirname } = await import('node:path');
|
|
250
251
|
const { fileURLToPath } = await import('node:url');
|
|
251
252
|
|
|
@@ -277,8 +278,17 @@ export async function runInit(): Promise<void> {
|
|
|
277
278
|
if (existsSync(claudePath)) {
|
|
278
279
|
console.log('[timber] CLAUDE.md already exists — skipping (delete it first to regenerate)');
|
|
279
280
|
} else {
|
|
280
|
-
|
|
281
|
-
|
|
281
|
+
try {
|
|
282
|
+
// Relative target so the link survives the project directory moving.
|
|
283
|
+
// The 'file' type argument is required for Windows (ignored elsewhere).
|
|
284
|
+
symlinkSync('AGENTS.md', claudePath, 'file');
|
|
285
|
+
wrote.push('CLAUDE.md (symlink)');
|
|
286
|
+
} catch {
|
|
287
|
+
// Windows without Developer Mode or admin rights can't create symlinks
|
|
288
|
+
// (EPERM) — fall back to a plain pointer file.
|
|
289
|
+
writeFileSync(claudePath, 'Read AGENTS.md for project context and conventions.\n');
|
|
290
|
+
wrote.push('CLAUDE.md');
|
|
291
|
+
}
|
|
282
292
|
}
|
|
283
293
|
|
|
284
294
|
if (wrote.length > 0) {
|
package/src/client/rsc-fetch.ts
CHANGED
|
@@ -150,7 +150,7 @@ function warnMalformedHeader(headerName: string, raw: string): void {
|
|
|
150
150
|
* Extract segment metadata from the X-Timber-Segments response header.
|
|
151
151
|
* Returns null if the header is missing or malformed.
|
|
152
152
|
*
|
|
153
|
-
* Format: JSON array of {path,
|
|
153
|
+
* Format: JSON array of {path, isRequestDependent} objects describing the rendered
|
|
154
154
|
* segment chain from root to leaf. Used to populate the client-side
|
|
155
155
|
* segment cache for state tree diffing on subsequent navigations.
|
|
156
156
|
*/
|