@timber-js/app 0.2.0-alpha.243 → 0.2.0-alpha.245
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-DoTj0Jd3.js → actions-C7_xl9iA.js} +12 -8
- package/dist/_chunks/actions-C7_xl9iA.js.map +1 -0
- package/dist/_chunks/als-registry-C-iwbtvI.js.map +1 -1
- package/dist/_chunks/{cli-check-DlQBSKIN.js → cli-check-CetL-6Us.js} +5 -5
- package/dist/_chunks/cli-check-CetL-6Us.js.map +1 -0
- package/dist/_chunks/{codegen-vaCyFyVN.js → codegen-BxJGInWa.js} +76 -20
- package/dist/_chunks/codegen-BxJGInWa.js.map +1 -0
- package/dist/_chunks/{convention-lint-CGGcseNn.js → convention-lint-BWbKAV4x.js} +51 -15
- package/dist/_chunks/convention-lint-BWbKAV4x.js.map +1 -0
- package/dist/_chunks/{dev-server-LO4McfQi.js → dev-server-BZxFJNih.js} +66 -9
- package/dist/_chunks/{dev-server-LO4McfQi.js.map → dev-server-BZxFJNih.js.map} +1 -1
- package/dist/_chunks/dev-server-C72bB9Kg.js +1 -0
- package/dist/_chunks/{key-headers-uIig1_mU.js → key-headers-CVpa6fpW.js} +6 -2
- package/dist/_chunks/key-headers-CVpa6fpW.js.map +1 -0
- package/dist/cli-check.d.ts +3 -3
- package/dist/cli-check.d.ts.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/config-types.d.ts +43 -22
- package/dist/config-types.d.ts.map +1 -1
- package/dist/config-validation.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/native/rsc/manifest.json +2 -0
- package/dist/native/rsc/routing/descendant-params.js +28 -0
- package/dist/native/rsc/routing/descendant-params.js.map +1 -0
- package/dist/native/rsc/server/als-registry.js.map +1 -1
- package/dist/native/rsc/server/request-context.js +1 -1
- package/dist/native/rsc/server/request-context.js.map +1 -1
- package/dist/native/rsc/server/route-element-builder.js +4 -3
- package/dist/native/rsc/server/route-element-builder.js.map +1 -1
- package/dist/native/rsc/server/route-module-loader.js +5 -4
- package/dist/native/rsc/server/route-module-loader.js.map +1 -1
- package/dist/native/rsc/server/rsc-entry/render-route.js +1 -1
- package/dist/native/rsc/server/rsc-entry/render-route.js.map +1 -1
- package/dist/native/rsc/server/rsc-entry/revalidate-renderer.js +1 -1
- package/dist/native/rsc/server/rsc-entry/revalidate-renderer.js.map +1 -1
- package/dist/native/rsc/server/segment-lifetime/outlet-gate.js +2 -1
- package/dist/native/rsc/server/segment-lifetime/outlet-gate.js.map +1 -1
- package/dist/native/rsc/server/segment-lifetime/read-rule.js +9 -5
- package/dist/native/rsc/server/segment-lifetime/read-rule.js.map +1 -1
- package/dist/native/rsc/server/segment-lifetime/read-scope.js +3 -1
- package/dist/native/rsc/server/segment-lifetime/read-scope.js.map +1 -1
- package/dist/native/rsc/server/segment-lifetime/segment-key.js +15 -9
- package/dist/native/rsc/server/segment-lifetime/segment-key.js.map +1 -1
- package/dist/native/rsc/server/segment-lifetime/slot-outlets.js +6 -5
- package/dist/native/rsc/server/segment-lifetime/slot-outlets.js.map +1 -1
- package/dist/native/rsc/shared/key-headers.js +4 -1
- package/dist/native/rsc/shared/key-headers.js.map +1 -1
- package/dist/native/rsc/shared/layout-defaults.js +19 -0
- package/dist/native/rsc/shared/layout-defaults.js.map +1 -0
- package/dist/native/ssr/manifest.json +1 -0
- package/dist/native/ssr/server/als-registry.js.map +1 -1
- package/dist/native/ssr/server/request-context.js +1 -1
- package/dist/native/ssr/server/request-context.js.map +1 -1
- package/dist/native/ssr/server/segment-lifetime/outlet-gate.js +1 -0
- package/dist/native/ssr/server/segment-lifetime/outlet-gate.js.map +1 -1
- package/dist/native/ssr/server/segment-lifetime/read-rule.js +9 -5
- package/dist/native/ssr/server/segment-lifetime/read-rule.js.map +1 -1
- package/dist/native/ssr/server/segment-lifetime/read-scope.js.map +1 -1
- package/dist/native/ssr/shared/key-headers.js +4 -1
- package/dist/native/ssr/shared/key-headers.js.map +1 -1
- package/dist/native/ssr/shared/layout-defaults.js +9 -0
- package/dist/native/ssr/shared/layout-defaults.js.map +1 -0
- package/dist/plugins/entries.d.ts.map +1 -1
- package/dist/routing/codegen-types.d.ts +9 -0
- package/dist/routing/codegen-types.d.ts.map +1 -1
- package/dist/routing/codegen.d.ts.map +1 -1
- package/dist/routing/convention-lint.d.ts +2 -2
- package/dist/routing/convention-lint.d.ts.map +1 -1
- package/dist/routing/descendant-params.d.ts +46 -0
- package/dist/routing/descendant-params.d.ts.map +1 -0
- package/dist/routing/index.js +1 -1
- package/dist/routing/route-options-lint.d.ts +2 -2
- package/dist/routing/route-options-lint.d.ts.map +1 -1
- package/dist/routing/route-options.d.ts +1 -1
- package/dist/routing/route-options.d.ts.map +1 -1
- package/dist/server/als-registry.d.ts +13 -0
- package/dist/server/als-registry.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/internal.js +1 -1
- package/dist/server/internal.js.map +1 -1
- package/dist/server/route-element-builder.d.ts.map +1 -1
- package/dist/server/route-module-loader.d.ts +4 -3
- package/dist/server/route-module-loader.d.ts.map +1 -1
- package/dist/server/rsc-entry/index.d.ts.map +1 -1
- package/dist/server/rsc-entry/render-route.d.ts +3 -3
- package/dist/server/rsc-entry/render-route.d.ts.map +1 -1
- package/dist/server/rsc-entry/revalidate-renderer.d.ts +3 -3
- package/dist/server/rsc-entry/revalidate-renderer.d.ts.map +1 -1
- package/dist/server/segment-lifetime/outlet-gate.d.ts +5 -5
- package/dist/server/segment-lifetime/outlet-gate.d.ts.map +1 -1
- package/dist/server/segment-lifetime/read-rule.d.ts +8 -1
- package/dist/server/segment-lifetime/read-rule.d.ts.map +1 -1
- package/dist/server/segment-lifetime/read-scope.d.ts +8 -2
- package/dist/server/segment-lifetime/read-scope.d.ts.map +1 -1
- package/dist/server/segment-lifetime/segment-key.d.ts +28 -20
- package/dist/server/segment-lifetime/segment-key.d.ts.map +1 -1
- package/dist/server/segment-lifetime/slot-outlets.d.ts +2 -3
- package/dist/server/segment-lifetime/slot-outlets.d.ts.map +1 -1
- package/dist/server/types.d.ts +7 -5
- package/dist/server/types.d.ts.map +1 -1
- package/dist/shared/key-headers.d.ts +2 -0
- package/dist/shared/key-headers.d.ts.map +1 -1
- package/dist/shared/layout-defaults.d.ts +30 -0
- package/dist/shared/layout-defaults.d.ts.map +1 -0
- package/docs/api/30-api-server.mdx +2 -2
- package/docs/api/34-api-config.mdx +20 -3
- package/package.json +1 -1
- package/src/cli-check.ts +6 -6
- package/src/config-types.ts +44 -22
- package/src/config-validation.ts +96 -20
- package/src/index.ts +1 -1
- package/src/plugins/entries.ts +6 -3
- package/src/plugins/routing.ts +1 -1
- package/src/routing/codegen-types.ts +9 -0
- package/src/routing/codegen.ts +34 -20
- package/src/routing/convention-lint.ts +5 -3
- package/src/routing/descendant-params.ts +76 -0
- package/src/routing/route-options-lint.ts +34 -15
- package/src/routing/route-options.ts +3 -2
- package/src/server/als-registry.ts +13 -0
- package/src/server/request-context.ts +1 -1
- package/src/server/route-element-builder.ts +10 -3
- package/src/server/route-module-loader.ts +7 -6
- package/src/server/rsc-entry/index.ts +7 -8
- package/src/server/rsc-entry/render-route.ts +4 -4
- package/src/server/rsc-entry/revalidate-renderer.ts +4 -4
- package/src/server/segment-lifetime/outlet-gate.ts +6 -6
- package/src/server/segment-lifetime/read-rule.ts +37 -5
- package/src/server/segment-lifetime/read-scope.ts +11 -2
- package/src/server/segment-lifetime/segment-key.ts +50 -27
- package/src/server/segment-lifetime/slot-outlets.ts +10 -12
- package/src/server/types.ts +7 -5
- package/src/shared/key-headers.ts +5 -0
- package/src/shared/layout-defaults.ts +43 -0
- package/dist/_chunks/actions-DoTj0Jd3.js.map +0 -1
- package/dist/_chunks/cli-check-DlQBSKIN.js.map +0 -1
- package/dist/_chunks/codegen-vaCyFyVN.js.map +0 -1
- package/dist/_chunks/convention-lint-CGGcseNn.js.map +0 -1
- package/dist/_chunks/dev-server-DrjLscqT.js +0 -1
- package/dist/_chunks/key-headers-uIig1_mU.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-element-builder.d.ts","sourceRoot":"","sources":["../../src/server/route-element-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAQ9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"route-element-builder.d.ts","sourceRoot":"","sources":["../../src/server/route-element-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAQ9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAazD,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAQpG;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,UAAU,GAChB,MAAM,EAAE,CAGV;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;;;;OAIG;IACH,OAAO,EAAE,cAAc,CAAC;IACxB,wDAAwD;IACxD,gBAAgB,EAAE,oBAAoB,EAAE,CAAC;IACzC,qCAAqC;IACrC,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,4DAA4D;IAC5D,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;CACjC;AAqDD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,YAAY,EAAE,mBAAmB,GAAG,SAAS,EAC7C,MAAM,EAAE,aAAa,EACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3C,OAAO,CAAC,kBAAkB,CAAC,CAmZ7B"}
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* See design/02-rendering-pipeline.md, design/07-routing.md.
|
|
9
9
|
*/
|
|
10
10
|
import type { ManifestSegmentNode } from './route-matcher.ts';
|
|
11
|
-
import type { Metadata
|
|
11
|
+
import type { Metadata } from './types.ts';
|
|
12
|
+
import { type ResolvedLayoutDefaults } from '../shared/layout-defaults.ts';
|
|
12
13
|
import { type LayoutComponentEntry } from './route-element-builder.ts';
|
|
13
14
|
import { type DocumentLifetime } from './segment-lifetime/segment-key.ts';
|
|
14
15
|
/** Metadata export from a layout or page module, with its segment context. */
|
|
@@ -40,6 +41,6 @@ export interface LoadedRouteModules {
|
|
|
40
41
|
* to await `loadModule(segment.access)` at each iteration.
|
|
41
42
|
*/
|
|
42
43
|
export declare function loadRouteModules(segments: ManifestSegmentNode[], requestUrl: string,
|
|
43
|
-
/** The app's `
|
|
44
|
-
|
|
44
|
+
/** The app's `layoutDefaults` (design/53 §"App-wide defaults"). */
|
|
45
|
+
layoutDefaults: ResolvedLayoutDefaults): Promise<LoadedRouteModules>;
|
|
45
46
|
//# sourceMappingURL=route-module-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-module-loader.d.ts","sourceRoot":"","sources":["../../src/server/route-module-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"route-module-loader.d.ts","sourceRoot":"","sources":["../../src/server/route-module-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAsB,KAAK,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAG/F,OAAO,EAAwB,KAAK,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,mCAAmC,CAAC;AAE3C,8EAA8E;AAC9E,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,QAAQ,GAAG,CAAC,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,yDAAyD;AACzD,MAAM,MAAM,QAAQ,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,SAAS,CAAC;AAEnD,0CAA0C;AAC1C,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,gBAAgB,EAAE,oBAAoB,EAAE,CAAC;IACzC,aAAa,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;IAC/C,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC3B,wEAAwE;IACxE,iBAAiB,EAAE;QAAE,OAAO,EAAE,KAAK,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAAC;QAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC;CAC9F;AAgED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,UAAU,EAAE,MAAM;AAClB,mEAAmE;AACnE,cAAc,EAAE,sBAAsB,GACrC,OAAO,CAAC,kBAAkB,CAAC,CA6E7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/index.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAkGlE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAMjD;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/index.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAkGlE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAMjD;AAyWD,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;8BA4CoB,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC"}
|
|
@@ -20,7 +20,7 @@ import type { BuildManifest } from '../build-manifest.ts';
|
|
|
20
20
|
import type { ClientBootstrapConfig } from '../html-injectors.ts';
|
|
21
21
|
import type { InterceptionContext, RouteMatch } from '../pipeline.ts';
|
|
22
22
|
import type { KeyDigestSigner } from '../segment-lifetime/key-digest.ts';
|
|
23
|
-
import type {
|
|
23
|
+
import type { ResolvedLayoutDefaults } from '../../shared/layout-defaults.ts';
|
|
24
24
|
import type { DenyFallbackRenderer } from './deny-fallback.ts';
|
|
25
25
|
/**
|
|
26
26
|
* Static-per-handler dependencies for `renderRoute` — captured once at
|
|
@@ -36,8 +36,8 @@ export interface RenderRouteDeps {
|
|
|
36
36
|
* since no client router can hold a segment.
|
|
37
37
|
*/
|
|
38
38
|
keyDigestSigner: KeyDigestSigner | null;
|
|
39
|
-
/** The app's `
|
|
40
|
-
|
|
39
|
+
/** The app's `layoutDefaults` (design/53 §"App-wide defaults"). */
|
|
40
|
+
layoutDefaults: ResolvedLayoutDefaults;
|
|
41
41
|
renderDenyFallback: DenyFallbackRenderer;
|
|
42
42
|
buildManifest: BuildManifest;
|
|
43
43
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-route.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/render-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAS1D,OAAO,K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Ae,EAAE,OAAO,EACxB,IAAI,EAAE,eAAe,EACrB,YAAY,CAAC,EAAE,mBAAmB,GACjC,OAAO,CAAC,QAAQ,CAAC,CA2JnB"}
|
|
@@ -30,7 +30,7 @@ import type { RouteMatch, RouteMatcher } from '../pipeline.ts';
|
|
|
30
30
|
import { type RevalidateRenderer } from '../actions.ts';
|
|
31
31
|
import type { CoercedParams } from '../../shared/param-value.ts';
|
|
32
32
|
import type { KeyDigestSigner } from '../segment-lifetime/key-digest.ts';
|
|
33
|
-
import type {
|
|
33
|
+
import type { ResolvedLayoutDefaults } from '../../shared/layout-defaults.ts';
|
|
34
34
|
/** Result of validating a `revalidatePath()` argument. */
|
|
35
35
|
type PathValidation = {
|
|
36
36
|
ok: true;
|
|
@@ -73,8 +73,8 @@ export interface RevalidateRendererDeps {
|
|
|
73
73
|
* (design/53-segment-lifetime.md open question 4).
|
|
74
74
|
*/
|
|
75
75
|
keyDigestSigner: KeyDigestSigner | null;
|
|
76
|
-
/** The app's `
|
|
77
|
-
|
|
76
|
+
/** The app's `layoutDefaults` (design/53 §"App-wide defaults"). */
|
|
77
|
+
layoutDefaults: ResolvedLayoutDefaults;
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* Build a per-request `RevalidateRenderer`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revalidate-renderer.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/revalidate-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAK1D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM/D,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAGjE,OAAO,KAAK,EAAE,eAAe,EAAE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;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,sBAAsB,GAC3B,CAAC,GAAG,EAAE,OAAO,KAAK,kBAAkB,CAoLtC"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { type ReactElement, type ReactNode } from 'react';
|
|
16
16
|
import type { DocumentKeys, DocumentOutlet } from './document-outlet.ts';
|
|
17
|
-
import type
|
|
17
|
+
import { type ResolvedLayoutDefaults } from '../../shared/layout-defaults.ts';
|
|
18
18
|
/** One outlet in the element tree, and the outlets directly inside it. */
|
|
19
19
|
export interface OutletSpec {
|
|
20
20
|
segmentPath: string;
|
|
@@ -31,11 +31,11 @@ export interface SegmentRender {
|
|
|
31
31
|
*/
|
|
32
32
|
documents: DocumentKeys | null;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
* `
|
|
36
|
-
*
|
|
34
|
+
* What a layout that declares no lifetime, or a key without `headers`,
|
|
35
|
+
* takes: the app's `layoutDefaults` (design/53 §"App-wide defaults").
|
|
36
|
+
* Pages take none.
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
layoutDefaults: ResolvedLayoutDefaults;
|
|
39
39
|
}
|
|
40
40
|
/** A render with no client router to hold segments: every outlet live. */
|
|
41
41
|
export declare const LIVE_ONLY_RENDER: SegmentRender;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outlet-gate.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/outlet-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAiB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzE,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"outlet-gate.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/outlet-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAiB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzE,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAsB,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAElG,0EAA0E;AAC1E,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,sDAAsD;AACtD,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,SAAS,EAAE,YAAY,GAAG,IAAI,CAAC;IAC/B;;;;OAIG;IACH,cAAc,EAAE,sBAAsB,CAAC;CACxC;AAED,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB,EAAE,aAG9B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAOzD;AAKD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAI1D"}
|
|
@@ -45,5 +45,12 @@ export declare function checkCookieRead(name: string, codec?: unknown): void;
|
|
|
45
45
|
* own keys are only the params in the key, so spreading it, or passing it to
|
|
46
46
|
* a client component, carries exactly what the segment may depend on.
|
|
47
47
|
*/
|
|
48
|
-
export declare function scopedParams<T extends CoercedParams>(params: T
|
|
48
|
+
export declare function scopedParams<T extends CoercedParams>(params: T,
|
|
49
|
+
/**
|
|
50
|
+
* `'slot'` when `params` is a slot's record merged over the main route's
|
|
51
|
+
* (`getSegmentParams(slotPath)`). A key computes a descendant's param from
|
|
52
|
+
* the main route's record, and a slot may define the same name with another
|
|
53
|
+
* value, so a keyed descendant name is refused through it.
|
|
54
|
+
*/
|
|
55
|
+
record?: 'route' | 'slot'): T;
|
|
49
56
|
//# sourceMappingURL=read-rule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-rule.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/read-rule.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,oFAAoF;AACpF,wBAAgB,gBAAgB,IAAI,iBAAiB,GAAG,SAAS,CAEhE;
|
|
1
|
+
{"version":3,"file":"read-rule.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/read-rule.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,oFAAoF;AACpF,wBAAgB,gBAAgB,IAAI,iBAAiB,GAAG,SAAS,CAEhE;AAwDD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,GAAG,eAAe,CAyChG;AAED,4FAA4F;AAC5F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAGpD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CActE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAYnE;AAiBD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,aAAa,EAClD,MAAM,EAAE,CAAC;AACT;;;;;GAKG;AACH,MAAM,GAAE,OAAO,GAAG,MAAgB,GACjC,CAAC,CAiDH"}
|
|
@@ -64,8 +64,14 @@ import { type ReactElement, type ReactNode } from 'react';
|
|
|
64
64
|
import { type DocumentReadScope } from '../als-registry.ts';
|
|
65
65
|
import { type ServerComponent } from '../subtree-walk.ts';
|
|
66
66
|
import type { DocumentLifetime } from './segment-key.ts';
|
|
67
|
-
/**
|
|
68
|
-
|
|
67
|
+
/**
|
|
68
|
+
* The read scope of one `'document'` segment.
|
|
69
|
+
*
|
|
70
|
+
* @param pathParams Every param on the segment's path: the default key.
|
|
71
|
+
* @param descendants The params its `children` chain defines (a layout's;
|
|
72
|
+
* none for a page), which a key may also name.
|
|
73
|
+
*/
|
|
74
|
+
export declare function readScopeFor(segmentPath: string, lifetime: DocumentLifetime, pathParams: readonly string[], descendants: Iterable<string>): DocumentReadScope;
|
|
69
75
|
/**
|
|
70
76
|
* The segment's component, run inside its read scope with every server
|
|
71
77
|
* component it returns rewritten to run there too.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-scope.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/read-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,OAAO,EAA2B,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD
|
|
1
|
+
{"version":3,"file":"read-scope.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/read-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,OAAO,EAA2B,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,GAC5B,iBAAiB,CAkBnB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,GAAG,eAAe,CAGjG;AAuDD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,YAAY,CAGhG"}
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
* definition that owns it, so two requests that differ only in a way the
|
|
10
10
|
* segment cannot observe produce the same string:
|
|
11
11
|
*
|
|
12
|
-
* - **segment params** — the coerced params (each segment's codec applied)
|
|
12
|
+
* - **segment params** — the coerced params (each segment's codec applied),
|
|
13
|
+
* with a param absent from the record tagged apart from one present as
|
|
14
|
+
* `undefined`, since the segment can tell them apart (`in`, `Object.keys`);
|
|
13
15
|
* - **search params** — `def.buildSearchParams(def.parse(…))`, which applies
|
|
14
16
|
* defaults, aliases (`withUrlKey`) and drops values that parse to the default;
|
|
15
17
|
* - **headers** — each named header's value as `Headers.get` returns it
|
|
@@ -23,41 +25,47 @@
|
|
|
23
25
|
*/
|
|
24
26
|
import type { CoercedParams } from '../../shared/param-value.ts';
|
|
25
27
|
import { type RouteOptionsKind } from '../../shared/route-options-export.ts';
|
|
26
|
-
import
|
|
28
|
+
import { type ResolvedLayoutDefaults } from '../../shared/layout-defaults.ts';
|
|
29
|
+
import type { SegmentKey } from '../types.ts';
|
|
27
30
|
/** A segment declared `lifetime: 'document'`, with the key it declared (if any). */
|
|
28
31
|
export interface DocumentLifetime {
|
|
29
32
|
key: SegmentKey;
|
|
30
33
|
}
|
|
31
34
|
/**
|
|
32
|
-
* The
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* A page always defaults to `'request'`.
|
|
35
|
+
* The defaults of the layout at the end of `chain` (the segments from the
|
|
36
|
+
* root down to it, slot chains included): the app's `layoutDefaults`, except
|
|
37
|
+
* at or below an intercepting segment. Options there are a build error
|
|
38
|
+
* (`routing/route-options-lint.ts`), so a defaulted layout under an
|
|
39
|
+
* intercepting directory could never opt out — it takes no defaults instead
|
|
40
|
+
* (design/53 §"App-wide defaults"). A page always takes `NO_LAYOUT_DEFAULTS`.
|
|
39
41
|
*/
|
|
40
|
-
export declare function
|
|
42
|
+
export declare function layoutDefaultsAt(chain: readonly {
|
|
41
43
|
segmentType?: string;
|
|
42
|
-
}[],
|
|
44
|
+
}[], appDefaults: ResolvedLayoutDefaults): ResolvedLayoutDefaults;
|
|
43
45
|
/**
|
|
44
46
|
* The module's lifetime: a `DocumentLifetime` when its options object
|
|
45
|
-
* declares `lifetime: 'document'`, or declares no lifetime and
|
|
46
|
-
* `
|
|
47
|
-
*
|
|
48
|
-
* what takes effect.
|
|
47
|
+
* declares `lifetime: 'document'`, or declares no lifetime and the default is
|
|
48
|
+
* `'document'`; undefined otherwise. The build validated the object from
|
|
49
|
+
* source (`routing/route-options.ts`); this runtime read is what takes effect.
|
|
49
50
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
51
|
+
* Each key part defaults on its own, as `segmentParams` already does: a
|
|
52
|
+
* `'document'` segment whose key omits `headers` takes the default headers,
|
|
53
|
+
* and one that declares `headers` replaces them.
|
|
54
|
+
*
|
|
55
|
+
* @param defaults What a module that declares none takes: the app's
|
|
56
|
+
* `layoutDefaults` for a layout (`layoutDefaultsAt`), `NO_LAYOUT_DEFAULTS`
|
|
57
|
+
* for a page (design/53 §"App-wide defaults").
|
|
53
58
|
*/
|
|
54
|
-
export declare function readDocumentLifetime(mod: Record<string, unknown>, kind: RouteOptionsKind,
|
|
59
|
+
export declare function readDocumentLifetime(mod: Record<string, unknown>, kind: RouteOptionsKind, defaults: ResolvedLayoutDefaults): DocumentLifetime | undefined;
|
|
55
60
|
/**
|
|
56
61
|
* The canonical key values of one segment in the current request.
|
|
57
62
|
*
|
|
58
63
|
* @param pathParams Every param name on the segment's path, outermost first —
|
|
59
64
|
* the default `segmentParams`.
|
|
60
|
-
* @param params The coerced
|
|
65
|
+
* @param params The matched route's coerced params, the record the segment
|
|
66
|
+
* reads. A keyed name may be absent from it: an optional catch-all with no
|
|
67
|
+
* segments, or a param a layout's `children` chain defines on other routes
|
|
68
|
+
* (design/53 §"Keying on a descendant's param").
|
|
61
69
|
*/
|
|
62
70
|
export declare function readKeyValues(lifetime: DocumentLifetime, pathParams: readonly string[], params: CoercedParams): string;
|
|
63
71
|
//# sourceMappingURL=segment-key.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment-key.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/segment-key.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"segment-key.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/segment-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAwB,KAAK,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAInG,OAAO,EAAsB,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAClG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,oFAAoF;AACpF,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,UAAU,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,EAC1C,WAAW,EAAE,sBAAsB,GAClC,sBAAsB,CAGxB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,IAAI,EAAE,gBAAgB,EACtB,QAAQ,EAAE,sBAAsB,GAC/B,gBAAgB,GAAG,SAAS,CAe9B;AAkBD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,MAAM,EAAE,aAAa,GACpB,MAAM,CA0BR"}
|
|
@@ -54,9 +54,8 @@ export declare class SlotDocumentOutlets {
|
|
|
54
54
|
/** The outlets built so far that no outlet built so far contains. */
|
|
55
55
|
outermost(): OutletSpec[];
|
|
56
56
|
/**
|
|
57
|
-
* A slot segment's lifetime: its own declaration,
|
|
58
|
-
* `
|
|
59
|
-
* `'request'` for a page.
|
|
57
|
+
* A slot segment's lifetime: its own declaration, over the app's
|
|
58
|
+
* `layoutDefaults` for a layout (`layoutDefaultsAt`) and none for a page.
|
|
60
59
|
*/
|
|
61
60
|
lifetimeOf(node: ManifestSegmentNode, mod: Record<string, unknown>, kind: 'page' | 'layout'): DocumentLifetime | undefined;
|
|
62
61
|
/** Wrap a `'document'` slot page in its own outlet. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slot-outlets.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/slot-outlets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAc,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEnF,OAAO,
|
|
1
|
+
{"version":3,"file":"slot-outlets.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/slot-outlets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAc,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEnF,OAAO,EAA0C,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,kFAAkF;AAClF,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,aAAa,CAAC;IACtB,iDAAiD;IACjD,KAAK,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACtC,uDAAuD;IACvD,cAAc,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC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
* How long a segment's output lives. `'request'` (the default, unless the app
|
|
79
|
-
* sets `
|
|
79
|
+
* sets `layoutDefaults.lifetime` for its layouts) renders on every request. `'document'` renders on the document request and whenever its key
|
|
80
80
|
* changes or `router.refresh()` runs, and is skipped without rendering on
|
|
81
81
|
* every other client navigation. See design/53-segment-lifetime.md.
|
|
82
82
|
*/
|
|
@@ -88,8 +88,9 @@ export type SegmentLifetime = 'request' | 'document';
|
|
|
88
88
|
*/
|
|
89
89
|
export interface SegmentKey {
|
|
90
90
|
/**
|
|
91
|
-
* Param names on the segment's path
|
|
92
|
-
*
|
|
91
|
+
* Param names on the segment's path, or, for a main-chain layout, names a
|
|
92
|
+
* page below it binds (absent on the routes that do not). Default: every
|
|
93
|
+
* param on the path. Any other name fails the build.
|
|
93
94
|
*/
|
|
94
95
|
segmentParams?: readonly string[];
|
|
95
96
|
/** A search-params definition, often a `.pick()`. Default: none. */
|
|
@@ -120,12 +121,13 @@ export interface PageOptions {
|
|
|
120
121
|
}
|
|
121
122
|
/** Options for a `layout.tsx`: `export const layoutOptions = { … } satisfies LayoutOptions`. */
|
|
122
123
|
export interface LayoutOptions {
|
|
123
|
-
/** See `SegmentLifetime`. Default: the app's `
|
|
124
|
+
/** See `SegmentLifetime`. Default: the app's `layoutDefaults.lifetime` (`'request'` unless set). */
|
|
124
125
|
lifetime?: SegmentLifetime;
|
|
125
126
|
/**
|
|
126
127
|
* What a `'document'` layout depends on. Only on a `'document'` layout: one
|
|
127
128
|
* that declares `lifetime: 'document'`, or declares no lifetime under a
|
|
128
|
-
* `'document'` `
|
|
129
|
+
* `'document'` `layoutDefaults.lifetime`. A key that omits `headers` takes
|
|
130
|
+
* `layoutDefaults.key.headers`.
|
|
129
131
|
*/
|
|
130
132
|
key?: SegmentKey;
|
|
131
133
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/server/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA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QACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;IACD;;;;;;OAMG;IACH,KAAY,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,GAAG,aAAa,CAAC,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC;AAEhG;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,eAAe,CAAC,OAAO,SAAS,cAAc,GAAG,cAAc,IAAI,MAC3E,OAAO,GACP,OAAO,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* the build cannot read every file kind (MDX pages are not linted), and a
|
|
7
7
|
* credential must not become keyable by skipping the lint.
|
|
8
8
|
*/
|
|
9
|
+
/** Whether `value` has the shape of `key.headers`: an array of strings. */
|
|
10
|
+
export declare function isHeaderList(value: unknown): value is readonly string[];
|
|
9
11
|
/** Why a key may not name `name`, or undefined when it may. */
|
|
10
12
|
export declare function headerKeyProblem(name: string): string | undefined;
|
|
11
13
|
/** Whether a key may never name `name` (case-insensitive): a cookie or credential header. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-headers.d.ts","sourceRoot":"","sources":["../../src/shared/key-headers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAuBH,+DAA+D;AAC/D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKjE;AAED,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD"}
|
|
1
|
+
{"version":3,"file":"key-headers.d.ts","sourceRoot":"","sources":["../../src/shared/key-headers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAuBH,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,MAAM,EAAE,CAEvE;AAED,+DAA+D;AAC/D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKjE;AAED,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The app's layout defaults (`layoutDefaults` in `timber.config.ts`), as every
|
|
3
|
+
* reader takes them: the build lint (`routing/route-options-lint.ts`), the
|
|
4
|
+
* runtime config the RSC entry reads (`plugins/entries.ts`), and through it
|
|
5
|
+
* the main chain and slot layouts (`server/segment-lifetime/segment-key.ts`).
|
|
6
|
+
*
|
|
7
|
+
* See design/53-segment-lifetime.md §"App-wide defaults".
|
|
8
|
+
*/
|
|
9
|
+
import type { SegmentLifetime } from '../server/types.ts';
|
|
10
|
+
/** What a layout takes when it declares no lifetime, or a key without `headers`. */
|
|
11
|
+
export interface ResolvedLayoutDefaults {
|
|
12
|
+
lifetime: SegmentLifetime;
|
|
13
|
+
/** The `key.headers` of a `'document'` layout whose key omits `headers`. */
|
|
14
|
+
headers: readonly string[] | undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* No defaults: what a page takes, and a layout at or below an intercepting
|
|
18
|
+
* directory, which could not opt out of one.
|
|
19
|
+
*/
|
|
20
|
+
export declare const NO_LAYOUT_DEFAULTS: ResolvedLayoutDefaults;
|
|
21
|
+
/**
|
|
22
|
+
* Resolve the configured value. Anything config validation reports as
|
|
23
|
+
* malformed reads as no default: a lifetime other than `'document'` is
|
|
24
|
+
* `'request'`, and headers that are not an array of strings are none —
|
|
25
|
+
* slower, never wrong. A header the key may not name is a fatal config error
|
|
26
|
+
* (`config-validation.ts`), and the runtime refuses it again when it reads a
|
|
27
|
+
* layout's key.
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveLayoutDefaults(value: unknown): ResolvedLayoutDefaults;
|
|
30
|
+
//# sourceMappingURL=layout-defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-defaults.d.ts","sourceRoot":"","sources":["../../src/shared/layout-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D,oFAAoF;AACpF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,eAAe,CAAC;IAC1B,4EAA4E;IAC5E,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CACxC;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,sBAGhC,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,sBAAsB,CAM5E"}
|
|
@@ -217,11 +217,11 @@ export const pageOptions = {
|
|
|
217
217
|
| Option | Applies to | Meaning |
|
|
218
218
|
| ------------------ | ------------ | ----------------------------------------------------------------------------------------------------------- |
|
|
219
219
|
| `lifetime` | layout, page | `'request'` (default) or `'document'`: render once per loaded document and skip on client navigations until `key` changes ([Document lifetime](/docs/client-navigation#document-lifetime)). Slots included. |
|
|
220
|
-
| `key` | layout, page | What a `'document'` segment depends on: `segmentParams` (names on its path; default all
|
|
220
|
+
| `key` | layout, page | What a `'document'` segment depends on: `segmentParams` (names on its path, or for a layout, names its child pages bind; default all on its path), `searchParams` (a definition), `cookies` (definitions), `headers` (header names). |
|
|
221
221
|
| `prerender` | layout, page | Render at build time ([route-level sugar](/docs/api-cache#route-level-sugar)). Layouts cascade it to pages, slot pages included. |
|
|
222
222
|
| `deferSuspenseFor` | layout, page | Hold the SSR stream up to N ms ([`deferSuspenseFor`](/docs/streaming#defersuspensefor)). Main route only, not parallel slots. |
|
|
223
223
|
|
|
224
|
-
The build reads these objects from source, so write them as one object literal with literal values. The exception is `key.searchParams` and `key.cookies`, which name the definitions you import. A `key.segmentParams` name that is not on the segment's path, or a `key` on a segment that is not `'document'`, fails the build. A layout that declares no `lifetime` takes the app's [`
|
|
224
|
+
The build reads these objects from source, so write them as one object literal with literal values. The exception is `key.searchParams` and `key.cookies`, which name the definitions you import. A `key.segmentParams` name that is not on the segment's path, or a `key` on a segment that is not `'document'`, fails the build. A layout outside a parallel slot may also name a param that a page below it binds, such as `artistSlug` from `artists/[artistSlug]/`, but not one only a parallel slot or a `route.ts` defines. That param is absent on the routes without it, and absence is a value of its own: the layout renders again when the param appears, changes or goes away. A layout that declares no `lifetime` takes the app's [`layoutDefaults.lifetime`](/docs/client-navigation#making-layouts-document-by-default), so under a `'document'` default it may declare `key` alone. A spread, a computed key, a value from a variable, an unknown key, or `layoutOptions` in a page (or the reverse) fails the build with a message naming the fix. An option where it would do nothing also fails the build: in a `'use client'` file, in `default.tsx`, on an intercepting route, or `deferSuspenseFor` in a parallel slot. `satisfies` adds editor completion and type errors; the build checks the object either way. MDX pages are not checked, and `prerender` has no effect in them. `metadata`, `searchParams` and `segmentParams` stay separate exports.
|
|
225
225
|
|
|
226
226
|
## Tracing
|
|
227
227
|
|
|
@@ -32,7 +32,10 @@ interface TimberUserConfig {
|
|
|
32
32
|
optimizePackageImports?: string[];
|
|
33
33
|
slowRequestMs?: number;
|
|
34
34
|
renderTimeoutMs?: number;
|
|
35
|
-
|
|
35
|
+
layoutDefaults?: {
|
|
36
|
+
lifetime?: 'request' | 'document';
|
|
37
|
+
key?: { headers?: readonly string[] };
|
|
38
|
+
};
|
|
36
39
|
devBrowserLogs?: 'error' | 'warn' | 'info' | 'none';
|
|
37
40
|
dev?: {
|
|
38
41
|
slowPhaseMs?: number;
|
|
@@ -211,9 +214,23 @@ Slow request threshold in milliseconds. Requests exceeding this emit a warning v
|
|
|
211
214
|
|
|
212
215
|
Render timeout in milliseconds. If an SSR render or RSC stream read does not complete within this duration, the render is aborted and the connection is closed. Protects against hung fetches and Suspense components that never resolve. Setting `0` uses a 120-second safety ceiling rather than disabling the timeout entirely. The same value bounds how long concurrent `timber.cache` callers wait on a shared fill, and how long static generation waits for each page.
|
|
213
216
|
|
|
214
|
-
### `
|
|
217
|
+
### `layoutDefaults`
|
|
218
|
+
|
|
219
|
+
Defaults for every layout, slot layouts included. Pages are unaffected. Layouts in and below an intercepting directory take neither default and stay `'request'`. See [Making layouts `'document'` by default](/docs/client-navigation#making-layouts-document-by-default).
|
|
220
|
+
|
|
221
|
+
#### `layoutDefaults.lifetime`
|
|
222
|
+
|
|
223
|
+
- **Type:** `'request' | 'document'`
|
|
224
|
+
- **Default:** `'request'`
|
|
225
|
+
|
|
226
|
+
The lifetime of every layout that does not declare one. A layout's own `layoutOptions.lifetime` wins. Under `'document'`, a layout that reads a request input outside its key is reported (the dev overlay, or a warning in production) and renders as `'request'`, one that shows data that changes during a visit keeps its load-time value, and one that hides its children in its body no longer keeps them out of the payload.
|
|
227
|
+
|
|
228
|
+
#### `layoutDefaults.key.headers`
|
|
229
|
+
|
|
230
|
+
- **Type:** `readonly string[]`
|
|
231
|
+
- **Default:** none
|
|
215
232
|
|
|
216
|
-
The
|
|
233
|
+
The `key.headers` of every `'document'` layout whose key does not list `headers`, whether the layout declares `'document'` or takes it from `layoutDefaults.lifetime`. Those layouts may read these headers, and render again when one changes. A layout that declares `key.headers` replaces this list. `cookie`, credential headers (`authorization`, `proxy-authorization`, `x-api-key`) and invalid header names stop the server from starting.
|
|
217
234
|
|
|
218
235
|
### `devBrowserLogs`
|
|
219
236
|
|
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.245",
|
|
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-check.ts
CHANGED
|
@@ -37,7 +37,7 @@ import { scanRoutes } from './routing/scanner.ts';
|
|
|
37
37
|
import { lintConventions, formatConventionWarnings } from './routing/convention-lint.ts';
|
|
38
38
|
import { writeRouteCodegen, CODEGEN_OUTPUT, ENV_DTS_FILENAME } from './routing/codegen-write.ts';
|
|
39
39
|
import { resolveTimberContext, type ResolveViteConfig } from './cli-context.ts';
|
|
40
|
-
import type {
|
|
40
|
+
import type { LayoutDefaults } from './config-types.ts';
|
|
41
41
|
|
|
42
42
|
/** The npm package that provides tsgo. Named in the missing-tool message. */
|
|
43
43
|
const TSGO_PACKAGE = '@typescript/native-preview';
|
|
@@ -143,8 +143,8 @@ export interface RouteInputs {
|
|
|
143
143
|
root: string;
|
|
144
144
|
appDir: string;
|
|
145
145
|
pageExtensions: string[] | undefined;
|
|
146
|
-
/** Read by the route-options lint (design/53 §"App-wide
|
|
147
|
-
|
|
146
|
+
/** Read by the route-options lint (design/53 §"App-wide defaults"). */
|
|
147
|
+
layoutDefaults: LayoutDefaults | undefined;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
/**
|
|
@@ -164,7 +164,7 @@ export async function resolveRouteInputs(
|
|
|
164
164
|
root: ctx.root,
|
|
165
165
|
appDir: ctx.appDir,
|
|
166
166
|
pageExtensions: ctx.config.pageExtensions,
|
|
167
|
-
|
|
167
|
+
layoutDefaults: ctx.config.layoutDefaults,
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
170
|
|
|
@@ -184,11 +184,11 @@ export async function checkRoutes(
|
|
|
184
184
|
deps: CheckDeps = {}
|
|
185
185
|
): Promise<RouteInputs> {
|
|
186
186
|
const inputs = await resolveRouteInputs(options, deps);
|
|
187
|
-
const { root, appDir, pageExtensions,
|
|
187
|
+
const { root, appDir, pageExtensions, layoutDefaults } = inputs;
|
|
188
188
|
|
|
189
189
|
const tree = scanRoutes(appDir, { pageExtensions });
|
|
190
190
|
|
|
191
|
-
const warnings = lintConventions(tree, appDir, {
|
|
191
|
+
const warnings = lintConventions(tree, appDir, { layoutDefaults });
|
|
192
192
|
const fatal = warnings.filter((w) => w.level === 'error');
|
|
193
193
|
if (fatal.length > 0) {
|
|
194
194
|
throw new Error(formatConventionWarnings(fatal, { color: false }));
|