@timber-js/app 0.2.0-alpha.220 → 0.2.0-alpha.221
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-BwkmAYXq.js → actions-BDqn4Oxj.js} +2 -2
- package/dist/_chunks/{actions-BwkmAYXq.js.map → actions-BDqn4Oxj.js.map} +1 -1
- package/dist/_chunks/{cache-api-LA3sBpUS.js → cache-api-GE4AOe2H.js} +30 -151
- package/dist/_chunks/cache-api-GE4AOe2H.js.map +1 -0
- package/dist/_chunks/dev-server-BiWNMBVU.js +1 -0
- package/dist/_chunks/{dev-server-DnODXuNM.js → dev-server-DIy-SY-J.js} +11 -6
- package/dist/_chunks/{dev-server-DnODXuNM.js.map → dev-server-DIy-SY-J.js.map} +1 -1
- package/dist/_chunks/dev-store-BOa304m_.js +283 -0
- package/dist/_chunks/dev-store-BOa304m_.js.map +1 -0
- package/dist/_chunks/{error-boundary-xxxLtXt6.js → error-boundary-Bc8QPZuq.js} +71 -21
- package/dist/_chunks/error-boundary-Bc8QPZuq.js.map +1 -0
- package/dist/_chunks/{flight-source-node-0dE-t3kq.js → flight-source-node-HptmGMT8.js} +6 -7
- package/dist/_chunks/flight-source-node-HptmGMT8.js.map +1 -0
- package/dist/_chunks/{node-response-Dibufw_b.js → node-response-rkQqcFGq.js} +48 -2
- package/dist/_chunks/node-response-rkQqcFGq.js.map +1 -0
- package/dist/_chunks/{purge-store-Byr8XOjU.js → purge-store-WZaxu-3m.js} +2 -2
- package/dist/_chunks/purge-store-WZaxu-3m.js.map +1 -0
- package/dist/_chunks/{render-timeout-DOf_BBcO.js → render-timeout-joFhz4KH.js} +1 -10
- package/dist/_chunks/render-timeout-joFhz4KH.js.map +1 -0
- package/dist/cache/cache-api.d.ts.map +1 -1
- package/dist/cache/handler-store.d.ts +13 -1
- package/dist/cache/handler-store.d.ts.map +1 -1
- package/dist/cache/index.js +2 -1
- package/dist/cache/invalidation-epoch.d.ts +7 -0
- package/dist/cache/invalidation-epoch.d.ts.map +1 -1
- package/dist/cache/timber-cache.d.ts.map +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/purge-store.d.ts +10 -1
- package/dist/cdn/purge-store.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/browser-entry/router-init.d.ts.map +1 -1
- package/dist/client/error-boundary.js +1 -1
- package/dist/client/index.js +6 -15
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.js +37 -64
- package/dist/client/internal.js.map +1 -1
- package/dist/client/link.d.ts.map +1 -1
- package/dist/client/navigation-transition.d.ts +68 -14
- package/dist/client/navigation-transition.d.ts.map +1 -1
- package/dist/client/router-effects.d.ts +35 -31
- package/dist/client/router-effects.d.ts.map +1 -1
- package/dist/client/router-pipeline.d.ts +2 -6
- package/dist/client/router-pipeline.d.ts.map +1 -1
- package/dist/client/router-types.d.ts +10 -30
- package/dist/client/router-types.d.ts.map +1 -1
- package/dist/client/router.d.ts.map +1 -1
- package/dist/dev-tools/logs.d.ts +2 -2
- package/dist/dev-tools/logs.d.ts.map +1 -1
- package/dist/index.js +144 -51
- package/dist/index.js.map +1 -1
- package/dist/plugins/dev-server.d.ts.map +1 -1
- package/dist/plugins/entries.d.ts +5 -0
- package/dist/plugins/entries.d.ts.map +1 -1
- package/dist/plugins/orphaned-modules.d.ts +57 -0
- package/dist/plugins/orphaned-modules.d.ts.map +1 -0
- package/dist/plugins/prebuilt.d.ts +6 -6
- package/dist/plugins/prerender-sugar.d.ts.map +1 -1
- package/dist/plugins/routing.d.ts +1 -1
- package/dist/plugins/routing.d.ts.map +1 -1
- package/dist/rsc-runtime/dev-reference-cache.d.ts +47 -0
- package/dist/rsc-runtime/dev-reference-cache.d.ts.map +1 -0
- package/dist/rsc-runtime/rsc.d.ts +0 -15
- package/dist/rsc-runtime/rsc.d.ts.map +1 -1
- package/dist/rsc-runtime/ssr.d.ts +0 -11
- package/dist/rsc-runtime/ssr.d.ts.map +1 -1
- package/dist/server/abort-scope.d.ts +27 -0
- package/dist/server/abort-scope.d.ts.map +1 -0
- package/dist/server/flight-source-node.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/instrumentation.d.ts +2 -1
- package/dist/server/instrumentation.d.ts.map +1 -1
- package/dist/server/internal.d.ts +1 -1
- package/dist/server/internal.d.ts.map +1 -1
- package/dist/server/internal.js +328 -132
- package/dist/server/internal.js.map +1 -1
- package/dist/server/pipeline-helpers.d.ts.map +1 -1
- package/dist/server/pipeline.d.ts +10 -7
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/prebuilt/cache-key.d.ts +26 -0
- package/dist/server/prebuilt/cache-key.d.ts.map +1 -1
- package/dist/server/prebuilt/capture-render.d.ts +9 -4
- package/dist/server/prebuilt/capture-render.d.ts.map +1 -1
- package/dist/server/prebuilt/capture-routes.d.ts +1 -1
- package/dist/server/prebuilt/dev-store.d.ts +103 -0
- package/dist/server/prebuilt/dev-store.d.ts.map +1 -0
- package/dist/server/prebuilt/overlay.d.ts +5 -0
- package/dist/server/prebuilt/overlay.d.ts.map +1 -1
- package/dist/server/prebuilt/payload-source.d.ts +8 -0
- package/dist/server/prebuilt/payload-source.d.ts.map +1 -1
- package/dist/server/prebuilt/slots.d.ts +5 -6
- package/dist/server/prebuilt/slots.d.ts.map +1 -1
- package/dist/server/prebuilt-builder.d.ts.map +1 -1
- package/dist/server/prebuilt-runtime.d.ts +5 -10
- package/dist/server/prebuilt-runtime.d.ts.map +1 -1
- package/dist/server/render-timeout.d.ts.map +1 -1
- package/dist/server/rsc-entry/action-dispatcher.d.ts.map +1 -1
- package/dist/server/rsc-entry/index.d.ts.map +1 -1
- package/dist/server/ssr-render.d.ts.map +1 -1
- package/docs/api/32-api-cache.mdx +2 -0
- package/docs/learn/10-caching.mdx +12 -0
- package/docs/learn/11-middleware.mdx +2 -0
- package/package.json +1 -1
- package/src/cache/cache-api.ts +7 -1
- package/src/cache/handler-store.ts +38 -1
- package/src/cache/invalidation-epoch.ts +18 -6
- package/src/cache/timber-cache.ts +6 -2
- package/src/cdn/purge-store.ts +29 -1
- package/src/client/browser-entry/action-dispatch.ts +5 -5
- package/src/client/browser-entry/router-init.ts +2 -4
- package/src/client/link.tsx +14 -18
- package/src/client/navigation-transition.ts +86 -33
- package/src/client/router-effects.ts +70 -45
- package/src/client/router-lifecycle.ts +1 -1
- package/src/client/router-pipeline.ts +52 -65
- package/src/client/router-types.ts +11 -31
- package/src/client/router.ts +98 -104
- package/src/dev-tools/logs.ts +76 -50
- package/src/plugins/dev-server.ts +23 -8
- package/src/plugins/entries.ts +6 -0
- package/src/plugins/orphaned-modules.ts +78 -0
- package/src/plugins/prebuilt.ts +17 -17
- package/src/plugins/prerender-sugar.ts +38 -6
- package/src/plugins/routing.ts +23 -1
- package/src/rsc-runtime/dev-reference-cache.ts +115 -0
- package/src/rsc-runtime/rsc.ts +10 -0
- package/src/rsc-runtime/ssr.ts +10 -0
- package/src/server/abort-scope.ts +49 -0
- package/src/server/flight-source-node.ts +5 -4
- package/src/server/instrumentation.ts +32 -8
- package/src/server/internal.ts +1 -6
- package/src/server/pipeline-helpers.ts +5 -3
- package/src/server/pipeline.ts +31 -20
- package/src/server/prebuilt/cache-key.ts +41 -0
- package/src/server/prebuilt/capture-render.ts +10 -6
- package/src/server/prebuilt/capture-routes.ts +1 -1
- package/src/server/prebuilt/dev-store.ts +173 -0
- package/src/server/prebuilt/overlay.ts +7 -1
- package/src/server/prebuilt/payload-source.ts +19 -0
- package/src/server/prebuilt/slots.ts +5 -6
- package/src/server/prebuilt-builder.ts +3 -2
- package/src/server/prebuilt-runtime.ts +174 -176
- package/src/server/render-timeout.ts +12 -17
- package/src/server/rsc-entry/action-dispatcher.ts +3 -1
- package/src/server/rsc-entry/index.ts +47 -13
- package/src/server/ssr-render.ts +9 -11
- package/dist/_chunks/cache-api-LA3sBpUS.js.map +0 -1
- package/dist/_chunks/dev-server-DkytOEG2.js +0 -1
- package/dist/_chunks/error-boundary-xxxLtXt6.js.map +0 -1
- package/dist/_chunks/flight-source-node-0dE-t3kq.js.map +0 -1
- package/dist/_chunks/node-response-Dibufw_b.js.map +0 -1
- package/dist/_chunks/purge-store-Byr8XOjU.js.map +0 -1
- package/dist/_chunks/render-timeout-DOf_BBcO.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline-helpers.d.ts","sourceRoot":"","sources":["../../src/server/pipeline-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"pipeline-helpers.d.ts","sourceRoot":"","sources":["../../src/server/pipeline-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAU9C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,OAAO,EAA+B,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAElF,OAAO,EAAsC,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAClG,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAuC,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAUvD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CACtB,GAAG,EAAE,OAAO,EACZ,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,YAAY,GACvB,QAAQ,GAAG,IAAI,CAWjB;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,OAAO,EACZ,aAAa,EAAE,MAAM,EACrB,kBAAkB,EAAE,OAAO,EAC3B,UAAU,EAAE,YAA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BAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,OAAO,EACZ,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAA;CAAO,GAC5E,IAAI,CAIN;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,OAAO,EACZ,QAAQ,CAAC,EAAE,SAAS,mBAAmB,EAAE,GACxC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,CAwBzC;AAiBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,EAC5B,GAAG,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC5B,OAAO,CAAC,IAAI,CAAC,CAgBf"}
|
|
@@ -202,16 +202,19 @@ export interface PipelineConfig {
|
|
|
202
202
|
* value that `handleRequest` and `matchRoute` use. Do NOT re-derive it
|
|
203
203
|
* from `req.url` (which re-encodes).
|
|
204
204
|
*
|
|
205
|
-
* The `reenter` parameter
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
* (
|
|
210
|
-
*
|
|
205
|
+
* The `reenter` parameter renders the page for a no-JS action that did
|
|
206
|
+
* not redirect. It enters the pipeline after proxy.ts: the synthetic GET
|
|
207
|
+
* is an internal render of the POST's answer, not a second wire request,
|
|
208
|
+
* so it keeps the POST's trace ID and is neither proxied nor logged again
|
|
209
|
+
* (TIM-1445). Route matching, middleware.ts and access.ts run as for any
|
|
210
|
+
* page render. It runs in its own request context: the GET, with the
|
|
211
|
+
* reentry's `cookies` as its parsed cookies and its `formState` or
|
|
212
|
+
* `actionError` for the render (`runWithRequestContext`'s options).
|
|
211
213
|
*
|
|
212
214
|
* Moved into the pipeline (TIM-1213) so proxy.ts runs on action POSTs,
|
|
213
215
|
* matching the design doc contract: "proxy.ts runs on every request,
|
|
214
|
-
* no exclusions."
|
|
216
|
+
* no exclusions." It runs once per wire request; the outer pass wraps
|
|
217
|
+
* the rerendered response.
|
|
215
218
|
*/
|
|
216
219
|
dispatchAction?: (req: Request, canonicalPath: string, reenter: (req: Request, reentry: PipelineReentry) => Promise<Response>) => Promise<Response | null>;
|
|
217
220
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/server/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAa3D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAQ5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAK9D;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,mDAAmD;IACnD,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC;;;;OAIG;IACH,aAAa,EAAE,aAAa,CAAC;IAC7B;;;;;OAKG;IACH,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IACpD,oEAAoE;IACpE,eAAe,EAAE,YAAY,EAAE,CAAC;CACjC;AAED,6DAA6D;AAC7D,MAAM,MAAM,YAAY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H,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAsS1F"}
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
* is deliberately NOT part of identity).
|
|
41
41
|
*/
|
|
42
42
|
import type { CoercedParams } from '../../shared/param-value.ts';
|
|
43
|
+
import type { SlotParamsRecord } from '../../shared/slot-params.ts';
|
|
43
44
|
/**
|
|
44
45
|
* Canonicalize a single value, or null if it is unkeyable. The ONE
|
|
45
46
|
* definition of "faithfully comparable" — every prebuilt code path that
|
|
@@ -60,4 +61,29 @@ export declare function splitSlotProps(props: Record<string, unknown>, slots: re
|
|
|
60
61
|
* caller must fall back to dynamic rendering.
|
|
61
62
|
*/
|
|
62
63
|
export declare function computeComponentCacheKey(props: Record<string, unknown>, params: CoercedParams): string | null;
|
|
64
|
+
/**
|
|
65
|
+
* Resolve the params the cache key may faithfully hash, or null if this
|
|
66
|
+
* render is unkeyable.
|
|
67
|
+
*
|
|
68
|
+
* A wrapper rendered inside a parallel slot reads params merged with that
|
|
69
|
+
* slot's overrides (`getSegmentParams`: `{...segmentParams, ...slotParams}`)
|
|
70
|
+
* — but the cache key hashes only the route-level params, and the wrapper
|
|
71
|
+
* cannot know which slot it renders under. The route params are usable
|
|
72
|
+
* only when every slot's merged view canonicalizes identically to them;
|
|
73
|
+
* otherwise two renders with the same key could see different effective
|
|
74
|
+
* inputs and a hit could serve the WRONG cached subtree — so the render
|
|
75
|
+
* goes live: slower, never wrong. (Build-time capture doesn't model slot
|
|
76
|
+
* params either, so a divergent request could never have a faithful
|
|
77
|
+
* entry. Codex review on PR #835; revisit with segment-path-scoped keys
|
|
78
|
+
* if slot-scoped prebuilt is ever needed.)
|
|
79
|
+
*
|
|
80
|
+
* Comparison happens through `tryCanonicalize` — the same single
|
|
81
|
+
* definition of value equality the cache key uses — so anything it
|
|
82
|
+
* cannot represent faithfully (bigint-coerced codec params, accessors,
|
|
83
|
+
* aliases, …) is unkeyable here too, and this guard can never throw.
|
|
84
|
+
*/
|
|
85
|
+
export declare function resolveKeyParams(store: {
|
|
86
|
+
segmentParams?: CoercedParams;
|
|
87
|
+
slotParams?: SlotParamsRecord;
|
|
88
|
+
}): CoercedParams | null;
|
|
63
89
|
//# sourceMappingURL=cache-key.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-key.d.ts","sourceRoot":"","sources":["../../../src/server/prebuilt/cache-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"cache-key.d.ts","sourceRoot":"","sources":["../../../src/server/prebuilt/cache-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAsGpE;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAM7D;AAsDD,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB;IAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,IAAI,CAqCpF;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,MAAM,EAAE,aAAa,GACpB,MAAM,GAAG,IAAI,CAkCf;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B,GAAG,aAAa,GAAG,IAAI,CAcvB"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* One build-time capture entry
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* One build-time capture entry: render a registered component in isolation
|
|
3
|
+
* under the synthetic build store and drain its flight payload under a
|
|
4
|
+
* deadline. Run by the post-build capture pass (server/prebuilt-builder.ts)
|
|
5
|
+
* and, in dev, by the first request for a prerender entry
|
|
6
|
+
* (server/prebuilt-runtime.ts, TIM-1588) — which is why the flight renderer
|
|
7
|
+
* is a parameter: the request-time runtime renders through the functions
|
|
8
|
+
* the RSC entry injected.
|
|
5
9
|
*/
|
|
6
10
|
import type { CoercedParams } from '../../shared/param-value.ts';
|
|
11
|
+
import { type RenderFlight } from '../flight-source.ts';
|
|
7
12
|
import type { PrebuiltRegistration } from '../prebuilt-runtime.ts';
|
|
8
13
|
import { type NestedWrapperRender } from './capture-state.ts';
|
|
9
14
|
/** Wrap payload bytes as a single-chunk stream for the smoke revival. */
|
|
@@ -21,5 +26,5 @@ export interface EntryOutcome {
|
|
|
21
26
|
* a payload with an embedded error row would replay that error on every
|
|
22
27
|
* future request, so only fully clean renders are captured.
|
|
23
28
|
*/
|
|
24
|
-
export declare function renderEntry(registration: PrebuiltRegistration, props: Record<string, unknown>, coercedParams: CoercedParams, timeoutMs: number, isLayout: boolean): Promise<EntryOutcome>;
|
|
29
|
+
export declare function renderEntry(registration: PrebuiltRegistration, props: Record<string, unknown>, coercedParams: CoercedParams, timeoutMs: number, isLayout: boolean, renderFlight: RenderFlight): Promise<EntryOutcome>;
|
|
25
30
|
//# sourceMappingURL=capture-render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-render.d.ts","sourceRoot":"","sources":["../../../src/server/prebuilt/capture-render.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"capture-render.d.ts","sourceRoot":"","sources":["../../../src/server/prebuilt/capture-render.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAKlF,yEAAyE;AACzE,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,CAO3E;AASD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,YAAY,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACnC,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,YAAY,EAAE,oBAAoB,EAClC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,OAAO,EACjB,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,YAAY,CAAC,CA6DvB"}
|
|
@@ -21,7 +21,7 @@ export interface CandidateRoute {
|
|
|
21
21
|
* layouts above it) has prebuilt components attributed to it. Slots and
|
|
22
22
|
* intercepting/private segments are not walked — slot-scoped prebuilt is
|
|
23
23
|
* already unkeyable at request time when slot params diverge (see
|
|
24
|
-
* resolveKeyParams in prebuilt-
|
|
24
|
+
* resolveKeyParams in prebuilt/cache-key.ts), so the build doesn't model
|
|
25
25
|
* slots either.
|
|
26
26
|
*/
|
|
27
27
|
export declare function collectCandidateRoutes(root: ManifestSegmentNode, fileComponentMap: Record<string, string[]>): CandidateRoute[];
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dev-mode store for cache.component output (TIM-1588, design/44 §Dev Mode).
|
|
3
|
+
*
|
|
4
|
+
* In production a `prerender` entry is captured at build time and frozen
|
|
5
|
+
* until the next deploy. Dev has no build step, so this in-memory store
|
|
6
|
+
* stands in for the build artifact: a prerender-tier render is captured on
|
|
7
|
+
* its first request (under the synthetic build store, so request-context
|
|
8
|
+
* reads fail exactly as `pnpm build` would) and served from here after
|
|
9
|
+
* that. Runtime-tier entries (`ttl`/`tags`) keep using the cache-handler
|
|
10
|
+
* overlay; in dev their keys carry this store's namespace (`overlayKey`).
|
|
11
|
+
*
|
|
12
|
+
* Invalidation is deliberately coarse: ANY dev-server watcher event clears
|
|
13
|
+
* everything. The dev-server plugin sends `PREBUILT_DEV_CLEAR_EVENT` to the
|
|
14
|
+
* RSC environment and the RSC entry calls `clearDevPrebuiltStore()`. There
|
|
15
|
+
* is no per-component dependency tracking — the module graph misses files
|
|
16
|
+
* read with `fs`, and one re-render per save is what dev used to pay on
|
|
17
|
+
* every request. A clear does three things:
|
|
18
|
+
*
|
|
19
|
+
* 1. drops every seed;
|
|
20
|
+
* 2. bumps the generation, which namespaces dev overlay keys, so
|
|
21
|
+
* runtime-tier entries stored before the save become unreachable;
|
|
22
|
+
* 3. records an invalidation of everything (`recordInvalidationOfAll`),
|
|
23
|
+
* so a capture already in flight — which may have loaded the
|
|
24
|
+
* pre-save code — is not stored, and a request arriving after the
|
|
25
|
+
* save does not join that flight (the TIM-1028 guard every capture
|
|
26
|
+
* path already runs).
|
|
27
|
+
*
|
|
28
|
+
* Inactive outside dev: production never enables it. Dev enables it only
|
|
29
|
+
* when HMR is on — with `server.hmr: false` Vite delivers no watcher events
|
|
30
|
+
* to plugins and nothing would clear the store, so dev bypasses caching
|
|
31
|
+
* entirely instead (`DevPrebuiltStoreMode`).
|
|
32
|
+
*/
|
|
33
|
+
/** Custom HMR event the dev-server plugin sends to the RSC environment. */
|
|
34
|
+
export declare const PREBUILT_DEV_CLEAR_EVENT = "timber:prebuilt-dev-clear";
|
|
35
|
+
/** One captured prerender-tier entry — the dev counterpart of a `.flight` seed. */
|
|
36
|
+
export interface DevSeed {
|
|
37
|
+
bytes: Uint8Array;
|
|
38
|
+
/** Resolved tags, so `revalidateTag` can drop an ISR seed. */
|
|
39
|
+
tags: string[];
|
|
40
|
+
/** Capture time; stands in for the manifest's buildTimestamp. */
|
|
41
|
+
capturedAt: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* - `off`: production (and the default). Wrappers use the build artifact and
|
|
45
|
+
* the overlay.
|
|
46
|
+
* - `active`: dev with HMR. The dev store stands in for the build artifact.
|
|
47
|
+
* - `bypass`: dev without HMR (`server.hmr: false`). No watcher event would
|
|
48
|
+
* ever reach the store, so nothing is cached at all: every wrapper renders
|
|
49
|
+
* live, runtime-tier ones included (the overlay would otherwise hold
|
|
50
|
+
* entries a save never clears).
|
|
51
|
+
*/
|
|
52
|
+
export type DevPrebuiltStoreMode = 'off' | 'active' | 'bypass';
|
|
53
|
+
/** Set by the RSC entry in dev (and by tests). The store starts empty either way. */
|
|
54
|
+
export declare function setDevPrebuiltStoreMode(next: DevPrebuiltStoreMode): void;
|
|
55
|
+
export declare function isDevPrebuiltStoreActive(): boolean;
|
|
56
|
+
/** Dev without HMR: every cache.component wrapper renders live. */
|
|
57
|
+
export declare function isDevPrebuiltCacheBypassed(): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Namespace for overlay keys while the dev store is active, in place of the
|
|
60
|
+
* deployment ID (which is null in dev). Changes on every clear. Null when
|
|
61
|
+
* inactive.
|
|
62
|
+
*/
|
|
63
|
+
export declare function devOverlayNamespace(): string | null;
|
|
64
|
+
/**
|
|
65
|
+
* The key a `cache.data` entry is stored under: the logical key, prefixed in
|
|
66
|
+
* dev with the namespace above. So a save makes every data entry stored
|
|
67
|
+
* before it unreachable, whatever the handler. A data function's ID comes
|
|
68
|
+
* from its call site, so editing a helper it calls, or a file it reads,
|
|
69
|
+
* would otherwise keep serving the old result to every component captured
|
|
70
|
+
* after the save. Invalidation epochs and singleflight stay on the logical
|
|
71
|
+
* key; only the handler sees the prefix.
|
|
72
|
+
*/
|
|
73
|
+
export declare function devDataCacheKey(key: string): string;
|
|
74
|
+
export declare function getDevSeed(componentId: string, cacheKey: string): DevSeed | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Store a captured seed. The caller has already checked that no clear (or
|
|
77
|
+
* tag invalidation) happened while it was capturing.
|
|
78
|
+
*/
|
|
79
|
+
export declare function setDevSeed(componentId: string, cacheKey: string, seed: DevSeed): void;
|
|
80
|
+
/** Drop everything — called on every dev-server watcher event. */
|
|
81
|
+
export declare function clearDevPrebuiltStore(): void;
|
|
82
|
+
/**
|
|
83
|
+
* A hard reload: discard one entry — its seed and its overlay record — so
|
|
84
|
+
* the request renders it again. Recorded as an invalidation of its key
|
|
85
|
+
* first, so a capture of it already in flight (which may have read the old
|
|
86
|
+
* external data) neither stores nor is joined by this request.
|
|
87
|
+
*/
|
|
88
|
+
export declare function discardDevEntry(componentId: string, cacheKey: string, overlayKey: string): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* `revalidateTag` in dev: drop the seeds carrying the tag. This is the dev
|
|
91
|
+
* counterpart of writing a tombstone over a build seed (design/45 §ISR
|
|
92
|
+
* mechanics) — the next request misses and captures again.
|
|
93
|
+
*/
|
|
94
|
+
export declare function invalidateDevSeedsByTag(tag: string): void;
|
|
95
|
+
/**
|
|
96
|
+
* Whether the request asks to skip caches — a browser hard reload, or any
|
|
97
|
+
* request while DevTools "Disable cache" is on, sends `Cache-Control:
|
|
98
|
+
* no-cache`. Dev only: the escape hatch for components that read external
|
|
99
|
+
* data (a CMS, a database) while it is being edited. Production never
|
|
100
|
+
* honors it — a client must not be able to force cache.component re-renders.
|
|
101
|
+
*/
|
|
102
|
+
export declare function isHardReload(headers: Headers): boolean;
|
|
103
|
+
//# sourceMappingURL=dev-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-store.d.ts","sourceRoot":"","sources":["../../../src/server/prebuilt/dev-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,2EAA2E;AAC3E,eAAO,MAAM,wBAAwB,8BAA8B,CAAC;AAEpE,mFAAmF;AACnF,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,UAAU,CAAC;IAClB,8DAA8D;IAC9D,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAoB/D,qFAAqF;AACrF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAGxE;AAED,wBAAgB,wBAAwB,IAAI,OAAO,CAElD;AAED,mEAAmE;AACnE,wBAAgB,0BAA0B,IAAI,OAAO,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,GAAG,IAAI,CAInD;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAErF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAErF;AAED,kEAAkE;AAClE,wBAAgB,qBAAqB,IAAI,IAAI,CAI5C;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAIzD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEtD"}
|
|
@@ -36,6 +36,11 @@ export interface ComponentTombstoneRecord {
|
|
|
36
36
|
}
|
|
37
37
|
export declare function isOverlayRecord(v: unknown): v is ComponentOverlayRecord;
|
|
38
38
|
export declare function isTombstone(v: unknown): v is ComponentTombstoneRecord;
|
|
39
|
+
/**
|
|
40
|
+
* In dev the deployment ID is null; the dev store namespace stands in for
|
|
41
|
+
* it and changes on every source change, so entries stored before a save
|
|
42
|
+
* become unreachable (server/prebuilt/dev-store.ts).
|
|
43
|
+
*/
|
|
39
44
|
export declare function overlayKey(componentId: string, cacheKey: string): string;
|
|
40
45
|
export interface OverlayLookupResult {
|
|
41
46
|
kind: 'fresh' | 'stale' | 'tombstone';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../src/server/prebuilt/overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../src/server/prebuilt/overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAW5D;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,IAAI,CAAC;IACT,2CAA2C;IAC3C,CAAC,EAAE,MAAM,CAAC;IACV,4DAA4D;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C,MAAM,EAAE,WAAW,EAAE,CAAC,GAAG,IAAI,CAE/D;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBtE;AA8BD;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
|
|
@@ -76,4 +76,12 @@ export declare function getManifestEntry(componentId: string, cacheKey: string):
|
|
|
76
76
|
* read to every request.
|
|
77
77
|
*/
|
|
78
78
|
export declare function lookupPrebuiltPayload(componentId: string, cacheKey: string): Promise<Uint8Array | null>;
|
|
79
|
+
/** A seed entry: build artifact bytes, or their dev-store counterpart. */
|
|
80
|
+
export interface Seed {
|
|
81
|
+
payload: Uint8Array;
|
|
82
|
+
/** When the seed was rendered — the logical start of its `ttl`. */
|
|
83
|
+
capturedAt: number;
|
|
84
|
+
}
|
|
85
|
+
/** The build-artifact seed for an entry, or null if the build has none. */
|
|
86
|
+
export declare function lookupArtifactSeed(id: string, cacheKey: string, needsTimestamp: boolean): Promise<Seed | null>;
|
|
79
87
|
//# sourceMappingURL=payload-source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload-source.d.ts","sourceRoot":"","sources":["../../../src/server/prebuilt/payload-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,MAAM,WAAW,qBAAqB;IACpC,oDAAoD;IACpD,MAAM,EAAE,aAAa,CAAC;IACtB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,CAAC,WAAW,EAAE,MAAM,GAAG;QACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;QAC/C,uFAAuF;QACvF,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC5B,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,YAAY,IAAI,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACjD,yEAAyE;IACzE,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CACvD;AAsED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,GAAG,IAAI,CAIjF;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAElD;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAI1D;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAK9E;AAED,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAKvC;AAED;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAmB5B"}
|
|
1
|
+
{"version":3,"file":"payload-source.d.ts","sourceRoot":"","sources":["../../../src/server/prebuilt/payload-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,MAAM,WAAW,qBAAqB;IACpC,oDAAoD;IACpD,MAAM,EAA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WAAW,IAAI;IACnB,OAAO,EAAE,UAAU,CAAC;IACpB,mEAAmE;IACnE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,2EAA2E;AAC3E,wBAAsB,kBAAkB,CACtC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,OAAO,GACtB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAKtB"}
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* TIM-1181 layout mechanism to explicitly declared, named slots on any
|
|
9
9
|
* cached component. Layouts use the same mechanism with a `children` slot.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* The `__prebuilt` wrapper builds its slot render from these helpers, in
|
|
12
|
+
* dev and production alike. See design/45-cache-lifetimes.md §Slot
|
|
13
|
+
* Components.
|
|
14
14
|
*/
|
|
15
15
|
import type { PrebuiltComponentOptions } from '../prebuilt-runtime.ts';
|
|
16
16
|
/**
|
|
@@ -73,9 +73,8 @@ export type SlotResolution = {
|
|
|
73
73
|
slots: string[];
|
|
74
74
|
};
|
|
75
75
|
/**
|
|
76
|
-
* Validate the `slots` option.
|
|
77
|
-
*
|
|
78
|
-
* active in production, so the tree shape a component sees never
|
|
76
|
+
* Validate the `slots` option. The `__prebuilt` wrapper gates on this in
|
|
77
|
+
* dev and production alike, so the tree shape a component sees never
|
|
79
78
|
* diverges between the two.
|
|
80
79
|
*/
|
|
81
80
|
export declare function resolveSlotNames(id: string, options: PrebuiltComponentOptions): SlotResolution;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../src/server/prebuilt/slots.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AASH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEvE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AAExD;;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OAAO,CAAC,IAAI,CAAC,CAAC;IACjD;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,mDAAmD;IACnD,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yDAAyD;IACzD,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AA6CD;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,cAAc,CAAC,CAmUzB"}
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
* cache.component (TIM-1140).
|
|
5
5
|
*
|
|
6
6
|
* `cache.component(fn, opts)` call sites are rewritten at build time to
|
|
7
|
-
* `__prebuilt(stableId, fn, opts)
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* `__prebuilt(stableId, fn, opts)`, in dev and production alike. It is
|
|
8
|
+
* exported via #server-internal — framework plumbing, never called by user
|
|
9
|
+
* code directly. In dev the build artifact is replaced by the in-memory dev
|
|
10
|
+
* store (prebuilt/dev-store.ts): a prerender entry is captured on its first
|
|
11
|
+
* request and served until a watched file changes (TIM-1588).
|
|
10
12
|
*
|
|
11
13
|
* Cache hits are served by FLIGHT REVIVAL: the cached `.flight` payload is
|
|
12
14
|
* decoded back into React elements inside the RSC environment with
|
|
@@ -99,12 +101,5 @@ export declare function __prebuilt<C extends ServerComponent>(id: string, compon
|
|
|
99
101
|
export declare function getPrebuiltRegistration(id: string): PrebuiltRegistration | undefined;
|
|
100
102
|
/** All registrations, for the post-build capture pass (TIM-1119). */
|
|
101
103
|
export declare function getPrebuiltRegistry(): ReadonlyMap<string, PrebuiltRegistration>;
|
|
102
|
-
/**
|
|
103
|
-
* Dev-mode wrapper injected by the timber-prebuilt transform: a no-op that
|
|
104
|
-
* renders the component dynamically on every request, logging once per
|
|
105
|
-
* component on first render so the production behavior difference is visible.
|
|
106
|
-
* See design/44 §Dev Mode.
|
|
107
|
-
*/
|
|
108
|
-
export declare function __prebuiltDev<C extends ServerComponent>(name: string, component: C, options?: PrebuiltComponentOptions): C;
|
|
109
104
|
export {};
|
|
110
105
|
//# sourceMappingURL=prebuilt-runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prebuilt-runtime.d.ts","sourceRoot":"","sources":["../../src/server/prebuilt-runtime.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"prebuilt-runtime.d.ts","sourceRoot":"","sources":["../../src/server/prebuilt-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AA8CH,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAkB3E;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAGlE;AAYD;;;;;;GAMG;AACH,MAAM,WAAW,wBAAwB;IACvC,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kEAAkE;IAClE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC;IACjE,2EAA2E;IAC3E,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;;;OAIG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;CAC1C;AAED,2DAA2D;AAE3D,KAAK,eAAe,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC;AAY/C,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,EAAE,wBAAwB,CAAC;CACnC;AAoDD,UAAU,YAAY;IACpB,wBAAwB,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACnF,YAAY,EAAE,YAAY,CAAC;CAC5B;AAID;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,CAEvD;AAidD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,eAAe,EAClD,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,CAAC,EACZ,OAAO,GAAE,wBAA6B,GACrC,CAAC,CAsFH;AAED,qDAAqD;AACrD,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAEpF;AAED,qEAAqE;AACrE,wBAAgB,mBAAmB,IAAI,WAAW,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAE/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-timeout.d.ts","sourceRoot":"","sources":["../../src/server/render-timeout.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"render-timeout.d.ts","sourceRoot":"","sources":["../../src/server/render-timeout.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,+DAA+D;AAC/D,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,SAAU,CAAC;AAEjD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAE7E;AAED;;;;;GAKG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAA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EAAE,eAAe,KAAK,OAAO,CAAC,QAAQ,CAAC,KACnE,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAkE5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/index.ts"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/index.ts"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAoDlE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAEjD;AAgWD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAInE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAItE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,wBAAwB,EAAE,cAAc,GACvD,OAAO,CAAC,OAAO,wBAAwB,EAAE,cAAc,CAAC,CAE1D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,OAAO,wBAAwB,EAAE,uBAAuB,GAChE,OAAO,CAAC,OAAO,wBAAwB,EAAE,uBAAuB,CAAC,CAQnE;8BA0CoB,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-render.d.ts","sourceRoot":"","sources":["../../src/server/ssr-render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM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ACzC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,EAClC,MAAM,CAAC,EAAE,WAAW,EACpB,KAAK,CAAC,EAAE,MAAM,GACb,cAAc,CAAC,UAAU,CAAC,CA2B5B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,GAAG,YAAY,CAM1F"}
|
|
@@ -118,6 +118,8 @@ export default function Page() {
|
|
|
118
118
|
| `ttl`/`tags` only | — | Rendered + stored on first request |
|
|
119
119
|
| `prerender` + `ttl`/`tags` | Built at deploy | Rendered + stored on first request |
|
|
120
120
|
|
|
121
|
+
In dev there is no build, so a `prerender` entry renders on its first request for each set of params. It stays in memory until any file changes. A request with `Cache-Control: no-cache` (a hard reload) renders it again. See [Caching → In Development](/docs/caching#in-development).
|
|
122
|
+
|
|
121
123
|
### Slots
|
|
122
124
|
|
|
123
125
|
Cache a wrapper component's output as a shell with holes for live children:
|
|
@@ -234,6 +234,18 @@ export async function generateStaticSegmentParams() {
|
|
|
234
234
|
|
|
235
235
|
Layout `prerender` cascades to descendant pages unless a closer layout or page overrides it.
|
|
236
236
|
|
|
237
|
+
### In Development
|
|
238
|
+
|
|
239
|
+
`timber dev` caches component output too, so a heavy prerendered page (MDX, syntax highlighting, content walks) renders once instead of on every navigation:
|
|
240
|
+
|
|
241
|
+
- A `prerender` component renders on its first request for each set of params. It is served from memory after that. You don't need `generateStaticSegmentParams` in dev.
|
|
242
|
+
- Saving any file the dev server watches clears every cached component, so the next request renders again. That includes a child component and a markdown file you read with `fs`. Files outside your project root (or in `node_modules`) aren't watched.
|
|
243
|
+
- `ttl` and `tags` work as they do in production, and `revalidateTag` invalidates them.
|
|
244
|
+
- A save clears `cache.data` results too, so a component that reads a file through a cached function picks up the edit.
|
|
245
|
+
- Reading `getCookieJar()`, `getHeaders()`, or search params in a `prerender` component fails in dev with the same error the build reports.
|
|
246
|
+
|
|
247
|
+
If a component reads data that changes without a file save (a CMS, a database), hard-reload the page. A request with `Cache-Control: no-cache` renders every cached component again. DevTools sends that header on every request while "Disable cache" is checked.
|
|
248
|
+
|
|
237
249
|
### Slots: Dynamic Children Through a Cached Shell
|
|
238
250
|
|
|
239
251
|
When the expensive part is a wrapper (nav, sidebar, layout chrome) but its children are dynamic, use `slots` to cache the shell with holes for live content:
|
|
@@ -61,6 +61,8 @@ export default async function proxy(req: Request, next: () => Promise<Response>)
|
|
|
61
61
|
|
|
62
62
|
`proxy.ts` has `next()` — it can wrap the entire request lifecycle. This is where you observe and modify responses.
|
|
63
63
|
|
|
64
|
+
A form submitted without JavaScript is one request to `proxy.ts`. When its action doesn't redirect, the re-rendered page is produced inside the same `next()`: `proxy.ts` sees the `POST`, not a second `GET`. `middleware.ts` and `access.ts` still run for that page render.
|
|
65
|
+
|
|
64
66
|
## `middleware.ts` — Per-Segment Middleware
|
|
65
67
|
|
|
66
68
|
`middleware.ts` files run after route matching, before rendering. They're scoped to their route segment.
|
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.221",
|
|
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/cache/cache-api.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { createCache } from './timber-cache.ts';
|
|
|
4
4
|
import { getCacheHandler } from './handler-store.ts';
|
|
5
5
|
import { recordInvalidation } from './invalidation-epoch.ts';
|
|
6
6
|
import { writeTombstonesForTag } from '../server/prebuilt/overlay.ts';
|
|
7
|
+
import { devDataCacheKey, invalidateDevSeedsByTag } from '../server/prebuilt/dev-store.ts';
|
|
7
8
|
import { getCdnPurgeHandler } from '../cdn/purge-store.ts';
|
|
8
9
|
|
|
9
10
|
const componentFallbackWarned = new WeakSet<object>();
|
|
@@ -50,13 +51,18 @@ export const cache = {
|
|
|
50
51
|
// Record before the handler delete so a cached fn in flight skips its
|
|
51
52
|
// post-resolve set instead of resurrecting the invalidated value (TIM-1028).
|
|
52
53
|
recordInvalidation(opts);
|
|
53
|
-
await getCacheHandler().invalidate(
|
|
54
|
+
await getCacheHandler().invalidate(
|
|
55
|
+
opts.key === undefined ? opts : { ...opts, key: devDataCacheKey(opts.key) }
|
|
56
|
+
);
|
|
54
57
|
// Write tombstones for build-seed entries carrying the tag (design/45
|
|
55
58
|
// §ISR mechanics). Runs AFTER handler.invalidate so the tombstone
|
|
56
59
|
// overwrites the cleared overlay slot. This covers ALL invalidation
|
|
57
60
|
// paths — actions, webhooks, route handlers — not just executeAction.
|
|
58
61
|
if (opts.tag) {
|
|
59
62
|
await writeTombstonesForTag(opts.tag);
|
|
63
|
+
// Dev has no build seeds to tombstone — its seeds live in the dev
|
|
64
|
+
// store, so drop them instead (no-op outside dev, TIM-1588).
|
|
65
|
+
invalidateDevSeedsByTag(opts.tag);
|
|
60
66
|
}
|
|
61
67
|
// Trigger CDN purge if a handler is configured (design/25 §Layer 2).
|
|
62
68
|
// Purge is best-effort: a CDN API failure or timeout must not block
|
|
@@ -18,10 +18,47 @@ let handler: CacheHandlerLike | null = null;
|
|
|
18
18
|
|
|
19
19
|
let explicitlyConfigured = false;
|
|
20
20
|
|
|
21
|
-
/**
|
|
21
|
+
/** Whether `handler` came from timber.cache.ts (applyConfiguredCacheHandler). */
|
|
22
|
+
let fromCacheConfig = false;
|
|
23
|
+
|
|
24
|
+
/** The handler last installed by a direct setCacheHandler() call, if any. */
|
|
25
|
+
let directHandler: CacheHandlerLike | null = null;
|
|
26
|
+
|
|
27
|
+
/** Replace the active cache handler. */
|
|
22
28
|
export function setCacheHandler(h: CacheHandlerLike): void {
|
|
23
29
|
handler = h;
|
|
24
30
|
explicitlyConfigured = true;
|
|
31
|
+
fromCacheConfig = false;
|
|
32
|
+
directHandler = h;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Apply the handler timber.cache.ts exports, or `null` when it exports none.
|
|
37
|
+
* Called on every run of the RSC entry. In dev the entry re-runs after an
|
|
38
|
+
* edit while this module keeps its state (design/21 §HMR Wiring), so a
|
|
39
|
+
* handler removed from timber.cache.ts must be dropped here, not kept
|
|
40
|
+
* serving. A handler installed by a direct setCacheHandler() call (from
|
|
41
|
+
* register(), say) is left in place when the file exports none, and comes
|
|
42
|
+
* back when a configured handler that replaced it is removed.
|
|
43
|
+
*/
|
|
44
|
+
export function applyConfiguredCacheHandler(h: CacheHandlerLike | null): void {
|
|
45
|
+
if (h) {
|
|
46
|
+
handler = h;
|
|
47
|
+
explicitlyConfigured = true;
|
|
48
|
+
fromCacheConfig = true;
|
|
49
|
+
} else if (fromCacheConfig) {
|
|
50
|
+
handler = directHandler;
|
|
51
|
+
explicitlyConfigured = directHandler !== null;
|
|
52
|
+
fromCacheConfig = false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** @internal — reset for tests only. */
|
|
57
|
+
export function _resetCacheHandler(): void {
|
|
58
|
+
handler = null;
|
|
59
|
+
explicitlyConfigured = false;
|
|
60
|
+
fromCacheConfig = false;
|
|
61
|
+
directHandler = null;
|
|
25
62
|
}
|
|
26
63
|
|
|
27
64
|
/** Whether the handler was explicitly configured (vs the default in-memory fallback). */
|
|
@@ -34,11 +34,12 @@ const lastInvalidated = new Map<string, number>();
|
|
|
34
34
|
const MAX_TRACKED_ENTRIES = 10_000;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
37
|
+
* Every execution that started at or before this epoch counts as
|
|
38
|
+
* invalidated. Raised by eviction (history was truncated, so we can no
|
|
39
|
+
* longer prove an execution wasn't invalidated) and by
|
|
40
|
+
* `recordInvalidationOfAll()`.
|
|
40
41
|
*/
|
|
41
|
-
let
|
|
42
|
+
let invalidatedEpochFloor = 0;
|
|
42
43
|
|
|
43
44
|
/** The current epoch. Capture before running fn(), pass to wasInvalidatedSince. */
|
|
44
45
|
export function currentInvalidationEpoch(): number {
|
|
@@ -55,13 +56,24 @@ export function recordInvalidation(opts: { key?: string; tag?: string }): void {
|
|
|
55
56
|
if (opts.tag) track(`tag:${opts.tag}`);
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Record an invalidation of every key and tag at once. The dev server
|
|
61
|
+
* calls this on a source change (server/prebuilt/dev-store.ts): any cached
|
|
62
|
+
* render in flight may have loaded the pre-change code, so none of them may
|
|
63
|
+
* store, and a caller arriving after the change must not join their flight.
|
|
64
|
+
*/
|
|
65
|
+
export function recordInvalidationOfAll(): void {
|
|
66
|
+
epoch++;
|
|
67
|
+
invalidatedEpochFloor = epoch;
|
|
68
|
+
}
|
|
69
|
+
|
|
58
70
|
function track(entry: string): void {
|
|
59
71
|
lastInvalidated.delete(entry);
|
|
60
72
|
lastInvalidated.set(entry, epoch);
|
|
61
73
|
while (lastInvalidated.size > MAX_TRACKED_ENTRIES) {
|
|
62
74
|
const oldest = lastInvalidated.entries().next().value;
|
|
63
75
|
if (oldest === undefined) break;
|
|
64
|
-
|
|
76
|
+
invalidatedEpochFloor = Math.max(invalidatedEpochFloor, oldest[1]);
|
|
65
77
|
lastInvalidated.delete(oldest[0]);
|
|
66
78
|
}
|
|
67
79
|
}
|
|
@@ -82,7 +94,7 @@ export function wasInvalidatedSince(startEpoch: number, key: string, tags: strin
|
|
|
82
94
|
* issued to discard.
|
|
83
95
|
*/
|
|
84
96
|
export function lastInvalidationEpochFor(key: string, tags: string[]): number {
|
|
85
|
-
let last =
|
|
97
|
+
let last = invalidatedEpochFloor;
|
|
86
98
|
const keyEpoch = lastInvalidated.get(`key:${key}`);
|
|
87
99
|
if (keyEpoch !== undefined && keyEpoch > last) last = keyEpoch;
|
|
88
100
|
for (const tag of tags) {
|