@timber-js/app 0.2.0-alpha.196 → 0.2.0-alpha.198
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-CWYtq6ii.js → actions-BS-m5SLv.js} +3 -3
- package/dist/_chunks/{actions-CWYtq6ii.js.map → actions-BS-m5SLv.js.map} +1 -1
- package/dist/_chunks/als-registry-C6kcfprT.js.map +1 -1
- package/dist/_chunks/{build-manifest-DWppEdLB.js → build-manifest-DTmSGLRz.js} +51 -2
- package/dist/_chunks/build-manifest-DTmSGLRz.js.map +1 -0
- package/dist/_chunks/{cache-api-CQeYzA5g.js → cache-api-DqzgTEqk.js} +4 -49
- package/dist/_chunks/cache-api-DqzgTEqk.js.map +1 -0
- package/dist/_chunks/{chains-h7EO-u3n.js → chains-CZG7E5zg.js} +2 -2
- package/dist/_chunks/{chains-h7EO-u3n.js.map → chains-CZG7E5zg.js.map} +1 -1
- package/dist/_chunks/{cli-check-BVthpfLS.js → cli-check-dVDi1GQz.js} +3 -3
- package/dist/_chunks/{cli-check-BVthpfLS.js.map → cli-check-dVDi1GQz.js.map} +1 -1
- package/dist/_chunks/{cli-schema-sync-3Wutm8pH.js → cli-schema-sync-DTy_-Msq.js} +2 -2
- package/dist/_chunks/{cli-schema-sync-3Wutm8pH.js.map → cli-schema-sync-DTy_-Msq.js.map} +1 -1
- package/dist/_chunks/{cloudflare-BKJC3SC_.js → cloudflare-BFb__LYG.js} +2 -2
- package/dist/_chunks/{cloudflare-BKJC3SC_.js.map → cloudflare-BFb__LYG.js.map} +1 -1
- package/dist/_chunks/{convention-lint-DO10_pVl.js → convention-lint-Ph6luW4c.js} +4 -2
- package/dist/_chunks/convention-lint-Ph6luW4c.js.map +1 -0
- package/dist/_chunks/{error-boundary-D-lkwyaD.js → error-boundary-BvRCCmbN.js} +3 -3
- package/dist/_chunks/{error-boundary-D-lkwyaD.js.map → error-boundary-BvRCCmbN.js.map} +1 -1
- package/dist/_chunks/{href-validation-CMc5JRls.js → href-validation-BIrxavIy.js} +74 -2
- package/dist/_chunks/href-validation-BIrxavIy.js.map +1 -0
- package/dist/_chunks/{live-graph-Bx4HodF1.js → live-graph-BXDsdzBv.js} +3 -3
- package/dist/_chunks/{live-graph-Bx4HodF1.js.map → live-graph-BXDsdzBv.js.map} +1 -1
- package/dist/_chunks/{logger-pumCm3Il.js → logger-DDirEsn7.js} +3 -4
- package/dist/_chunks/{logger-pumCm3Il.js.map → logger-DDirEsn7.js.map} +1 -1
- package/dist/_chunks/navigation-root-B00jjGd5.js +233 -0
- package/dist/_chunks/navigation-root-B00jjGd5.js.map +1 -0
- package/dist/_chunks/{segment-context-CjOlyB8Y.js → param-value-C8TNYchQ.js} +2 -33
- package/dist/_chunks/param-value-C8TNYchQ.js.map +1 -0
- package/dist/_chunks/{poison-scan-BAxfTT5L.js → poison-scan-BoDLgbix.js} +2 -2
- package/dist/_chunks/{poison-scan-BAxfTT5L.js.map → poison-scan-BoDLgbix.js.map} +1 -1
- package/dist/_chunks/{router-ref-BzqbPwYC.js → router-ref-8gr8qsxN.js} +2 -2
- package/dist/_chunks/{router-ref-BzqbPwYC.js.map → router-ref-8gr8qsxN.js.map} +1 -1
- package/dist/_chunks/{rsc-cache-key-DD0fl_-s.js → rsc-cache-key-ClUiXQnK.js} +2 -2
- package/dist/_chunks/{rsc-cache-key-DD0fl_-s.js.map → rsc-cache-key-ClUiXQnK.js.map} +1 -1
- package/dist/_chunks/{scanner-BRIOmHE2.js → scanner-tdFPvDYi.js} +174 -7
- package/dist/_chunks/scanner-tdFPvDYi.js.map +1 -0
- package/dist/_chunks/segment-context-D9_89u34.js +34 -0
- package/dist/_chunks/segment-context-D9_89u34.js.map +1 -0
- package/dist/_chunks/singleflight-2lUWfcAk.js +54 -0
- package/dist/_chunks/singleflight-2lUWfcAk.js.map +1 -0
- package/dist/_chunks/{ssr-data-Ya2HJPFp.js → ssr-data-BQGhTPAK.js} +2 -17
- package/dist/_chunks/ssr-data-BQGhTPAK.js.map +1 -0
- package/dist/_chunks/{walkers-BU6z9xRV.js → walkers-DNX05dC0.js} +2 -2
- package/dist/_chunks/{walkers-BU6z9xRV.js.map → walkers-DNX05dC0.js.map} +1 -1
- package/dist/adapters/cloudflare-dev.js +1 -1
- package/dist/adapters/cloudflare-kv-cache.js +1 -1
- package/dist/adapters/cloudflare.js +1 -1
- package/dist/adapters/nitro.d.ts +1 -1
- package/dist/adapters/nitro.d.ts.map +1 -1
- package/dist/adapters/nitro.js.map +1 -1
- package/dist/analyze/crawl-entry.js +2 -2
- package/dist/analyze/graph-command.js +2 -2
- package/dist/cache/index.js +1 -1
- package/dist/cache/singleflight.d.ts +2 -0
- package/dist/cache/singleflight.d.ts.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/client/browser-entry/hydrate.d.ts +21 -15
- package/dist/client/browser-entry/hydrate.d.ts.map +1 -1
- package/dist/client/browser-entry/index.d.ts +4 -3
- package/dist/client/browser-entry/index.d.ts.map +1 -1
- package/dist/client/browser-entry/post-hydration.d.ts.map +1 -1
- package/dist/client/browser-entry/router-init.d.ts +17 -1
- package/dist/client/browser-entry/router-init.d.ts.map +1 -1
- package/dist/client/error-boundary.js +1 -1
- package/dist/client/global-context.d.ts +15 -0
- package/dist/client/global-context.d.ts.map +1 -0
- package/dist/client/index.js +138 -35
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.d.ts +0 -1
- package/dist/client/internal.d.ts.map +1 -1
- package/dist/client/internal.js +206 -55
- package/dist/client/internal.js.map +1 -1
- package/dist/client/link.d.ts.map +1 -1
- package/dist/client/location-search.d.ts +12 -0
- package/dist/client/location-search.d.ts.map +1 -0
- package/dist/client/navigation-api.d.ts.map +1 -1
- package/dist/client/navigation-commit.d.ts +18 -0
- package/dist/client/navigation-commit.d.ts.map +1 -1
- package/dist/client/navigation-context.d.ts +13 -11
- package/dist/client/navigation-context.d.ts.map +1 -1
- package/dist/client/navigation-root.d.ts +47 -108
- package/dist/client/navigation-root.d.ts.map +1 -1
- package/dist/client/navigation-transition.d.ts +136 -0
- package/dist/client/navigation-transition.d.ts.map +1 -0
- package/dist/client/nuqs-adapter.d.ts.map +1 -1
- package/dist/client/params-context.d.ts +4 -5
- package/dist/client/params-context.d.ts.map +1 -1
- package/dist/client/react-root.d.ts +44 -0
- package/dist/client/react-root.d.ts.map +1 -0
- package/dist/client/router-pipeline.d.ts +2 -2
- package/dist/client/router-pipeline.d.ts.map +1 -1
- package/dist/client/router-types.d.ts +12 -2
- package/dist/client/router-types.d.ts.map +1 -1
- package/dist/client/router.d.ts.map +1 -1
- package/dist/client/segment-cache.d.ts +39 -0
- package/dist/client/segment-cache.d.ts.map +1 -1
- package/dist/client/segment-context.d.ts.map +1 -1
- package/dist/client/segment-outlet.d.ts +25 -14
- package/dist/client/segment-outlet.d.ts.map +1 -1
- package/dist/client/segment-update-context.d.ts +3 -9
- package/dist/client/segment-update-context.d.ts.map +1 -1
- package/dist/client/slot-content-cache-context.d.ts +35 -0
- package/dist/client/slot-content-cache-context.d.ts.map +1 -0
- package/dist/client/ssr-data.d.ts +8 -2
- package/dist/client/ssr-data.d.ts.map +1 -1
- package/dist/client/state.d.ts +0 -15
- package/dist/client/state.d.ts.map +1 -1
- package/dist/client/use-pathname.d.ts +13 -11
- package/dist/client/use-pathname.d.ts.map +1 -1
- package/dist/client/use-search-params.d.ts +13 -13
- package/dist/client/use-search-params.d.ts.map +1 -1
- package/dist/client/use-segment-params.d.ts +18 -68
- package/dist/client/use-segment-params.d.ts.map +1 -1
- package/dist/config-types.d.ts +17 -0
- package/dist/config-types.d.ts.map +1 -1
- package/dist/config-validation.d.ts.map +1 -1
- package/dist/cookies/index.js +1 -1
- package/dist/dev-tools/holding-server.d.ts +15 -10
- package/dist/dev-tools/holding-server.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +44 -43
- package/dist/index.js.map +1 -1
- package/dist/plugins/dev-server.d.ts.map +1 -1
- package/dist/plugins/entries.d.ts.map +1 -1
- package/dist/plugins/shims.d.ts.map +1 -1
- package/dist/plugins/static-build.d.ts +2 -2
- package/dist/plugins/static-build.d.ts.map +1 -1
- package/dist/routing/codegen-write.d.ts.map +1 -1
- package/dist/routing/index.js +2 -2
- package/dist/routing/interception-overlap.d.ts +35 -0
- package/dist/routing/interception-overlap.d.ts.map +1 -0
- package/dist/routing/interception.d.ts.map +1 -1
- package/dist/rsc-runtime/ssr.d.ts +3 -1
- package/dist/rsc-runtime/ssr.d.ts.map +1 -1
- package/dist/server/als-registry.d.ts +6 -0
- package/dist/server/als-registry.d.ts.map +1 -1
- package/dist/server/csp-nonce.d.ts +45 -0
- package/dist/server/csp-nonce.d.ts.map +1 -0
- package/dist/server/default-status-page.d.ts.map +1 -1
- package/dist/server/deny-renderer.d.ts.map +1 -1
- package/dist/server/flight-scripts.d.ts +5 -2
- package/dist/server/flight-scripts.d.ts.map +1 -1
- package/dist/server/html-injector-core.d.ts +17 -2
- package/dist/server/html-injector-core.d.ts.map +1 -1
- package/dist/server/html-injectors.d.ts +3 -2
- package/dist/server/html-injectors.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/internal.js +86 -37
- package/dist/server/internal.js.map +1 -1
- package/dist/server/metadata-render.d.ts.map +1 -1
- package/dist/server/node-stream-transforms.d.ts +3 -17
- package/dist/server/node-stream-transforms.d.ts.map +1 -1
- package/dist/server/nuqs-ssr-provider.d.ts +7 -3
- package/dist/server/nuqs-ssr-provider.d.ts.map +1 -1
- package/dist/server/pipeline-phases.d.ts.map +1 -1
- package/dist/server/prebuilt/key-discipline.d.ts +32 -3
- package/dist/server/prebuilt/key-discipline.d.ts.map +1 -1
- package/dist/server/primitives.d.ts.map +1 -1
- package/dist/server/render-utils.d.ts +4 -3
- package/dist/server/render-utils.d.ts.map +1 -1
- package/dist/server/rsc-entry/action-middleware-runner.d.ts.map +1 -1
- package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/index.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
- package/dist/server/ssr-bridge-types.d.ts +22 -2
- package/dist/server/ssr-bridge-types.d.ts.map +1 -1
- package/dist/server/ssr-entry.d.ts.map +1 -1
- package/dist/server/ssr-render.d.ts +5 -1
- package/dist/server/ssr-render.d.ts.map +1 -1
- package/dist/server/ssr-wrappers.d.ts +59 -27
- package/dist/server/ssr-wrappers.d.ts.map +1 -1
- package/dist/server/types.d.ts +10 -0
- package/dist/server/types.d.ts.map +1 -1
- package/dist/shims/navigation-rsc.d.ts +21 -0
- package/dist/shims/navigation-rsc.d.ts.map +1 -0
- package/docs/api/30-api-server.mdx +1 -0
- package/docs/api/35-api-typescript.mdx +4 -83
- package/docs/learn/03-fetching-data.mdx +1 -1
- package/docs/learn/{03b-access-control.mdx → 04-access-control.mdx} +2 -17
- package/docs/learn/05-the-flush-point.mdx +175 -0
- package/docs/learn/{05-typed-params.mdx → 06-typed-params.mdx} +1 -1
- package/docs/learn/07-typed-routes.mdx +25 -49
- package/docs/learn/{08-streaming.mdx → 09-streaming.mdx} +1 -7
- package/docs/learn/{10-middleware.mdx → 11-middleware.mdx} +1 -0
- package/package.json +3 -3
- package/src/adapters/nitro.ts +7 -7
- package/src/cache/singleflight.ts +5 -0
- package/src/client/browser-entry/hydrate.ts +54 -104
- package/src/client/browser-entry/index.ts +16 -6
- package/src/client/browser-entry/post-hydration.ts +3 -2
- package/src/client/browser-entry/router-init.ts +84 -33
- package/src/client/global-context.ts +31 -0
- package/src/client/internal.ts +1 -2
- package/src/client/link.tsx +18 -18
- package/src/client/location-search.ts +15 -0
- package/src/client/navigation-api.ts +4 -2
- package/src/client/navigation-commit.ts +48 -2
- package/src/client/navigation-context.ts +25 -37
- package/src/client/navigation-root.tsx +55 -411
- package/src/client/navigation-transition.ts +278 -0
- package/src/client/nuqs-adapter.tsx +4 -5
- package/src/client/params-context.ts +13 -18
- package/src/client/react-root.ts +72 -0
- package/src/client/router-lifecycle.ts +1 -1
- package/src/client/router-pipeline.ts +96 -22
- package/src/client/router-types.ts +12 -2
- package/src/client/router.ts +48 -36
- package/src/client/segment-cache.ts +70 -2
- package/src/client/segment-context.ts +7 -4
- package/src/client/segment-outlet.tsx +41 -86
- package/src/client/segment-update-context.ts +7 -26
- package/src/client/slot-content-cache-context.ts +43 -0
- package/src/client/ssr-data.ts +8 -2
- package/src/client/state.ts +0 -26
- package/src/client/use-pathname.ts +21 -31
- package/src/client/use-search-params.ts +31 -29
- package/src/client/use-segment-params.ts +27 -126
- package/src/config-types.ts +17 -0
- package/src/config-validation.ts +17 -0
- package/src/dev-tools/holding-server.ts +23 -12
- package/src/index.ts +26 -11
- package/src/plugins/dev-server.ts +9 -12
- package/src/plugins/entries.ts +3 -0
- package/src/plugins/shims.ts +8 -7
- package/src/plugins/static-build.ts +9 -5
- package/src/react-canary.d.ts +2 -0
- package/src/routing/codegen-write.ts +2 -0
- package/src/routing/interception-overlap.ts +141 -0
- package/src/routing/interception.ts +118 -5
- package/src/rsc-runtime/ssr.ts +3 -2
- package/src/server/als-registry.ts +6 -0
- package/src/server/csp-nonce.ts +70 -0
- package/src/server/default-status-page.ts +1 -0
- package/src/server/deny-renderer.ts +7 -3
- package/src/server/flight-scripts.ts +9 -4
- package/src/server/html-injector-core.ts +26 -9
- package/src/server/html-injectors.ts +8 -8
- package/src/server/metadata-render.ts +26 -4
- package/src/server/node-stream-transforms.ts +7 -20
- package/src/server/nuqs-ssr-provider.tsx +8 -7
- package/src/server/pipeline-phases.ts +5 -0
- package/src/server/prebuilt/key-discipline.ts +82 -13
- package/src/server/prebuilt-runtime.ts +2 -2
- package/src/server/primitives.ts +4 -4
- package/src/server/render-utils.ts +8 -4
- package/src/server/rsc-entry/action-middleware-runner.ts +7 -0
- package/src/server/rsc-entry/error-renderer.ts +5 -2
- package/src/server/rsc-entry/index.ts +8 -0
- package/src/server/rsc-entry/ssr-renderer.ts +11 -4
- package/src/server/ssr-bridge-types.ts +22 -2
- package/src/server/ssr-entry.ts +35 -28
- package/src/server/ssr-render.ts +13 -4
- package/src/server/ssr-wrappers.tsx +81 -61
- package/src/server/types.ts +10 -0
- package/src/shared/slot-params.ts +3 -4
- package/src/shims/navigation-rsc.ts +47 -0
- package/dist/_chunks/build-manifest-DWppEdLB.js.map +0 -1
- package/dist/_chunks/cache-api-CQeYzA5g.js.map +0 -1
- package/dist/_chunks/convention-lint-DO10_pVl.js.map +0 -1
- package/dist/_chunks/href-validation-CMc5JRls.js.map +0 -1
- package/dist/_chunks/scanner-BRIOmHE2.js.map +0 -1
- package/dist/_chunks/segment-context-CjOlyB8Y.js.map +0 -1
- package/dist/_chunks/slot-params-BCTmZkQB.js +0 -76
- package/dist/_chunks/slot-params-BCTmZkQB.js.map +0 -1
- package/dist/_chunks/ssr-data-Ya2HJPFp.js.map +0 -1
- package/dist/_chunks/use-segment-params-DzTBpkvj.js +0 -398
- package/dist/_chunks/use-segment-params-DzTBpkvj.js.map +0 -1
- package/docs/learn/04-loading-states.mdx +0 -67
- package/docs/learn/04b-the-flush-point.mdx +0 -115
- package/docs/learn/12-client-navigation.mdx +0 -176
- package/docs/learn/13-configuration.mdx +0 -166
- package/docs/more/01-advanced-routing.mdx +0 -344
- package/docs/more/02-advanced-forms.mdx +0 -137
- package/docs/more/03-coming-from-nextjs.mdx +0 -186
- package/docs/more/04-metadata-and-fonts.mdx +0 -193
- package/docs/more/04b-mdx.mdx +0 -229
- package/docs/more/05-content-collections.mdx +0 -90
- package/docs/more/06-instrumentation.mdx +0 -214
- package/docs/more/07-security.mdx +0 -129
- package/docs/more/08-developer-experience.mdx +0 -134
- package/docs/more/40-why-timber.mdx +0 -50
- package/docs/more/41-timber-vs-nextjs.mdx +0 -81
- package/docs/more/42-timber-vs-others.mdx +0 -68
- package/docs/more/50-ai-agent-instructions.mdx +0 -171
- /package/docs/learn/{06-forms-and-actions.mdx → 08-forms-and-actions.mdx} +0 -0
- /package/docs/learn/{09-caching.mdx → 10-caching.mdx} +0 -0
- /package/docs/learn/{11-error-handling.mdx → 12-error-handling.mdx} +0 -0
- /package/docs/learn/{14-deploying.mdx → 13-deploying.mdx} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../../src/plugins/dev-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAiC,MAAM,MAAM,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,WAAW,CAAC;AAKjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAoD1D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../../src/plugins/dev-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAiC,MAAM,MAAM,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,WAAW,CAAC;AAKjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAoD1D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAyI1D;AA8PD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAuC9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../src/plugins/entries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../src/plugins/entries.ts"],"names":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"shims.d.ts","sourceRoot":"","sources":["../../src/plugins/shims.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAsB1D;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAqBlD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EA6BhD,CAAC;AA2CF;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAoOvD"}
|
|
@@ -92,7 +92,6 @@ export declare function staticOutputPath(entry: StaticPageEntry): string;
|
|
|
92
92
|
* @internal Exported for testing.
|
|
93
93
|
*/
|
|
94
94
|
export declare class StaticOutputPaths {
|
|
95
|
-
private readonly identity;
|
|
96
95
|
private readonly claimed;
|
|
97
96
|
/** Every ancestor directory of a claimed path, mapped to its claimant. */
|
|
98
97
|
private readonly directories;
|
|
@@ -104,6 +103,7 @@ export declare class StaticOutputPaths {
|
|
|
104
103
|
* asked, not assumed. Folding unconditionally would reject `/Foo` beside
|
|
105
104
|
* `/foo` on Linux, where both are perfectly servable files.
|
|
106
105
|
*/
|
|
106
|
+
private readonly identity;
|
|
107
107
|
constructor(identity?: FsIdentity);
|
|
108
108
|
/** The identity under which the filesystem will compare this path. */
|
|
109
109
|
private key;
|
|
@@ -124,10 +124,10 @@ export declare class StaticOutputPaths {
|
|
|
124
124
|
* @internal Exported for testing.
|
|
125
125
|
*/
|
|
126
126
|
export declare class StaticSiteWriter {
|
|
127
|
-
private readonly staticDir;
|
|
128
127
|
/** Content-Type per URL path for extensionless API routes (TIM-1241). */
|
|
129
128
|
readonly contentTypes: Record<string, string>;
|
|
130
129
|
private readonly paths;
|
|
130
|
+
private readonly staticDir;
|
|
131
131
|
constructor(staticDir: string, identity?: FsIdentity);
|
|
132
132
|
write(entry: StaticPageEntry): Promise<void>;
|
|
133
133
|
/** Throw if any two entries could not both be written. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-build.d.ts","sourceRoot":"","sources":["../../src/plugins/static-build.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAMnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAGV,eAAe,EACf,mBAAmB,EACpB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,2BAA2B,CAAC;AAI/E,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,4BAA4B,CAAC;AAMpC;;;;GAIG;AAGH,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE/E,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAmBD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,qBAAqB,EAAE,CA2BvF;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,mBAAmB,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAK5F;AAaD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAuB/D;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,iBAAiB;
|
|
1
|
+
{"version":3,"file":"static-build.d.ts","sourceRoot":"","sources":["../../src/plugins/static-build.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AE,MAAM,EACjB,QAAQ,EAAE,WAAW,GACpB,OAAO,CAAC,IAAI,CAAC,CAkBf;AAMD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAU5E;AAMD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA+D5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen-write.d.ts","sourceRoot":"","sources":["../../src/routing/codegen-write.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,+BAA+B,CAAC;AAE3D,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"codegen-write.d.ts","sourceRoot":"","sources":["../../src/routing/codegen-write.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,+BAA+B,CAAC;AAE3D,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AA8ClD;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAcxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB9F"}
|
package/dist/routing/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as scanRoutes, r as collectInterceptionRewrites } from "../_chunks/scanner-
|
|
1
|
+
import { n as scanRoutes, r as collectInterceptionRewrites } from "../_chunks/scanner-tdFPvDYi.js";
|
|
2
2
|
import { a as INTERCEPTION_MARKERS, i as DEFAULT_PAGE_EXTENSIONS, n as classifyUrlSegment, t as classifySegment } from "../_chunks/segment-classify-C539Pa2O.js";
|
|
3
3
|
import { n as generateRouteMap } from "../_chunks/file-cache-Dw6BJPG7.js";
|
|
4
|
-
import { n as collectDynamicSegmentsFromTree, r as validateSchemaAgainstRoutes, t as collectLeafRoutes } from "../_chunks/walkers-
|
|
4
|
+
import { n as collectDynamicSegmentsFromTree, r as validateSchemaAgainstRoutes, t as collectLeafRoutes } from "../_chunks/walkers-DNX05dC0.js";
|
|
5
5
|
export { DEFAULT_PAGE_EXTENSIONS, INTERCEPTION_MARKERS, classifySegment, classifyUrlSegment, collectDynamicSegmentsFromTree, collectInterceptionRewrites, collectLeafRoutes, generateRouteMap, scanRoutes, validateSchemaAgainstRoutes };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pattern intersection for intercepted URL patterns.
|
|
3
|
+
*
|
|
4
|
+
* Checks whether two intercepted URL patterns can both match the same concrete
|
|
5
|
+
* URL. Used by the cross-mode claim check (TIM-1319) to detect when a
|
|
6
|
+
* children-path interceptor and a slot interceptor from the same owner overlap.
|
|
7
|
+
*
|
|
8
|
+
* This is not the order-dependence oracle (`findOrderDependentCollision`) the
|
|
9
|
+
* within-mode collision checks use. `findInterceptionMatch` picks the mode by
|
|
10
|
+
* first-match on `pathnameMatchesPattern`, which has no priority tiers, so a
|
|
11
|
+
* static `/feed/foo` and a dynamic `/feed/[id]` both match `/feed/foo` even
|
|
12
|
+
* though `matchUrlParts` would resolve the static deterministically. The
|
|
13
|
+
* intersection test catches that: it walks both patterns segment by segment and
|
|
14
|
+
* asks whether any value satisfies both.
|
|
15
|
+
*
|
|
16
|
+
* This is not a model of `matchNode` precedence — that decides *which*
|
|
17
|
+
* candidate wins when several match one URL. This decides the prior question:
|
|
18
|
+
* *do* they both match one URL at all? The two questions are independent, and
|
|
19
|
+
* conflating them is what caused TIM-1308's five-round drift.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Check whether two intercepted URL patterns can both match the same concrete
|
|
23
|
+
* URL. Returns a display string for the overlapping URL, or null.
|
|
24
|
+
*
|
|
25
|
+
* Walks both patterns segment by segment:
|
|
26
|
+
* - Two statics: must be identical.
|
|
27
|
+
* - Static + dynamic: static must satisfy the dynamic's affix constraints.
|
|
28
|
+
* - Two dynamics: affix constraints must be compatible.
|
|
29
|
+
* - A catch-all at either side: compatible with everything remaining.
|
|
30
|
+
*
|
|
31
|
+
* If the patterns differ in length, they can only overlap if the longer one's
|
|
32
|
+
* extra part is an optional catch-all (which also matches zero segments).
|
|
33
|
+
*/
|
|
34
|
+
export declare function interceptedPatternsOverlap(p1: string, p2: string): string | null;
|
|
35
|
+
//# sourceMappingURL=interception-overlap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interception-overlap.d.ts","sourceRoot":"","sources":["../../src/routing/interception-overlap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAmChF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interception.d.ts","sourceRoot":"","sources":["../../src/routing/interception.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAa,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"interception.d.ts","sourceRoot":"","sources":["../../src/routing/interception.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAa,MAAM,YAAY,CAAC;AAS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KAAK,CAAC,CAEpF;AAsXD;;;;;;;;;;;;;;;;;;;GAmBG;AACH;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,kBAAkB,EAC1B,sBAAsB,EAAE,MAAM,GAC7B,MAAM,CAER;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAOhG"}
|
|
@@ -19,7 +19,9 @@ export { createFromReadableStream } from '@vitejs/plugin-rsc/ssr';
|
|
|
19
19
|
* Returns null if createFromNodeStream isn't available (CF Workers, etc),
|
|
20
20
|
* signaling the caller to use createFromReadableStream instead.
|
|
21
21
|
*/
|
|
22
|
-
export declare function createFromNodeStream(stream: import('node:stream').Readable
|
|
22
|
+
export declare function createFromNodeStream(stream: import('node:stream').Readable, options?: {
|
|
23
|
+
nonce?: string;
|
|
24
|
+
}): React.ReactNode | null;
|
|
23
25
|
/** Whether the Node.js stream RSC decode path is available. */
|
|
24
26
|
export declare const hasNodeStreamDecode: boolean;
|
|
25
27
|
//# sourceMappingURL=ssr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../../src/rsc-runtime/ssr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAiClE;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,OAAO,aAAa,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../../src/rsc-runtime/ssr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAiClE;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,OAAO,aAAa,EAAE,QAAQ,EACtC,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3B,KAAK,CAAC,SAAS,GAAG,IAAI,CAGxB;AAED,+DAA+D;AAC/D,eAAO,MAAM,mBAAmB,SAAiC,CAAC"}
|
|
@@ -46,6 +46,12 @@ export interface RequestContextStore {
|
|
|
46
46
|
parsedCookies?: Map<string, string>;
|
|
47
47
|
/** Original (pre-overlay) frozen headers, kept for overlay merging. */
|
|
48
48
|
originalHeaders: Headers;
|
|
49
|
+
/**
|
|
50
|
+
* CSP nonce, created the first time middleware reads `ctx.nonce`. Read by
|
|
51
|
+
* the renderers via `getCspNonce()` and stamped on every inline script.
|
|
52
|
+
* Absent when no middleware asked for one. See server/csp-nonce.ts.
|
|
53
|
+
*/
|
|
54
|
+
cspNonce?: string;
|
|
49
55
|
/**
|
|
50
56
|
* Raw URLSearchParams for the current request.
|
|
51
57
|
* To get typed parsed params, import a search params definition and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"als-registry.d.ts","sourceRoot":"","sources":["../../src/server/als-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AA2BlE,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,wCAE7B,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,OAAO,EAAE,OAAO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AE/B,CAAC;AAMF,6EAA6E;AAC7E,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;AAE9D,4DAA4D;AAC5D,eAAO,MAAM,YAAY,gCAAmE,CAAC;AAM7F,2EAA2E;AAC3E,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAED,gEAAgE;AAChE,eAAO,MAAM,oBAAoB,yCAEhC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSP nonce — per-request, generated on demand.
|
|
3
|
+
*
|
|
4
|
+
* timber emits several inline `<script>` tags per HTML response — React's
|
|
5
|
+
* bootstrap script and Fizz runtime, the Flight init/chunk scripts, the
|
|
6
|
+
* segment-tree script, and the post-flush noindex script. Under a strict
|
|
7
|
+
* `Content-Security-Policy` (`script-src 'nonce-…' 'strict-dynamic'`) every
|
|
8
|
+
* one of them needs the request's nonce or the browser refuses to run it.
|
|
9
|
+
*
|
|
10
|
+
* The app opts in by reading `ctx.nonce` in `middleware.ts` and putting it
|
|
11
|
+
* in the CSP header it sets through `ctx.headers`. The first read generates
|
|
12
|
+
* the value and stores it on the request context; the render pipeline reads
|
|
13
|
+
* it back with `getCspNonce()` and stamps it on every inline script. A
|
|
14
|
+
* request whose middleware never reads `ctx.nonce` has no nonce, and its
|
|
15
|
+
* markup is byte-identical to a render without this feature. timber does
|
|
16
|
+
* not parse the CSP header — the app owns the policy, timber owns the
|
|
17
|
+
* markup, and `ctx.nonce` is the one value both are built from.
|
|
18
|
+
*
|
|
19
|
+
* `proxy.ts` cannot participate: it only sees the finished response from
|
|
20
|
+
* `next()`, after the markup exists.
|
|
21
|
+
*
|
|
22
|
+
* See design/13-security.md §"Content Security Policy" (TIM-1414).
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* The request's CSP nonce, creating it on first call. Backs the
|
|
26
|
+
* `ctx.nonce` getter on `MiddlewareContext`. Outside a request context
|
|
27
|
+
* (tests, build-time rendering) a fresh value is returned but not
|
|
28
|
+
* retained, since there is no request for it to belong to.
|
|
29
|
+
*/
|
|
30
|
+
export declare function requestCspNonce(): string;
|
|
31
|
+
/**
|
|
32
|
+
* The request's CSP nonce if middleware asked for one, else `undefined` —
|
|
33
|
+
* in which case the pipeline emits bare `<script>` tags.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getCspNonce(): string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* The ` nonce="…"` attribute fragment for a timber-generated `<script>` tag,
|
|
38
|
+
* or `''` when the request has no nonce. Callers interpolate it directly
|
|
39
|
+
* after the tag name: `` `<script${nonceAttr(nonce)}>` ``.
|
|
40
|
+
*
|
|
41
|
+
* The value comes from `generateNonce` and is base64, so no attribute
|
|
42
|
+
* escaping is required.
|
|
43
|
+
*/
|
|
44
|
+
export declare function nonceAttr(nonce: string | undefined): string;
|
|
45
|
+
//# sourceMappingURL=csp-nonce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csp-nonce.d.ts","sourceRoot":"","sources":["../../src/server/csp-nonce.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAgBH;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAKxC;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,MAAM,GAAG,SAAS,CAEhD;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAE3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-status-page.d.ts","sourceRoot":"","sources":["../../src/server/default-status-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA+BH,wEAAwE;AACxE,eAAO,MAAM,gCAAgC,6BAA6B,CAAC;AAc3E,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"default-status-page.d.ts","sourceRoot":"","sources":["../../src/server/default-status-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA+BH,wEAAwE;AACxE,eAAO,MAAM,gCAAgC,6BAA6B,CAAC;AAc3E,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAgC5D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,GAAG,QAAQ,CAG5F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deny-renderer.d.ts","sourceRoot":"","sources":["../../src/server/deny-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAe7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"deny-renderer.d.ts","sourceRoot":"","sources":["../../src/server/deny-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAe7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,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EAAE,WAAW,EAAE,EAC/B,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,OAAO,EACxB,sBAAsB,EAAE,mBAAmB,EAC3C,gBAAgB,SAAW,GAC1B,OAAO,CAAC,QAAQ,CAAC,CA6CnB"}
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
* to execute before any streaming chunk scripts). Push scripts are emitted
|
|
10
10
|
* as RSC chunks arrive during streaming.
|
|
11
11
|
*
|
|
12
|
+
* Every generator takes the request's CSP nonce (from `getCspNonce()`)
|
|
13
|
+
* so the tags run under a nonce-based `script-src` (TIM-1414).
|
|
14
|
+
*
|
|
12
15
|
* See design/02-rendering-pipeline.md, LOCAL-415
|
|
13
16
|
*/
|
|
14
17
|
/**
|
|
@@ -28,7 +31,7 @@ export declare function htmlEscapeJsonString(str: string): string;
|
|
|
28
31
|
* Also emits the bootstrap signal [0] which tells the client that
|
|
29
32
|
* Flight data is active for this page.
|
|
30
33
|
*/
|
|
31
|
-
export declare function flightInitScript(): string;
|
|
34
|
+
export declare function flightInitScript(nonce?: string): string;
|
|
32
35
|
/**
|
|
33
36
|
* Generate a push script for a Flight data chunk.
|
|
34
37
|
*
|
|
@@ -38,5 +41,5 @@ export declare function flightInitScript(): string;
|
|
|
38
41
|
* never runs. The `||[]` guard ensures the array is created on first
|
|
39
42
|
* push if needed, preventing a TypeError. See TIM-559.
|
|
40
43
|
*/
|
|
41
|
-
export declare function flightChunkScript(data: string): string;
|
|
44
|
+
export declare function flightChunkScript(data: string, nonce?: string): string;
|
|
42
45
|
//# sourceMappingURL=flight-scripts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flight-scripts.d.ts","sourceRoot":"","sources":["../../src/server/flight-scripts.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"flight-scripts.d.ts","sourceRoot":"","sources":["../../src/server/flight-scripts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMxD;AAOD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAGtE"}
|
|
@@ -45,9 +45,9 @@ export declare function encodeUtf8(text: string): Uint8Array;
|
|
|
45
45
|
* everything else.
|
|
46
46
|
*/
|
|
47
47
|
export declare class BufferAggregator {
|
|
48
|
-
private readonly maxBufferByteLength;
|
|
49
48
|
private chunks;
|
|
50
49
|
private byteLength;
|
|
50
|
+
private readonly maxBufferByteLength;
|
|
51
51
|
constructor(maxBufferByteLength?: number);
|
|
52
52
|
/**
|
|
53
53
|
* Append a chunk. Returns `true` if the caller should flush synchronously
|
|
@@ -197,6 +197,20 @@ export declare function injectorFlush(state: InjectorState): Uint8Array | null;
|
|
|
197
197
|
* **No polling.** See design/02-rendering-pipeline.md §"No Polling".
|
|
198
198
|
* **Always timeout-guarded reads.** Per design/02 §"Streaming Constraints".
|
|
199
199
|
*/
|
|
200
|
+
export interface FlightInjectorOptions {
|
|
201
|
+
/**
|
|
202
|
+
* Timeout in milliseconds for individual RSC stream reads. If a single
|
|
203
|
+
* `rscReader.read()` call does not resolve within this duration, the
|
|
204
|
+
* read is aborted and the stream errors with a `RenderTimeoutError`.
|
|
205
|
+
* Default: 30000 (30s). `0` ("disabled") still enforces a 120s ceiling
|
|
206
|
+
* so a stalled RSC stream can never hang the connection forever.
|
|
207
|
+
*/
|
|
208
|
+
renderTimeoutMs?: number;
|
|
209
|
+
/** Signal that fires when an unhandled RSC error is detected. */
|
|
210
|
+
errorSignal?: AbortSignal;
|
|
211
|
+
/** Request CSP nonce, stamped on every emitted `<script>` (TIM-1414). */
|
|
212
|
+
nonce?: string;
|
|
213
|
+
}
|
|
200
214
|
export declare class FlightInjectorCore {
|
|
201
215
|
readonly machine: Machine<FlightInjectionState, FlightInjectionEvent>;
|
|
202
216
|
/** Script chunks waiting to be drained between HTML chunks. */
|
|
@@ -204,10 +218,11 @@ export declare class FlightInjectorCore {
|
|
|
204
218
|
private readonly rscReader;
|
|
205
219
|
private readonly timeoutMs;
|
|
206
220
|
private readonly errorSignal?;
|
|
221
|
+
private readonly nonce?;
|
|
207
222
|
private readonly decoder;
|
|
208
223
|
private pullPromise;
|
|
209
224
|
private _aborted;
|
|
210
|
-
constructor(rscStream: ReadableStream<Uint8Array>,
|
|
225
|
+
constructor(rscStream: ReadableStream<Uint8Array>, options?: FlightInjectorOptions);
|
|
211
226
|
/** Tell the machine the first HTML chunk has arrived. Idempotent-ish: caller checks. */
|
|
212
227
|
notifyFirstChunk(): void;
|
|
213
228
|
/** Tell the machine HTML output is finished — pull loop will stop yielding. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-injector-core.d.ts","sourceRoot":"","sources":["../../src/server/html-injector-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AAOrC,4DAA4D;AAC5D,eAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,qFAAqF;AACrF,eAAO,MAAM,YAAY,EAAE,UAAmC,CAAC;AAE/D,0FAA0F;AAC1F,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAEnD;AAID;;;;;;;;;;;;GAYG;AACH,qBAAa,gBAAgB;
|
|
1
|
+
{"version":3,"file":"html-injector-core.d.ts","sourceRoot":"","sources":["../../src/server/html-injector-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO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-system.md §"Entry Files"
|
|
19
19
|
*/
|
|
20
|
+
import { type FlightInjectorOptions } from './html-injector-core.ts';
|
|
20
21
|
export interface BufferedTransformOptions {
|
|
21
22
|
/**
|
|
22
23
|
* Flush synchronously once the buffer reaches this many bytes.
|
|
@@ -72,7 +73,7 @@ export declare function injectScripts(stream: ReadableStream<Uint8Array>, script
|
|
|
72
73
|
* init script (which creates `__timber_f`) is in `<head>` via
|
|
73
74
|
* `flightInitScript()` — see flight-scripts.ts.
|
|
74
75
|
*/
|
|
75
|
-
export declare function createInlinedRscStream(rscStream: ReadableStream<Uint8Array>, renderTimeoutMs?: number): ReadableStream<Uint8Array>;
|
|
76
|
+
export declare function createInlinedRscStream(rscStream: ReadableStream<Uint8Array>, renderTimeoutMs?: number, nonce?: string): ReadableStream<Uint8Array>;
|
|
76
77
|
/**
|
|
77
78
|
* Progressively inline RSC Flight payload chunks into the HTML stream.
|
|
78
79
|
*
|
|
@@ -94,7 +95,7 @@ export declare function createInlinedRscStream(rscStream: ReadableStream<Uint8Ar
|
|
|
94
95
|
* completion is signaled by the `DOMContentLoaded` event on the client
|
|
95
96
|
* side — no custom done flag needed.
|
|
96
97
|
*/
|
|
97
|
-
export declare function injectRscPayload(htmlStream: ReadableStream<Uint8Array>, rscStream: ReadableStream<Uint8Array> | undefined,
|
|
98
|
+
export declare function injectRscPayload(htmlStream: ReadableStream<Uint8Array>, rscStream: ReadableStream<Uint8Array> | undefined, options?: FlightInjectorOptions): ReadableStream<Uint8Array>;
|
|
98
99
|
/**
|
|
99
100
|
* Client bootstrap configuration returned by buildClientScripts.
|
|
100
101
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-injectors.d.ts","sourceRoot":"","sources":["../../src/server/html-injectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"html-injectors.d.ts","sourceRoot":"","sources":["../../src/server/html-injectors.ts"],"names":[],"mappings":"AAAA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;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,cAAc,EAAE,OAAO,CAAA;KAAE,CAAC;IACjE,GAAG,EAAE,OAAO,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,qBAAqB,EAAE,aAAa,CAAC;CAC7D,GAAG,qBAAqB,CAqExB"}
|
package/dist/server/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as formFlashAls } from "../_chunks/als-registry-C6kcfprT.js";
|
|
2
|
-
import { D as getSegmentParams, J as withSpan, L as isDebug, P as getCookieJar, R as isDevMode, S as waitUntil, T as getHeaders, U as getSpanId, W as getTraceId, _ as RedirectSignal, b as redirect, g as DenySignal, x as redirectExternal, y as deny, z as addSpanEvent } from "../_chunks/logger-
|
|
2
|
+
import { D as getSegmentParams, J as withSpan, L as isDebug, P as getCookieJar, R as isDevMode, S as waitUntil, T as getHeaders, U as getSpanId, W as getTraceId, _ as RedirectSignal, b as redirect, g as DenySignal, x as redirectExternal, y as deny, z as addSpanEvent } from "../_chunks/logger-DDirEsn7.js";
|
|
3
3
|
import { t as formatSize } from "../_chunks/format-BKclgVbk.js";
|
|
4
|
-
import { a as parseFormData, i as coerce, n as revalidatePath, r as revalidateTag } from "../_chunks/actions-
|
|
4
|
+
import { a as parseFormData, i as coerce, n as revalidatePath, r as revalidateTag } from "../_chunks/actions-BS-m5SLv.js";
|
|
5
5
|
//#region src/shared/redirect-type.ts
|
|
6
6
|
/**
|
|
7
7
|
* Next.js redirect type discriminator.
|
package/dist/server/internal.js
CHANGED
|
@@ -3,14 +3,16 @@ import { a as canonicalize, c as getMetadataRouteAutoLink, l as getMetadataRoute
|
|
|
3
3
|
import { n as isMdxFilePath } from "../_chunks/mdx-file-CXyHGUpS.js";
|
|
4
4
|
import { n as classifyUrlSegment, r as effectiveUrlSegment } from "../_chunks/segment-classify-C539Pa2O.js";
|
|
5
5
|
import { a as timingAls, r as requestContextAls, t as earlyHintsSenderAls } from "../_chunks/als-registry-C6kcfprT.js";
|
|
6
|
-
import { A as setMatchedSegmentPath, C as applyRequestHeaderOverlay, D as getSegmentParams, E as getSearchParams, F as getSetCookieHeaders, G as replaceTraceId, H as getOtelTraceId, I as getWaitUntil, J as withSpan, K as runWithTraceId, L as isDebug, M as setSegmentParams, N as getCookie, O as markResponseFlushed, V as generateTraceId, W as getTraceId, _ as RedirectSignal, a as logProxyError, c as logRequestReceived, d as logSwrRefetchFailed, f as logWaitUntilRejected, g as DenySignal, h as swallow, i as logMiddlewareShortCircuit, j as setMutableCookieContext, k as runWithRequestContext, l as logRouteError, m as setLogger, n as logCacheMiss, o as logRenderError, p as logWaitUntilUnsupported, q as setSpanAttribute, r as logMiddlewareError, s as logRequestCompleted, t as getLogger, u as logSlowRequest, v as RenderError, w as getHeader } from "../_chunks/logger-
|
|
7
|
-
import { i as isRscCacheKeyShape, n as RSC_KEY_PARAM, s as rscCacheKey, t as RSC_KEY_HEADERS } from "../_chunks/rsc-cache-key-
|
|
8
|
-
import { i as collectRouteModulepreloads, n as collectRouteCss, r as collectRouteFonts } from "../_chunks/build-manifest-
|
|
9
|
-
import { i as coerce, t as executeAction } from "../_chunks/actions-
|
|
10
|
-
import { a as getManifestEntry, b as wasInvalidatedSince, c as lookupPrebuiltPayload, d as checkVersionSkew, i as storeOverlayEntry, l as setPrebuiltPayloadSource, n as lookupOverlay, o as hasPrebuiltPayloadSource, r as overlayKey, s as isParamIndependent, u as applyReloadHeaders, v as currentInvalidationEpoch,
|
|
11
|
-
import "../_chunks/
|
|
6
|
+
import { A as setMatchedSegmentPath, C as applyRequestHeaderOverlay, D as getSegmentParams, E as getSearchParams, F as getSetCookieHeaders, G as replaceTraceId, H as getOtelTraceId, I as getWaitUntil, J as withSpan, K as runWithTraceId, L as isDebug, M as setSegmentParams, N as getCookie, O as markResponseFlushed, V as generateTraceId, W as getTraceId, _ as RedirectSignal, a as logProxyError, c as logRequestReceived, d as logSwrRefetchFailed, f as logWaitUntilRejected, g as DenySignal, h as swallow, i as logMiddlewareShortCircuit, j as setMutableCookieContext, k as runWithRequestContext, l as logRouteError, m as setLogger, n as logCacheMiss, o as logRenderError, p as logWaitUntilUnsupported, q as setSpanAttribute, r as logMiddlewareError, s as logRequestCompleted, t as getLogger, u as logSlowRequest, v as RenderError, w as getHeader } from "../_chunks/logger-DDirEsn7.js";
|
|
7
|
+
import { i as isRscCacheKeyShape, n as RSC_KEY_PARAM, s as rscCacheKey, t as RSC_KEY_HEADERS } from "../_chunks/rsc-cache-key-ClUiXQnK.js";
|
|
8
|
+
import { a as requestCspNonce, i as collectRouteModulepreloads, n as collectRouteCss, r as collectRouteFonts } from "../_chunks/build-manifest-DTmSGLRz.js";
|
|
9
|
+
import { i as coerce, t as executeAction } from "../_chunks/actions-BS-m5SLv.js";
|
|
10
|
+
import { a as getManifestEntry, b as wasInvalidatedSince, c as lookupPrebuiltPayload, d as checkVersionSkew, i as storeOverlayEntry, l as setPrebuiltPayloadSource, n as lookupOverlay, o as hasPrebuiltPayloadSource, r as overlayKey, s as isParamIndependent, u as applyReloadHeaders, v as currentInvalidationEpoch, y as lastInvalidationEpochFor } from "../_chunks/cache-api-DqzgTEqk.js";
|
|
11
|
+
import { n as createSingleflight } from "../_chunks/singleflight-2lUWfcAk.js";
|
|
12
|
+
import "../_chunks/error-boundary-BvRCCmbN.js";
|
|
12
13
|
import { n as toBracketKey } from "../_chunks/resolve-schema-CBR6Lm4i.js";
|
|
13
|
-
import {
|
|
14
|
+
import { t as normalizeParamValue } from "../_chunks/param-value-C8TNYchQ.js";
|
|
15
|
+
import "../_chunks/segment-context-D9_89u34.js";
|
|
14
16
|
import { n as rscErrorEnvelope } from "../_chunks/rsc-error-envelope-tT5PJs4q.js";
|
|
15
17
|
import { createHash } from "node:crypto";
|
|
16
18
|
import { readFile } from "node:fs/promises";
|
|
@@ -868,8 +870,18 @@ function renderMetadataToElements(metadata) {
|
|
|
868
870
|
});
|
|
869
871
|
}
|
|
870
872
|
}
|
|
871
|
-
if (metadata.openGraph)
|
|
872
|
-
|
|
873
|
+
if (metadata.openGraph) {
|
|
874
|
+
const og = { ...metadata.openGraph };
|
|
875
|
+
if (og.title === void 0 && typeof metadata.title === "string") og.title = metadata.title;
|
|
876
|
+
if (og.description === void 0 && metadata.description) og.description = metadata.description;
|
|
877
|
+
renderOpenGraph(og, elements);
|
|
878
|
+
}
|
|
879
|
+
if (metadata.twitter) {
|
|
880
|
+
const tw = { ...metadata.twitter };
|
|
881
|
+
if (tw.title === void 0) tw.title = metadata.openGraph?.title !== void 0 ? metadata.openGraph.title : typeof metadata.title === "string" ? metadata.title : void 0;
|
|
882
|
+
if (tw.description === void 0) tw.description = metadata.openGraph?.description !== void 0 ? metadata.openGraph.description : metadata.description;
|
|
883
|
+
renderTwitter(tw, elements);
|
|
884
|
+
}
|
|
873
885
|
if (metadata.icons) renderIcons(metadata.icons, elements);
|
|
874
886
|
if (metadata.manifest) elements.push({
|
|
875
887
|
tag: "link",
|
|
@@ -1740,36 +1752,32 @@ function pathnameMatchesPattern(pathname, pattern) {
|
|
|
1740
1752
|
return pi === pathParts.length;
|
|
1741
1753
|
}
|
|
1742
1754
|
//#endregion
|
|
1743
|
-
//#region src/client/
|
|
1755
|
+
//#region src/client/global-context.ts
|
|
1744
1756
|
/**
|
|
1745
|
-
*
|
|
1746
|
-
*
|
|
1747
|
-
* During partial navigation (server skips unchanged sync layouts), the
|
|
1748
|
-
* router builds a Map of segment path → ReactNode updates and passes it
|
|
1749
|
-
* as the context value. Mounted SegmentOutlet components read from this
|
|
1750
|
-
* context to decide whether to render the update or their cached content.
|
|
1757
|
+
* createGlobalContext — a React context with a process-wide singleton identity.
|
|
1751
1758
|
*
|
|
1752
1759
|
* SINGLETON GUARANTEE: Uses globalThis + Symbol.for — same pattern as
|
|
1753
|
-
* NavigationContext. The RSC client bundler can duplicate
|
|
1754
|
-
*
|
|
1755
|
-
*
|
|
1756
|
-
*
|
|
1757
|
-
*
|
|
1760
|
+
* NavigationContext. The RSC client bundler can duplicate a module across
|
|
1761
|
+
* chunks (browser-entry graph + client-reference graph). With ESM output,
|
|
1762
|
+
* each chunk gets its own module scope — a bare createContext at module
|
|
1763
|
+
* level would create separate instances per chunk. globalThis guarantees a
|
|
1764
|
+
* single instance regardless of duplication.
|
|
1758
1765
|
*
|
|
1759
1766
|
* See design/19-client-navigation.md §"Singleton Guarantee via globalThis"
|
|
1760
1767
|
*/
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
const existing =
|
|
1768
|
+
function createGlobalContext(key, defaultValue) {
|
|
1769
|
+
const g = globalThis;
|
|
1770
|
+
const sym = Symbol.for(key);
|
|
1771
|
+
const existing = g[sym];
|
|
1765
1772
|
if (existing !== void 0) return existing;
|
|
1766
1773
|
if (typeof React.createContext === "function") {
|
|
1767
|
-
const ctx = React.createContext(
|
|
1768
|
-
|
|
1774
|
+
const ctx = React.createContext(defaultValue);
|
|
1775
|
+
g[sym] = ctx;
|
|
1769
1776
|
return ctx;
|
|
1770
1777
|
}
|
|
1771
1778
|
}
|
|
1772
|
-
|
|
1779
|
+
createGlobalContext("__timber_segment_update_ctx", /* @__PURE__ */ new Map());
|
|
1780
|
+
createGlobalContext("__timber_slot_content_cache_ctx", null);
|
|
1773
1781
|
//#endregion
|
|
1774
1782
|
//#region src/client/segment-outlet.tsx
|
|
1775
1783
|
/**
|
|
@@ -1778,19 +1786,29 @@ getOrCreateContext$1();
|
|
|
1778
1786
|
* Each layout in the segment tree is wrapped with a SegmentOutlet that:
|
|
1779
1787
|
* 1. Knows its segment path (prop from the server)
|
|
1780
1788
|
* 2. Reads from SegmentUpdateContext for partial navigation updates
|
|
1781
|
-
* 3.
|
|
1789
|
+
* 3. Reads from — and, at commit, writes to — the router's slot content
|
|
1790
|
+
* cache, so a skipped parallel slot keeps showing what it last committed
|
|
1782
1791
|
*
|
|
1783
|
-
* On full navigation: receives new children via props
|
|
1792
|
+
* On full navigation: receives new children via props and renders them.
|
|
1784
1793
|
* On partial navigation (this segment skipped): the context map has no entry
|
|
1785
|
-
* for this path, so the outlet
|
|
1794
|
+
* for this path, so the outlet renders its children — which, because the
|
|
1795
|
+
* router re-wraps the *retained* tree, are the same elements as before,
|
|
1796
|
+
* preserving layout state.
|
|
1786
1797
|
* On partial navigation (this segment updated): the context map has content
|
|
1787
1798
|
* for this path, so the outlet renders the update.
|
|
1799
|
+
* On a skipped parallel slot (`skip=true`, children null): the outlet renders
|
|
1800
|
+
* the content it last committed for this path.
|
|
1788
1801
|
*
|
|
1789
1802
|
* Uses React context instead of useSyncExternalStore to stay compatible
|
|
1790
1803
|
* with concurrent rendering (transitions). All outlets re-render when the
|
|
1791
1804
|
* context value changes, but each bails out quickly if its segment has
|
|
1792
1805
|
* no update — same approach as Next.js LayoutRouter.
|
|
1793
1806
|
*
|
|
1807
|
+
* Render is a pure read. The only write — recording committed slot content —
|
|
1808
|
+
* happens in a layout effect, so a render React throws away (a superseded
|
|
1809
|
+
* transition, a Suspense retry) cannot poison what a later `skip=true`
|
|
1810
|
+
* resolves to (TIM-1423). See client/slot-content-cache-context.ts.
|
|
1811
|
+
*
|
|
1794
1812
|
* Security: performance optimization only. The server always runs all
|
|
1795
1813
|
* access.ts files regardless of segment skipping.
|
|
1796
1814
|
* See design/13-security.md §"State tree manipulation".
|
|
@@ -2112,6 +2130,9 @@ async function runMiddlewarePhase(config, req, match, responseHeaders, requestHe
|
|
|
2112
2130
|
requestHeaders: requestHeaderOverlay,
|
|
2113
2131
|
headers: responseHeaders,
|
|
2114
2132
|
segmentParams: match.segmentParams,
|
|
2133
|
+
get nonce() {
|
|
2134
|
+
return requestCspNonce();
|
|
2135
|
+
},
|
|
2115
2136
|
earlyHints: (hints) => {
|
|
2116
2137
|
for (const hint of hints) {
|
|
2117
2138
|
let value;
|
|
@@ -3650,13 +3671,27 @@ function wrapInSlotsProvider(shell, slotValues) {
|
|
|
3650
3671
|
}
|
|
3651
3672
|
//#endregion
|
|
3652
3673
|
//#region src/server/prebuilt/key-discipline.ts
|
|
3653
|
-
/** Components already warned — exported so tests can reset between cases. */
|
|
3654
|
-
var keyDisciplineWarned = /* @__PURE__ */ new Set();
|
|
3655
3674
|
var REQUEST_CONTEXT_FIELDS = {
|
|
3656
3675
|
headers: "headers()",
|
|
3657
3676
|
parsedCookies: "cookies()",
|
|
3658
3677
|
searchParams: "searchParams"
|
|
3659
3678
|
};
|
|
3679
|
+
/** Rate-limit interval: one diagnostic per component per 60 seconds. */
|
|
3680
|
+
var RATE_LIMIT_MS = 6e4;
|
|
3681
|
+
/** Last emission timestamp per component ID. */
|
|
3682
|
+
var lastEmitted = /* @__PURE__ */ new Map();
|
|
3683
|
+
var strict = false;
|
|
3684
|
+
/**
|
|
3685
|
+
* Whether the proxy should be created for this component on this render.
|
|
3686
|
+
* Returns true when strict mode is on (always check) or enough time has
|
|
3687
|
+
* elapsed since the last diagnostic for this component.
|
|
3688
|
+
*/
|
|
3689
|
+
function shouldCheckKeyDiscipline(id) {
|
|
3690
|
+
if (strict) return true;
|
|
3691
|
+
const last = lastEmitted.get(id);
|
|
3692
|
+
if (last === void 0) return true;
|
|
3693
|
+
return Date.now() - last >= RATE_LIMIT_MS;
|
|
3694
|
+
}
|
|
3660
3695
|
/**
|
|
3661
3696
|
* Wrap a store with a proxy that records per-request field access.
|
|
3662
3697
|
* The proxy forwards all reads/writes transparently — it only observes.
|
|
@@ -3672,11 +3707,25 @@ function createKeyDisciplineProxy(store) {
|
|
|
3672
3707
|
accessedApis
|
|
3673
3708
|
};
|
|
3674
3709
|
}
|
|
3710
|
+
/**
|
|
3711
|
+
* Emit the key-discipline diagnostic or throw in strict mode.
|
|
3712
|
+
*
|
|
3713
|
+
* In strict mode: throws an error so the tainted payload is never cached.
|
|
3714
|
+
* In default mode: emits a structured error-level diagnostic through the
|
|
3715
|
+
* logger (same path as render errors), rate-limited per component.
|
|
3716
|
+
*/
|
|
3675
3717
|
function emitKeyDisciplineWarning(id, apis) {
|
|
3676
|
-
if (keyDisciplineWarned.has(id)) return;
|
|
3677
|
-
keyDisciplineWarned.add(id);
|
|
3678
3718
|
const apiList = Array.from(apis).join(", ");
|
|
3679
|
-
|
|
3719
|
+
if (strict) throw new Error(`[timber] cache.component key-discipline violation: "${id}" reads ${apiList} during a cache capture render. The cache key does not include request-derived values — caching this output would serve one user's data to another. Either pass request-derived values as props (included in the cache key) or remove the ${apiList} call. To downgrade this to a warning, set cache.strictKeyDiscipline: false in timber.config.ts.`);
|
|
3720
|
+
const now = Date.now();
|
|
3721
|
+
const last = lastEmitted.get(id);
|
|
3722
|
+
if (last !== void 0 && now - last < RATE_LIMIT_MS) return;
|
|
3723
|
+
lastEmitted.set(id, now);
|
|
3724
|
+
getLogger().error("cache.component cross-user data leak risk", {
|
|
3725
|
+
component: id,
|
|
3726
|
+
accessedApis: Array.from(apis),
|
|
3727
|
+
message: `cache.component "${id}" reads ${apiList} but the cache key is computed from props and segment params only. If the output varies by ${apiList}, different users may see each other's cached content. Either pass request-derived values as props (included in the cache key) or remove the ${apiList} call.`
|
|
3728
|
+
});
|
|
3680
3729
|
}
|
|
3681
3730
|
//#endregion
|
|
3682
3731
|
//#region src/server/prebuilt/capture-state.ts
|
|
@@ -3904,7 +3953,7 @@ async function captureComponentPayload(id, component, props) {
|
|
|
3904
3953
|
const element = createElement(component, props);
|
|
3905
3954
|
let renderErrored = false;
|
|
3906
3955
|
const store = requestContextAls.getStore();
|
|
3907
|
-
const discipline = store &&
|
|
3956
|
+
const discipline = store && shouldCheckKeyDiscipline(id) ? createKeyDisciplineProxy(store) : null;
|
|
3908
3957
|
const doCapture = async () => {
|
|
3909
3958
|
beginCapture(id);
|
|
3910
3959
|
try {
|