@timber-js/app 0.2.0-alpha.239 → 0.2.0-alpha.240
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-Top9GftB.js → actions-DIgnvDrG.js} +4 -4
- package/dist/_chunks/{actions-Top9GftB.js.map → actions-DIgnvDrG.js.map} +1 -1
- package/dist/_chunks/{als-registry-DpygwCp0.js → als-registry-PPYstxK0.js} +2 -1
- package/dist/_chunks/{als-registry-DpygwCp0.js.map → als-registry-PPYstxK0.js.map} +1 -1
- package/dist/_chunks/{cache-api-Bo8c7XVF.js → cache-api-uWQwuxWb.js} +5 -5
- package/dist/_chunks/{cache-api-Bo8c7XVF.js.map → cache-api-uWQwuxWb.js.map} +1 -1
- package/dist/_chunks/{chains-DMoHX4yH.js → chains-C7CExrUI.js} +2 -2
- package/dist/_chunks/{chains-DMoHX4yH.js.map → chains-C7CExrUI.js.map} +1 -1
- package/dist/_chunks/chains-CSslTUdI.js +1 -0
- package/dist/_chunks/{classify-BwyAd-dZ.js → classify-Cj9EeZoL.js} +2 -2
- package/dist/_chunks/{classify-BwyAd-dZ.js.map → classify-Cj9EeZoL.js.map} +1 -1
- package/dist/_chunks/{cli-check-DQAD9MLo.js → cli-check-C3QOAru7.js} +3 -3
- package/dist/_chunks/{cli-check-DQAD9MLo.js.map → cli-check-C3QOAru7.js.map} +1 -1
- package/dist/_chunks/{cli-schema-sync-C_xNLqBj.js → cli-schema-sync-BRxZz66D.js} +1 -1
- package/dist/_chunks/{cli-schema-sync-CmGls3dc.js → cli-schema-sync-DQUS_o3V.js} +2 -2
- package/dist/_chunks/{cli-schema-sync-CmGls3dc.js.map → cli-schema-sync-DQUS_o3V.js.map} +1 -1
- package/dist/_chunks/{client-dep-entries-C5BTQtFS.js → client-dep-entries-ZETBdLgv.js} +2 -2
- package/dist/_chunks/{client-dep-entries-C5BTQtFS.js.map → client-dep-entries-ZETBdLgv.js.map} +1 -1
- package/dist/_chunks/{convention-lint-GQA6WTRo.js → convention-lint-BoVISNS6.js} +3 -3
- package/dist/_chunks/{convention-lint-GQA6WTRo.js.map → convention-lint-BoVISNS6.js.map} +1 -1
- package/dist/_chunks/dev-server-B8roKA3Q.js +1 -0
- package/dist/_chunks/{dev-server-Cr3_Fu5A.js → dev-server-C5R6jx8Q.js} +2 -2
- package/dist/_chunks/{dev-server-Cr3_Fu5A.js.map → dev-server-C5R6jx8Q.js.map} +1 -1
- package/dist/_chunks/{dev-span-RsVeYYc_.js → dev-span-0aG7Q_Ph.js} +3 -7
- package/dist/_chunks/dev-span-0aG7Q_Ph.js.map +1 -0
- package/dist/_chunks/{error-boundary-Bh-egWUI.js → error-boundary-DB51f9ih.js} +98 -419
- package/dist/_chunks/error-boundary-DB51f9ih.js.map +1 -0
- package/dist/_chunks/{flight-source-node-BsrlUjMO.js → flight-source-node-D9cHBhjP.js} +7 -4
- package/dist/_chunks/flight-source-node-D9cHBhjP.js.map +1 -0
- package/dist/_chunks/{json-lossy-check-D47R9Fp5.js → json-lossy-check-Y1GxqVX_.js} +2 -2
- package/dist/_chunks/{json-lossy-check-D47R9Fp5.js.map → json-lossy-check-Y1GxqVX_.js.map} +1 -1
- package/dist/_chunks/{live-graph-HcLScfiV.js → live-graph-BDQWvnMm.js} +4 -4
- package/dist/_chunks/{live-graph-HcLScfiV.js.map → live-graph-BDQWvnMm.js.map} +1 -1
- package/dist/_chunks/{logger-DDLtp5e-.js → logger-DmRR9tmZ.js} +2 -2
- package/dist/_chunks/{logger-DDLtp5e-.js.map → logger-DmRR9tmZ.js.map} +1 -1
- package/dist/_chunks/metadata-routes-MXNjWOt5.js.map +1 -1
- package/dist/_chunks/{node-response-omewa8e6.js → node-response-yp8zdyRp.js} +2 -2
- package/dist/_chunks/{node-response-omewa8e6.js.map → node-response-yp8zdyRp.js.map} +1 -1
- package/dist/_chunks/plugin-context-BtaQcMuh.js.map +1 -1
- package/dist/_chunks/{poison-scan-DONdiCGX.js → poison-scan-WQgUydF_.js} +2 -2
- package/dist/_chunks/{poison-scan-DONdiCGX.js.map → poison-scan-WQgUydF_.js.map} +1 -1
- package/dist/_chunks/{scanner-DSAJjH0x.js → scanner-C9Lrf77z.js} +3 -2
- package/dist/_chunks/{scanner-DSAJjH0x.js.map → scanner-C9Lrf77z.js.map} +1 -1
- package/dist/_chunks/{sizeof-DVhEVN_y.js → sizeof-BISkSaU0.js} +2 -2
- package/dist/_chunks/{sizeof-DVhEVN_y.js.map → sizeof-BISkSaU0.js.map} +1 -1
- package/dist/_chunks/{walkers-96YopJds.js → walkers-Bxv4v7tX.js} +3 -3
- package/dist/_chunks/{walkers-96YopJds.js.map → walkers-Bxv4v7tX.js.map} +1 -1
- package/dist/adapters/cloudflare-kv-cache.js +1 -1
- package/dist/analyze/crawl-entry.js +3 -3
- package/dist/analyze/graph-command.js +2 -2
- package/dist/cache/index.js +2 -2
- package/dist/cache/stores/memory.js +1 -1
- package/dist/cdn/workers-cache-purge.js +1 -1
- package/dist/cli.js +3 -3
- package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -1
- package/dist/client/browser-entry/hydrate.d.ts +1 -1
- package/dist/client/browser-entry/router-init.d.ts.map +1 -1
- package/dist/client/error-boundary.d.ts +1 -0
- package/dist/client/error-boundary.d.ts.map +1 -1
- package/dist/client/error-boundary.js +1 -1
- package/dist/client/history.d.ts +4 -5
- package/dist/client/history.d.ts.map +1 -1
- package/dist/client/index.js +6 -7
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.d.ts +1 -1
- package/dist/client/internal.d.ts.map +1 -1
- package/dist/client/internal.js +194 -55
- package/dist/client/internal.js.map +1 -1
- package/dist/client/navigation-commit.d.ts +6 -25
- package/dist/client/navigation-commit.d.ts.map +1 -1
- package/dist/client/outlet-content-cache.d.ts +59 -0
- package/dist/client/outlet-content-cache.d.ts.map +1 -0
- package/dist/client/outlet-scope-context.d.ts +30 -0
- package/dist/client/outlet-scope-context.d.ts.map +1 -0
- package/dist/client/params-context.d.ts +10 -11
- package/dist/client/params-context.d.ts.map +1 -1
- package/dist/client/router-pipeline.d.ts +5 -5
- package/dist/client/router-pipeline.d.ts.map +1 -1
- package/dist/client/router-types.d.ts +10 -24
- package/dist/client/router-types.d.ts.map +1 -1
- package/dist/client/router.d.ts.map +1 -1
- package/dist/client/rsc-fetch.d.ts +4 -17
- package/dist/client/rsc-fetch.d.ts.map +1 -1
- package/dist/client/segment-cache.d.ts +15 -103
- package/dist/client/segment-cache.d.ts.map +1 -1
- package/dist/client/segment-outlet.d.ts +28 -52
- package/dist/client/segment-outlet.d.ts.map +1 -1
- package/dist/client/stale-segment.d.ts +39 -0
- package/dist/client/stale-segment.d.ts.map +1 -0
- package/dist/client/use-segment-params.d.ts +1 -1
- package/dist/config-types.d.ts +7 -6
- package/dist/config-types.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -732
- package/dist/index.js.map +1 -1
- package/dist/native/rsc/manifest.json +6 -4
- package/dist/native/rsc/routing/segment-keys.js +3 -11
- package/dist/native/rsc/routing/segment-keys.js.map +1 -1
- package/dist/native/rsc/server/access-gate.js +3 -7
- package/dist/native/rsc/server/access-gate.js.map +1 -1
- package/dist/native/rsc/server/als-registry.js +2 -1
- package/dist/native/rsc/server/als-registry.js.map +1 -1
- package/dist/native/rsc/server/build-manifest.js.map +1 -1
- package/dist/native/rsc/server/chain-url-parts.js +1 -6
- package/dist/native/rsc/server/chain-url-parts.js.map +1 -1
- package/dist/native/rsc/server/client-state-tree.js +33 -0
- package/dist/native/rsc/server/client-state-tree.js.map +1 -0
- package/dist/native/rsc/server/flight-source-node.js +5 -2
- package/dist/native/rsc/server/flight-source-node.js.map +1 -1
- package/dist/native/rsc/server/flight-source.js +46 -7
- package/dist/native/rsc/server/flight-source.js.map +1 -1
- package/dist/native/rsc/server/pipeline-interception.js +1 -1
- package/dist/native/rsc/server/publish-params.js.map +1 -1
- package/dist/native/rsc/server/route-element-builder.js +43 -61
- package/dist/native/rsc/server/route-element-builder.js.map +1 -1
- package/dist/native/rsc/server/rsc-entry/helpers.js +5 -28
- package/dist/native/rsc/server/rsc-entry/helpers.js.map +1 -1
- package/dist/native/rsc/server/rsc-entry/render-route.js +33 -7
- package/dist/native/rsc/server/rsc-entry/render-route.js.map +1 -1
- package/dist/native/rsc/server/rsc-entry/revalidate-renderer.js +2 -1
- package/dist/native/rsc/server/rsc-entry/revalidate-renderer.js.map +1 -1
- package/dist/native/rsc/server/rsc-entry/rsc-payload.js +2 -5
- package/dist/native/rsc/server/rsc-entry/rsc-payload.js.map +1 -1
- package/dist/native/rsc/server/rsc-entry/rsc-stream.js +44 -40
- package/dist/native/rsc/server/rsc-entry/rsc-stream.js.map +1 -1
- package/dist/native/rsc/server/rsc-entry/ssr-renderer.js +1 -1
- package/dist/native/rsc/server/rsc-entry/ssr-renderer.js.map +1 -1
- package/dist/native/rsc/server/segment-hash/capture.js +107 -0
- package/dist/native/rsc/server/segment-hash/capture.js.map +1 -0
- package/dist/native/rsc/server/segment-hash/outlet.js +81 -0
- package/dist/native/rsc/server/segment-hash/outlet.js.map +1 -0
- package/dist/native/rsc/server/segment-hash/stream-tap.js +139 -0
- package/dist/native/rsc/server/segment-hash/stream-tap.js.map +1 -0
- package/dist/native/rsc/server/segment-hash/value-hash.js +171 -0
- package/dist/native/rsc/server/segment-hash/value-hash.js.map +1 -0
- package/dist/native/rsc/server/slot-resolver.js +20 -124
- package/dist/native/rsc/server/slot-resolver.js.map +1 -1
- package/dist/native/rsc/server/vite-handoff-rsc.js.map +1 -1
- package/dist/native/rsc/shared/outlet-decision.js +5 -0
- package/dist/native/rsc/shared/outlet-decision.js.map +1 -0
- package/dist/native/ssr/client/error-boundary.js +16 -3
- package/dist/native/ssr/client/error-boundary.js.map +1 -1
- package/dist/native/ssr/client/navigation-commit.js +1 -5
- package/dist/native/ssr/client/navigation-commit.js.map +1 -1
- package/dist/native/ssr/client/outlet-content-cache.js +53 -0
- package/dist/native/ssr/client/outlet-content-cache.js.map +1 -0
- package/dist/native/ssr/client/outlet-scope-context.js +12 -0
- package/dist/native/ssr/client/outlet-scope-context.js.map +1 -0
- package/dist/native/ssr/client/params-context.js.map +1 -1
- package/dist/native/ssr/client/rsc-fetch.js +1 -12
- package/dist/native/ssr/client/rsc-fetch.js.map +1 -1
- package/dist/native/ssr/client/segment-outlet.js +34 -13
- package/dist/native/ssr/client/segment-outlet.js.map +1 -1
- package/dist/native/ssr/client/stale-segment.js +29 -0
- package/dist/native/ssr/client/stale-segment.js.map +1 -0
- package/dist/native/ssr/manifest.json +5 -4
- package/dist/native/ssr/routing/segment-keys.js +5 -1
- package/dist/native/ssr/routing/segment-keys.js.map +1 -1
- package/dist/native/ssr/server/access-gate.js +3 -7
- package/dist/native/ssr/server/access-gate.js.map +1 -1
- package/dist/native/ssr/server/als-registry.js +1 -0
- package/dist/native/ssr/server/als-registry.js.map +1 -1
- package/dist/native/ssr/server/build-manifest.js.map +1 -1
- package/dist/native/ssr/server/client-state-tree.js +33 -0
- package/dist/native/ssr/server/client-state-tree.js.map +1 -0
- package/dist/native/ssr/server/flight-source-node.js +5 -2
- package/dist/native/ssr/server/flight-source-node.js.map +1 -1
- package/dist/native/ssr/server/flight-source.js +1 -0
- package/dist/native/ssr/server/flight-source.js.map +1 -1
- package/dist/native/ssr/server/pipeline-interception.js +1 -1
- package/dist/native/ssr/server/segment-hash/value-hash.js +162 -0
- package/dist/native/ssr/server/segment-hash/value-hash.js.map +1 -0
- package/dist/native/ssr/server/ssr-wrappers.js.map +1 -1
- package/dist/native/ssr/server/vite-handoff-rsc.js.map +1 -1
- package/dist/native/ssr/shared/payload-root.js.map +1 -1
- package/dist/plugin-context.d.ts +0 -16
- package/dist/plugin-context.d.ts.map +1 -1
- package/dist/plugins/build-manifest.d.ts.map +1 -1
- package/dist/routing/index.js +2 -2
- package/dist/routing/segment-keys.d.ts +8 -21
- package/dist/routing/segment-keys.d.ts.map +1 -1
- package/dist/server/access-gate.d.ts +0 -14
- package/dist/server/access-gate.d.ts.map +1 -1
- package/dist/server/als-registry.d.ts +16 -0
- package/dist/server/als-registry.d.ts.map +1 -1
- package/dist/server/build-manifest.d.ts +1 -10
- package/dist/server/build-manifest.d.ts.map +1 -1
- package/dist/server/chain-url-parts.d.ts +3 -13
- package/dist/server/chain-url-parts.d.ts.map +1 -1
- package/dist/server/client-state-tree.d.ts +31 -0
- package/dist/server/client-state-tree.d.ts.map +1 -0
- package/dist/server/flight-source-node.d.ts +6 -1
- package/dist/server/flight-source-node.d.ts.map +1 -1
- package/dist/server/flight-source.d.ts +27 -0
- package/dist/server/flight-source.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/internal.js +48 -47
- package/dist/server/internal.js.map +1 -1
- package/dist/server/publish-params.d.ts +5 -4
- package/dist/server/publish-params.d.ts.map +1 -1
- package/dist/server/route-element-builder.d.ts +4 -19
- package/dist/server/route-element-builder.d.ts.map +1 -1
- package/dist/server/rsc-entry/helpers.d.ts +7 -13
- package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
- package/dist/server/rsc-entry/render-route.d.ts.map +1 -1
- package/dist/server/rsc-entry/revalidate-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-payload.d.ts +1 -2
- package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-stream.d.ts +11 -2
- package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-renderer.d.ts +0 -2
- package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
- package/dist/server/segment-hash/capture.d.ts +77 -0
- package/dist/server/segment-hash/capture.d.ts.map +1 -0
- package/dist/server/segment-hash/outlet.d.ts +65 -0
- package/dist/server/segment-hash/outlet.d.ts.map +1 -0
- package/dist/server/segment-hash/stream-tap.d.ts +49 -0
- package/dist/server/segment-hash/stream-tap.d.ts.map +1 -0
- package/dist/server/segment-hash/value-hash.d.ts +70 -0
- package/dist/server/segment-hash/value-hash.d.ts.map +1 -0
- package/dist/server/slot-resolver.d.ts +13 -78
- package/dist/server/slot-resolver.d.ts.map +1 -1
- package/dist/server/ssr-wrappers.d.ts +7 -9
- package/dist/server/ssr-wrappers.d.ts.map +1 -1
- package/dist/server/vite-handoff-rsc.d.ts +10 -1
- package/dist/server/vite-handoff-rsc.d.ts.map +1 -1
- package/dist/shared/outlet-decision.d.ts +48 -0
- package/dist/shared/outlet-decision.d.ts.map +1 -0
- package/dist/shared/payload-root.d.ts +5 -8
- package/dist/shared/payload-root.d.ts.map +1 -1
- package/dist/shared/segment-info.d.ts +13 -28
- package/dist/shared/segment-info.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client/browser-entry/action-dispatch.ts +1 -15
- package/src/client/browser-entry/hydrate.ts +3 -3
- package/src/client/browser-entry/router-init.ts +28 -47
- package/src/client/error-boundary.tsx +49 -9
- package/src/client/history.ts +4 -5
- package/src/client/internal.ts +1 -1
- package/src/client/navigation-commit.ts +25 -83
- package/src/client/outlet-content-cache.ts +119 -0
- package/src/client/outlet-scope-context.ts +42 -0
- package/src/client/params-context.ts +11 -12
- package/src/client/router-pipeline.ts +10 -74
- package/src/client/router-types.ts +11 -26
- package/src/client/router.ts +7 -22
- package/src/client/rsc-fetch.ts +5 -30
- package/src/client/segment-cache.ts +19 -264
- package/src/client/segment-outlet.tsx +80 -72
- package/src/client/stale-segment.ts +60 -0
- package/src/client/use-segment-params.ts +1 -1
- package/src/config-types.ts +7 -6
- package/src/index.ts +0 -2
- package/src/plugin-context.ts +0 -16
- package/src/plugins/build-manifest.ts +1 -22
- package/src/routing/scanner.ts +12 -0
- package/src/routing/segment-keys.ts +9 -35
- package/src/rsc-runtime/vendor-types.d.ts +8 -0
- package/src/server/access-gate.tsx +3 -32
- package/src/server/als-registry.ts +23 -0
- package/src/server/build-manifest.ts +1 -11
- package/src/server/chain-url-parts.ts +3 -21
- package/src/server/client-state-tree.ts +75 -0
- package/src/server/flight-source-node.ts +7 -2
- package/src/server/flight-source.ts +102 -9
- package/src/server/pipeline-interception.ts +1 -1
- package/src/server/publish-params.ts +5 -4
- package/src/server/route-element-builder.ts +77 -206
- package/src/server/rsc-entry/helpers.ts +11 -65
- package/src/server/rsc-entry/render-route.ts +54 -28
- package/src/server/rsc-entry/revalidate-renderer.ts +2 -1
- package/src/server/rsc-entry/rsc-payload.ts +11 -39
- package/src/server/rsc-entry/rsc-stream.ts +123 -101
- package/src/server/rsc-entry/ssr-renderer.ts +1 -3
- package/src/server/segment-hash/capture.ts +232 -0
- package/src/server/segment-hash/outlet.ts +185 -0
- package/src/server/segment-hash/stream-tap.ts +244 -0
- package/src/server/segment-hash/value-hash.ts +338 -0
- package/src/server/slot-resolver.ts +37 -323
- package/src/server/ssr-wrappers.tsx +7 -9
- package/src/server/vite-handoff-rsc.ts +12 -1
- package/src/shared/outlet-decision.ts +54 -0
- package/src/shared/payload-root.ts +5 -8
- package/src/shared/segment-info.ts +13 -28
- package/dist/_chunks/chains-CmzbpG-6.js +0 -1
- package/dist/_chunks/dev-server--4_Ogy_6.js +0 -1
- package/dist/_chunks/dev-span-RsVeYYc_.js.map +0 -1
- package/dist/_chunks/error-boundary-Bh-egWUI.js.map +0 -1
- package/dist/_chunks/flight-source-node-BsrlUjMO.js.map +0 -1
- package/dist/client/segment-update-context.d.ts +0 -15
- package/dist/client/segment-update-context.d.ts.map +0 -1
- package/dist/client/slot-content-cache-context.d.ts +0 -35
- package/dist/client/slot-content-cache-context.d.ts.map +0 -1
- package/dist/native/rsc/server/request-dep.js +0 -12
- package/dist/native/rsc/server/request-dep.js.map +0 -1
- package/dist/native/rsc/server/route-element-helpers.js +0 -20
- package/dist/native/rsc/server/route-element-helpers.js.map +0 -1
- package/dist/native/rsc/server/skippable-prefix.js +0 -72
- package/dist/native/rsc/server/skippable-prefix.js.map +0 -1
- package/dist/native/rsc/server/state-tree-diff.js +0 -35
- package/dist/native/rsc/server/state-tree-diff.js.map +0 -1
- package/dist/native/ssr/client/segment-cache.js +0 -119
- package/dist/native/ssr/client/segment-cache.js.map +0 -1
- package/dist/native/ssr/client/segment-update-context.js +0 -9
- package/dist/native/ssr/client/segment-update-context.js.map +0 -1
- package/dist/native/ssr/client/slot-content-cache-context.js +0 -8
- package/dist/native/ssr/client/slot-content-cache-context.js.map +0 -1
- package/dist/native/ssr/server/state-tree-diff.js +0 -23
- package/dist/native/ssr/server/state-tree-diff.js.map +0 -1
- package/dist/plugins/request-dep/analysis.d.ts +0 -106
- package/dist/plugins/request-dep/analysis.d.ts.map +0 -1
- package/dist/plugins/request-dep/index.d.ts +0 -75
- package/dist/plugins/request-dep/index.d.ts.map +0 -1
- package/dist/plugins/request-dep/origin.d.ts +0 -61
- package/dist/plugins/request-dep/origin.d.ts.map +0 -1
- package/dist/server/request-dep.d.ts +0 -15
- package/dist/server/request-dep.d.ts.map +0 -1
- package/dist/server/route-element-helpers.d.ts +0 -12
- package/dist/server/route-element-helpers.d.ts.map +0 -1
- package/dist/server/skippable-prefix.d.ts +0 -29
- package/dist/server/skippable-prefix.d.ts.map +0 -1
- package/dist/server/state-tree-diff.d.ts +0 -78
- package/dist/server/state-tree-diff.d.ts.map +0 -1
- package/src/client/segment-update-context.ts +0 -23
- package/src/client/slot-content-cache-context.ts +0 -43
- package/src/plugins/request-dep/analysis.ts +0 -447
- package/src/plugins/request-dep/index.ts +0 -376
- package/src/plugins/request-dep/origin.ts +0 -310
- package/src/server/request-dep.ts +0 -37
- package/src/server/route-element-helpers.ts +0 -37
- package/src/server/skippable-prefix.ts +0 -172
- package/src/server/state-tree-diff.ts +0 -132
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { a as generateManifestModule, c as formatMissingPeers, i as VIRTUAL_IDS, l as reportConfigErrors, n as timberDevServer, o as generateSchemaModule, s as checkPeerDependencies, u as validateConfig } from "./_chunks/dev-server-
|
|
1
|
+
import { a as generateManifestModule, c as formatMissingPeers, i as VIRTUAL_IDS, l as reportConfigErrors, n as timberDevServer, o as generateSchemaModule, s as checkPeerDependencies, u as validateConfig } from "./_chunks/dev-server-C5R6jx8Q.js";
|
|
2
2
|
import { i as resolveRenderTimeoutMs } from "./_chunks/render-timeout-MrrqD1wd.js";
|
|
3
|
-
import { l as getPrerenderExport, n as scanRoutes } from "./_chunks/scanner-
|
|
4
|
-
import { c as buildDirToRouteMap, n as formatConventionWarnings, o as flushCodegenWrites, r as lintConventions, s as writeRouteCodegen, t as checkAppDirExists } from "./_chunks/convention-lint-
|
|
5
|
-
import { r as validateSchemaAgainstRoutes, t as collectLeafRoutes } from "./_chunks/walkers-
|
|
3
|
+
import { l as getPrerenderExport, n as scanRoutes } from "./_chunks/scanner-C9Lrf77z.js";
|
|
4
|
+
import { c as buildDirToRouteMap, n as formatConventionWarnings, o as flushCodegenWrites, r as lintConventions, s as writeRouteCodegen, t as checkAppDirExists } from "./_chunks/convention-lint-BoVISNS6.js";
|
|
5
|
+
import { r as validateSchemaAgainstRoutes, t as collectLeafRoutes } from "./_chunks/walkers-Bxv4v7tX.js";
|
|
6
6
|
import { i as poisonPillSource, r as markerFor, t as EXPLICIT_MARKERS } from "./_chunks/poison-rules-Bmz-lCPi.js";
|
|
7
7
|
import { t as writeFileAtomic } from "./_chunks/write-file-atomic-DW8m_Atv.js";
|
|
8
8
|
import { i as withBasePath, n as normalizeBasePath, t as isRelativeBase } from "./_chunks/base-path-DDIx0FXe.js";
|
|
9
9
|
import { n as rscPayloadPath, t as RSC_PAYLOAD_DIR } from "./_chunks/rsc-payload-path-EphpDB-J.js";
|
|
10
10
|
import { a as REDIRECTS_FILE, n as detectFsIdentity, o as RESERVED_OUTPUT_PATHS, r as fsKey, t as EXACT_FS_IDENTITY } from "./_chunks/fs-identity-BmQ_Agg-.js";
|
|
11
|
-
import { a as EMPTY_BUILD_MANIFEST, n as DEV_SPAN_REPLAY_EVENT, r as DEV_SPAN_SINK_KEY, t as DEV_SPAN_EVENT } from "./_chunks/dev-span-
|
|
11
|
+
import { a as EMPTY_BUILD_MANIFEST, n as DEV_SPAN_REPLAY_EVENT, r as DEV_SPAN_SINK_KEY, t as DEV_SPAN_EVENT } from "./_chunks/dev-span-0aG7Q_Ph.js";
|
|
12
12
|
import { t as fnv1aHash } from "./_chunks/fast-hash-DddxkU5Y.js";
|
|
13
|
-
import { i as detectDirective } from "./_chunks/classify-
|
|
13
|
+
import { i as detectDirective } from "./_chunks/classify-Cj9EeZoL.js";
|
|
14
14
|
import { a as contextAdapter, c as loadTimberConfigFile, d as resolveBuildDir, f as resolveClientJavascript, l as mergeFileConfig, m as createNoopTimer, o as createPluginContext, r as adapterConfig, u as resolveAppDir } from "./_chunks/plugin-context-BtaQcMuh.js";
|
|
15
|
-
import { b as swallow } from "./_chunks/logger-
|
|
15
|
+
import { b as swallow } from "./_chunks/logger-DmRR9tmZ.js";
|
|
16
16
|
import { t as formatSize } from "./_chunks/format-DuPOoXUP.js";
|
|
17
17
|
import { createLogger, esmExternalRequirePlugin, isRunnableDevEnvironment, parseAst } from "vite";
|
|
18
18
|
import { basename, dirname, extname, isAbsolute, join, normalize, relative, resolve, sep, win32 } from "node:path";
|
|
@@ -5422,7 +5422,7 @@ function timberBuildManifest(ctx) {
|
|
|
5422
5422
|
"// Auto-generated build manifest — do not edit.",
|
|
5423
5423
|
"// Production: reads manifest from globalThis (set by _timber-manifest-init.js).",
|
|
5424
5424
|
"// The object below is only the fallback for when that global is unset —",
|
|
5425
|
-
"// the real manifest
|
|
5425
|
+
"// the real manifest is in that init module.",
|
|
5426
5426
|
"",
|
|
5427
5427
|
`const manifest = globalThis.__TIMBER_BUILD_MANIFEST__ ?? ${empty};`,
|
|
5428
5428
|
"",
|
|
@@ -5449,8 +5449,6 @@ function timberBuildManifest(ctx) {
|
|
|
5449
5449
|
if (envName === "client") {
|
|
5450
5450
|
ctx.buildManifest = buildManifestFromBundle(bundle, ctx.base, ctx.root);
|
|
5451
5451
|
if (ctx.routeTree) ctx.buildManifest.metadataRouteHashes = computeMetadataRouteHashes(ctx.routeTree.root);
|
|
5452
|
-
if (ctx.requestDepMap === void 0) throw new Error("[timber] Build manifest: the request-dependency map was never computed. The RSC environment's buildEnd hook did not run before the client build, so no segment or slot could be skipped on client navigation. This is a plugin pipeline bug — timber-request-dep must run in the rsc environment.");
|
|
5453
|
-
ctx.buildManifest.requestDep = ctx.requestDepMap;
|
|
5454
5452
|
if (ctx.clientJavascript.disabled) {
|
|
5455
5453
|
for (const [fileName, item] of Object.entries(bundle)) if (item.type === "chunk") delete bundle[fileName];
|
|
5456
5454
|
}
|
|
@@ -6775,726 +6773,6 @@ function timberCacheTransform(ctx) {
|
|
|
6775
6773
|
}
|
|
6776
6774
|
};
|
|
6777
6775
|
}
|
|
6778
|
-
// src/plugins/request-dep/analysis.ts
|
|
6779
|
-
/** `export default` has no local name of its own; this stands in for one. */
|
|
6780
|
-
var DEFAULT_EXPORT = "default";
|
|
6781
|
-
function createModuleFacts() {
|
|
6782
|
-
return {
|
|
6783
|
-
importedBindings: /* @__PURE__ */ new Map(),
|
|
6784
|
-
reExports: /* @__PURE__ */ new Map(),
|
|
6785
|
-
starReExports: [],
|
|
6786
|
-
localExports: /* @__PURE__ */ new Map(),
|
|
6787
|
-
factoryCalls: /* @__PURE__ */ new Map(),
|
|
6788
|
-
calledLocals: /* @__PURE__ */ new Set(),
|
|
6789
|
-
calledMembers: /* @__PURE__ */ new Map(),
|
|
6790
|
-
getterLocals: /* @__PURE__ */ new Set(),
|
|
6791
|
-
getterMembers: /* @__PURE__ */ new Map(),
|
|
6792
|
-
referencedLocals: /* @__PURE__ */ new Set(),
|
|
6793
|
-
resolvedSources: /* @__PURE__ */ new Map(),
|
|
6794
|
-
unresolvedSources: /* @__PURE__ */ new Set()
|
|
6795
|
-
};
|
|
6796
|
-
}
|
|
6797
|
-
/**
|
|
6798
|
-
* Specifiers the origin walk can actually reach, so the plugin resolves those
|
|
6799
|
-
* and not every import in the file.
|
|
6800
|
-
*
|
|
6801
|
-
* A re-export edge is always reachable — a downstream module can ask for any
|
|
6802
|
-
* name it forwards. An `import` edge is reachable through any local name the
|
|
6803
|
-
* module body mentions, or that it re-exports.
|
|
6804
|
-
*
|
|
6805
|
-
* The name set must be **the same one the taint rules consult**. Deriving it
|
|
6806
|
-
* from the call shapes instead (called, `.get()`d, member-called, minted from)
|
|
6807
|
-
* left `read(filters)` — a definition passed as an argument — with its
|
|
6808
|
-
* specifier unresolved, so the origin walk reported it inert and the page read
|
|
6809
|
-
* as request-independent. Two hand-maintained lists of "names that matter" is
|
|
6810
|
-
* one list too many; this is the one, and `referencedLocals` is a superset of
|
|
6811
|
-
* every call shape by construction, since each of them is an identifier the
|
|
6812
|
-
* walk visits. (Codex review round 1 on PR #991.)
|
|
6813
|
-
*/
|
|
6814
|
-
function usedSources(facts) {
|
|
6815
|
-
const sources = new Set(facts.starReExports);
|
|
6816
|
-
for (const edge of facts.reExports.values()) sources.add(edge.source);
|
|
6817
|
-
for (const local of facts.referencedLocals) {
|
|
6818
|
-
const edge = facts.importedBindings.get(local);
|
|
6819
|
-
if (edge) sources.add(edge.source);
|
|
6820
|
-
}
|
|
6821
|
-
for (const local of facts.localExports.values()) {
|
|
6822
|
-
const edge = facts.importedBindings.get(local);
|
|
6823
|
-
if (edge) sources.add(edge.source);
|
|
6824
|
-
}
|
|
6825
|
-
return sources;
|
|
6826
|
-
}
|
|
6827
|
-
/**
|
|
6828
|
-
* True when the module cannot affect any answer, so its facts need not be kept.
|
|
6829
|
-
*
|
|
6830
|
-
* Every judgement bottoms out at a module edge: a call site resolves through
|
|
6831
|
-
* `importedBindings`, a chain link through `reExports` / `starReExports`. A
|
|
6832
|
-
* module with none of those can only ever resolve to `none` — its exports lead
|
|
6833
|
-
* to locals that lead nowhere — which is exactly what a *missing* entry
|
|
6834
|
-
* produces. Dropping it is behaviour-preserving and keeps the dev-time map from
|
|
6835
|
-
* holding an entry for every leaf module in the graph.
|
|
6836
|
-
*/
|
|
6837
|
-
function contributesNothing(facts) {
|
|
6838
|
-
return facts.importedBindings.size === 0 && facts.reExports.size === 0 && facts.starReExports.length === 0;
|
|
6839
|
-
}
|
|
6840
|
-
function addToMapSet(map, key, value) {
|
|
6841
|
-
const existing = map.get(key);
|
|
6842
|
-
if (existing) existing.add(value);
|
|
6843
|
-
else map.set(key, /* @__PURE__ */ new Set([value]));
|
|
6844
|
-
}
|
|
6845
|
-
function nameOf$1(node) {
|
|
6846
|
-
if (!node) return null;
|
|
6847
|
-
if (node.type === "Identifier") return node.name;
|
|
6848
|
-
if (node.type === "Literal" && typeof node.value === "string") return node.value;
|
|
6849
|
-
return null;
|
|
6850
|
-
}
|
|
6851
|
-
/**
|
|
6852
|
-
* `import type { … }` needs no handling here. Vite's TypeScript transform is a
|
|
6853
|
-
* core plugin and runs before this one, so types are already erased by the time
|
|
6854
|
-
* the analysis parses — and the parser it runs on is JavaScript-only, so
|
|
6855
|
-
* unerased TypeScript would throw rather than be silently misread.
|
|
6856
|
-
* `tests/request-dep-plugin.test.ts` pins the resulting property through the
|
|
6857
|
-
* real pipeline: a type-only accessor import is not request-dependent.
|
|
6858
|
-
*/
|
|
6859
|
-
function collectImportDeclaration(stmt, facts) {
|
|
6860
|
-
const source = stmt.source?.value;
|
|
6861
|
-
if (typeof source !== "string") return;
|
|
6862
|
-
for (const spec of stmt.specifiers ?? []) {
|
|
6863
|
-
const local = nameOf$1(spec.local);
|
|
6864
|
-
if (!local) continue;
|
|
6865
|
-
if (spec.type === "ImportNamespaceSpecifier") facts.importedBindings.set(local, {
|
|
6866
|
-
source,
|
|
6867
|
-
imported: "*"
|
|
6868
|
-
});
|
|
6869
|
-
else if (spec.type === "ImportDefaultSpecifier") facts.importedBindings.set(local, {
|
|
6870
|
-
source,
|
|
6871
|
-
imported: DEFAULT_EXPORT
|
|
6872
|
-
});
|
|
6873
|
-
else if (spec.type === "ImportSpecifier") facts.importedBindings.set(local, {
|
|
6874
|
-
source,
|
|
6875
|
-
imported: nameOf$1(spec.imported) ?? local
|
|
6876
|
-
});
|
|
6877
|
-
}
|
|
6878
|
-
}
|
|
6879
|
-
function collectDeclaredNames(decl, out) {
|
|
6880
|
-
if (decl.type === "VariableDeclaration") for (const d of decl.declarations ?? []) {
|
|
6881
|
-
const id = d.id;
|
|
6882
|
-
if (id?.type === "Identifier") out.add(id.name);
|
|
6883
|
-
}
|
|
6884
|
-
else if (decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration") {
|
|
6885
|
-
const id = decl.id;
|
|
6886
|
-
if (id?.type === "Identifier") out.add(id.name);
|
|
6887
|
-
}
|
|
6888
|
-
}
|
|
6889
|
-
function collectExportNamed(stmt, facts) {
|
|
6890
|
-
const source = stmt.source?.value;
|
|
6891
|
-
const specifiers = stmt.specifiers ?? [];
|
|
6892
|
-
if (typeof source === "string") {
|
|
6893
|
-
for (const spec of specifiers) {
|
|
6894
|
-
const imported = nameOf$1(spec.imported) ?? nameOf$1(spec.local);
|
|
6895
|
-
const exported = nameOf$1(spec.exported);
|
|
6896
|
-
if (imported && exported) facts.reExports.set(exported, {
|
|
6897
|
-
source,
|
|
6898
|
-
imported
|
|
6899
|
-
});
|
|
6900
|
-
}
|
|
6901
|
-
return;
|
|
6902
|
-
}
|
|
6903
|
-
for (const spec of specifiers) {
|
|
6904
|
-
const local = nameOf$1(spec.local);
|
|
6905
|
-
const exported = nameOf$1(spec.exported);
|
|
6906
|
-
if (local && exported) facts.localExports.set(exported, local);
|
|
6907
|
-
}
|
|
6908
|
-
const declaration = stmt.declaration;
|
|
6909
|
-
if (declaration) {
|
|
6910
|
-
const names = /* @__PURE__ */ new Set();
|
|
6911
|
-
collectDeclaredNames(declaration, names);
|
|
6912
|
-
for (const name of names) facts.localExports.set(name, name);
|
|
6913
|
-
}
|
|
6914
|
-
}
|
|
6915
|
-
function collectExportAll(stmt, facts) {
|
|
6916
|
-
const source = stmt.source?.value;
|
|
6917
|
-
if (typeof source !== "string") return;
|
|
6918
|
-
const exported = nameOf$1(stmt.exported);
|
|
6919
|
-
if (exported) facts.reExports.set(exported, {
|
|
6920
|
-
source,
|
|
6921
|
-
imported: "*"
|
|
6922
|
-
});
|
|
6923
|
-
else facts.starReExports.push(source);
|
|
6924
|
-
}
|
|
6925
|
-
function collectExportDefault(stmt, facts) {
|
|
6926
|
-
const declaration = stmt.declaration;
|
|
6927
|
-
if (!declaration) return;
|
|
6928
|
-
facts.localExports.set(DEFAULT_EXPORT, DEFAULT_EXPORT);
|
|
6929
|
-
if (declaration.type === "Identifier") facts.localExports.set(DEFAULT_EXPORT, declaration.name);
|
|
6930
|
-
else if (declaration.type === "CallExpression") {
|
|
6931
|
-
const ref = calleeRef(declaration);
|
|
6932
|
-
if (ref) facts.factoryCalls.set(DEFAULT_EXPORT, ref);
|
|
6933
|
-
}
|
|
6934
|
-
}
|
|
6935
|
-
function calleeRef(call) {
|
|
6936
|
-
const callee = call.callee;
|
|
6937
|
-
if (callee.type === "Identifier") return {
|
|
6938
|
-
kind: "local",
|
|
6939
|
-
name: callee.name
|
|
6940
|
-
};
|
|
6941
|
-
if (callee.type === "MemberExpression") {
|
|
6942
|
-
const member = callee;
|
|
6943
|
-
if (!member.computed && member.object.type === "Identifier" && member.property.type === "Identifier") return {
|
|
6944
|
-
kind: "member",
|
|
6945
|
-
object: member.object.name,
|
|
6946
|
-
property: member.property.name
|
|
6947
|
-
};
|
|
6948
|
-
}
|
|
6949
|
-
return null;
|
|
6950
|
-
}
|
|
6951
|
-
/**
|
|
6952
|
-
* Walk down a `.get()` receiver to the identifier it is ultimately rooted in,
|
|
6953
|
-
* along with the first property accessed on that identifier.
|
|
6954
|
-
*
|
|
6955
|
-
* `x.get()` → `x`, no property. `x(a).get()` → `x`. `ns.defs.get()` → `ns`
|
|
6956
|
-
* plus `defs`, which is both the namespace-member shape and the
|
|
6957
|
-
* `cookies.theme.get()` shape — the resolver tries the base binding and the
|
|
6958
|
-
* member, so one walk covers both.
|
|
6959
|
-
*/
|
|
6960
|
-
function chainRoot(node) {
|
|
6961
|
-
let current = node;
|
|
6962
|
-
let property = null;
|
|
6963
|
-
for (;;) {
|
|
6964
|
-
if (current.type === "Identifier") return {
|
|
6965
|
-
base: current.name,
|
|
6966
|
-
property
|
|
6967
|
-
};
|
|
6968
|
-
if (current.type === "MemberExpression") {
|
|
6969
|
-
const member = current;
|
|
6970
|
-
if (!member.computed && member.property.type === "Identifier") property = member.property.name;
|
|
6971
|
-
else property = null;
|
|
6972
|
-
current = member.object;
|
|
6973
|
-
continue;
|
|
6974
|
-
}
|
|
6975
|
-
if (current.type === "CallExpression") {
|
|
6976
|
-
property = null;
|
|
6977
|
-
current = current.callee;
|
|
6978
|
-
continue;
|
|
6979
|
-
}
|
|
6980
|
-
return null;
|
|
6981
|
-
}
|
|
6982
|
-
}
|
|
6983
|
-
function collectExpression(node, facts) {
|
|
6984
|
-
if (node.type === "VariableDeclarator") {
|
|
6985
|
-
const id = node.id;
|
|
6986
|
-
const init = node.init;
|
|
6987
|
-
if (id?.type === "Identifier" && init?.type === "CallExpression") {
|
|
6988
|
-
const ref = calleeRef(init);
|
|
6989
|
-
if (ref) facts.factoryCalls.set(id.name, ref);
|
|
6990
|
-
}
|
|
6991
|
-
return;
|
|
6992
|
-
}
|
|
6993
|
-
if (node.type !== "CallExpression") return;
|
|
6994
|
-
const callee = node.callee;
|
|
6995
|
-
if (callee.type === "Identifier") {
|
|
6996
|
-
facts.calledLocals.add(callee.name);
|
|
6997
|
-
return;
|
|
6998
|
-
}
|
|
6999
|
-
if (callee.type !== "MemberExpression") return;
|
|
7000
|
-
const member = callee;
|
|
7001
|
-
if (member.computed || member.property.type !== "Identifier") return;
|
|
7002
|
-
const propertyName = member.property.name;
|
|
7003
|
-
if (propertyName === "get") {
|
|
7004
|
-
const root = chainRoot(member.object);
|
|
7005
|
-
if (root) {
|
|
7006
|
-
facts.getterLocals.add(root.base);
|
|
7007
|
-
if (root.property) addToMapSet(facts.getterMembers, root.base, root.property);
|
|
7008
|
-
}
|
|
7009
|
-
return;
|
|
7010
|
-
}
|
|
7011
|
-
if (member.object.type === "Identifier") addToMapSet(facts.calledMembers, member.object.name, propertyName);
|
|
7012
|
-
}
|
|
7013
|
-
/**
|
|
7014
|
-
* Statements whose whole subtree is an import/export *clause* rather than code.
|
|
7015
|
-
*
|
|
7016
|
-
* The walk skips them so `referencedLocals` means "the module body mentions
|
|
7017
|
-
* this name". Without the skip every imported name would count as referenced,
|
|
7018
|
-
* and a pure barrel — which mentions its names only in the clauses — would be
|
|
7019
|
-
* indistinguishable from a module that uses them.
|
|
7020
|
-
*/
|
|
7021
|
-
function isClauseOnly(node) {
|
|
7022
|
-
if (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration") return true;
|
|
7023
|
-
if (node.type === "ExportNamedDeclaration") return !node.declaration;
|
|
7024
|
-
if (node.type === "ExportDefaultDeclaration") return node.declaration?.type === "Identifier";
|
|
7025
|
-
return false;
|
|
7026
|
-
}
|
|
7027
|
-
/**
|
|
7028
|
-
* Keys holding *binding* positions rather than references: the name being
|
|
7029
|
-
* declared, not a mention of one.
|
|
7030
|
-
*
|
|
7031
|
-
* `referencedLocals` must exclude these or `export const filters =
|
|
7032
|
-
* defineSearchParams({})` would count as referencing `filters`, and possession
|
|
7033
|
-
* would then taint every definition module — and through it every page that
|
|
7034
|
-
* imports one, whether or not it reads the request. Skipping only these keys
|
|
7035
|
-
* keeps a shadowing parameter's *body* uses as references, which over-reports
|
|
7036
|
-
* in the safe direction.
|
|
7037
|
-
*/
|
|
7038
|
-
var BINDING_KEYS = {
|
|
7039
|
-
VariableDeclarator: ["id"],
|
|
7040
|
-
FunctionDeclaration: ["id", "params"],
|
|
7041
|
-
FunctionExpression: ["id", "params"],
|
|
7042
|
-
ArrowFunctionExpression: ["params"],
|
|
7043
|
-
ClassDeclaration: ["id"],
|
|
7044
|
-
ClassExpression: ["id"],
|
|
7045
|
-
CatchClause: ["param"]
|
|
7046
|
-
};
|
|
7047
|
-
function walk(node, facts) {
|
|
7048
|
-
if (isClauseOnly(node)) return;
|
|
7049
|
-
if (node.type === "Identifier") facts.referencedLocals.add(node.name);
|
|
7050
|
-
collectExpression(node, facts);
|
|
7051
|
-
const bindingKeys = BINDING_KEYS[node.type];
|
|
7052
|
-
for (const key of Object.keys(node)) {
|
|
7053
|
-
if (key === "type" || key === "start" || key === "end") continue;
|
|
7054
|
-
if (bindingKeys?.includes(key)) continue;
|
|
7055
|
-
const value = node[key];
|
|
7056
|
-
if (!value || typeof value !== "object") continue;
|
|
7057
|
-
if (Array.isArray(value)) {
|
|
7058
|
-
for (const item of value) if (item && typeof item === "object" && typeof item.type === "string") walk(item, facts);
|
|
7059
|
-
} else if (typeof value.type === "string") walk(value, facts);
|
|
7060
|
-
}
|
|
7061
|
-
}
|
|
7062
|
-
/**
|
|
7063
|
-
* Record every binding, module edge, and call shape in one module.
|
|
7064
|
-
*
|
|
7065
|
-
* Names are recorded without scope analysis, so a parameter that shadows an
|
|
7066
|
-
* imported name is credited to the import. That direction is deliberate: a
|
|
7067
|
-
* needlessly request-dependent segment costs a re-render, a wrongly static one
|
|
7068
|
-
* serves stale content.
|
|
7069
|
-
*/
|
|
7070
|
-
function analyzeModule(program) {
|
|
7071
|
-
const facts = createModuleFacts();
|
|
7072
|
-
for (const stmt of program.body) switch (stmt.type) {
|
|
7073
|
-
case "ImportDeclaration":
|
|
7074
|
-
collectImportDeclaration(stmt, facts);
|
|
7075
|
-
break;
|
|
7076
|
-
case "ExportNamedDeclaration":
|
|
7077
|
-
collectExportNamed(stmt, facts);
|
|
7078
|
-
break;
|
|
7079
|
-
case "ExportAllDeclaration":
|
|
7080
|
-
collectExportAll(stmt, facts);
|
|
7081
|
-
break;
|
|
7082
|
-
case "ExportDefaultDeclaration": collectExportDefault(stmt, facts);
|
|
7083
|
-
}
|
|
7084
|
-
walk(program, facts);
|
|
7085
|
-
return facts;
|
|
7086
|
-
}
|
|
7087
|
-
// src/plugins/request-dep/origin.ts
|
|
7088
|
-
var ACCESSOR_SOURCES = /* @__PURE__ */ new Set([
|
|
7089
|
-
"@timber-js/app/server",
|
|
7090
|
-
"next/headers",
|
|
7091
|
-
"next/headers.js"
|
|
7092
|
-
]);
|
|
7093
|
-
var ACCESSOR_NAMES = /* @__PURE__ */ new Set([
|
|
7094
|
-
"getHeaders",
|
|
7095
|
-
"getHeader",
|
|
7096
|
-
"getSearchParams",
|
|
7097
|
-
"getCookieJar",
|
|
7098
|
-
"getCookie",
|
|
7099
|
-
"headers",
|
|
7100
|
-
"cookies"
|
|
7101
|
-
]);
|
|
7102
|
-
var DEFINITION_FACTORY_SOURCES = /* @__PURE__ */ new Set(["@timber-js/app/search-params", "@timber-js/app/cookies"]);
|
|
7103
|
-
var DEFINITION_FACTORY_NAMES = /* @__PURE__ */ new Set(["defineSearchParams", "defineCookie"]);
|
|
7104
|
-
/** Every specifier the classifier recognises without resolving it. */
|
|
7105
|
-
var FRAMEWORK_SOURCES = /* @__PURE__ */ new Set([...ACCESSOR_SOURCES, ...DEFINITION_FACTORY_SOURCES]);
|
|
7106
|
-
var NONE = { kind: "none" };
|
|
7107
|
-
var UNKNOWN = { kind: "unknown" };
|
|
7108
|
-
/**
|
|
7109
|
-
* Classify an edge that points at a framework module, without resolving it.
|
|
7110
|
-
*
|
|
7111
|
-
* Returns `null` when the specifier is not a framework source, which is the
|
|
7112
|
-
* signal to keep walking. Both name sets are consulted for either source so a
|
|
7113
|
-
* specifier that grows a second role does not silently stop matching.
|
|
7114
|
-
*/
|
|
7115
|
-
function classifySpecifier(source, imported) {
|
|
7116
|
-
const isAccessorSource = ACCESSOR_SOURCES.has(source);
|
|
7117
|
-
const isFactorySource = DEFINITION_FACTORY_SOURCES.has(source);
|
|
7118
|
-
if (!isAccessorSource && !isFactorySource) return null;
|
|
7119
|
-
if (imported === "*") return {
|
|
7120
|
-
kind: "framework-namespace",
|
|
7121
|
-
source
|
|
7122
|
-
};
|
|
7123
|
-
if (isAccessorSource && ACCESSOR_NAMES.has(imported)) return { kind: "accessor" };
|
|
7124
|
-
if (isFactorySource && DEFINITION_FACTORY_NAMES.has(imported)) return { kind: "factory" };
|
|
7125
|
-
return NONE;
|
|
7126
|
-
}
|
|
7127
|
-
/** An origin whose *call* reads the request. */
|
|
7128
|
-
function callReadsRequest(origin) {
|
|
7129
|
-
return origin.kind === "accessor" || origin.kind === "unknown";
|
|
7130
|
-
}
|
|
7131
|
-
/** An origin whose `.get()` reads the request. */
|
|
7132
|
-
function getterReadsRequest(origin) {
|
|
7133
|
-
return origin.kind === "definition" || origin.kind === "unknown";
|
|
7134
|
-
}
|
|
7135
|
-
function createOriginResolver(factsMap) {
|
|
7136
|
-
/**
|
|
7137
|
-
* Cycle guard. A `(module, export)` pair already being resolved contributes
|
|
7138
|
-
* `none`: anything it could reach is reachable on the path still unwinding.
|
|
7139
|
-
*/
|
|
7140
|
-
const resolving = /* @__PURE__ */ new Map();
|
|
7141
|
-
function enter(moduleId, name) {
|
|
7142
|
-
const names = resolving.get(moduleId);
|
|
7143
|
-
if (!names) {
|
|
7144
|
-
resolving.set(moduleId, /* @__PURE__ */ new Set([name]));
|
|
7145
|
-
return true;
|
|
7146
|
-
}
|
|
7147
|
-
if (names.has(name)) return false;
|
|
7148
|
-
names.add(name);
|
|
7149
|
-
return true;
|
|
7150
|
-
}
|
|
7151
|
-
function leave(moduleId, name) {
|
|
7152
|
-
resolving.get(moduleId)?.delete(name);
|
|
7153
|
-
}
|
|
7154
|
-
/** Follow one `import`/`export … from` edge out of `moduleId`. */
|
|
7155
|
-
function resolveEdge(moduleId, edge) {
|
|
7156
|
-
const classified = classifySpecifier(edge.source, edge.imported);
|
|
7157
|
-
if (classified) return classified;
|
|
7158
|
-
const facts = factsMap.get(moduleId);
|
|
7159
|
-
const targetId = facts?.resolvedSources.get(edge.source);
|
|
7160
|
-
if (!targetId) return facts?.unresolvedSources.has(edge.source) ? UNKNOWN : NONE;
|
|
7161
|
-
if (edge.imported === "*") return {
|
|
7162
|
-
kind: "namespace",
|
|
7163
|
-
moduleId: targetId
|
|
7164
|
-
};
|
|
7165
|
-
return resolveExport(targetId, edge.imported);
|
|
7166
|
-
}
|
|
7167
|
-
/** What does `moduleId` export under `name`? */
|
|
7168
|
-
function resolveExport(moduleId, name) {
|
|
7169
|
-
const facts = factsMap.get(moduleId);
|
|
7170
|
-
if (!facts) return NONE;
|
|
7171
|
-
if (!enter(moduleId, `export:${name}`)) return NONE;
|
|
7172
|
-
try {
|
|
7173
|
-
const reExport = facts.reExports.get(name);
|
|
7174
|
-
if (reExport) return resolveEdge(moduleId, reExport);
|
|
7175
|
-
const local = facts.localExports.get(name);
|
|
7176
|
-
if (local !== void 0) return resolveLocal(moduleId, local);
|
|
7177
|
-
for (const source of facts.starReExports) {
|
|
7178
|
-
const viaStar = resolveEdge(moduleId, {
|
|
7179
|
-
source,
|
|
7180
|
-
imported: name
|
|
7181
|
-
});
|
|
7182
|
-
if (viaStar.kind !== "none") return viaStar;
|
|
7183
|
-
}
|
|
7184
|
-
return NONE;
|
|
7185
|
-
} finally {
|
|
7186
|
-
leave(moduleId, `export:${name}`);
|
|
7187
|
-
}
|
|
7188
|
-
}
|
|
7189
|
-
/** What is the local binding `name` in `moduleId`? */
|
|
7190
|
-
function resolveLocal(moduleId, name) {
|
|
7191
|
-
const facts = factsMap.get(moduleId);
|
|
7192
|
-
if (!facts) return NONE;
|
|
7193
|
-
if (!enter(moduleId, `local:${name}`)) return NONE;
|
|
7194
|
-
try {
|
|
7195
|
-
const imported = facts.importedBindings.get(name);
|
|
7196
|
-
if (imported) return resolveEdge(moduleId, imported);
|
|
7197
|
-
const factoryCall = facts.factoryCalls.get(name);
|
|
7198
|
-
if (factoryCall) {
|
|
7199
|
-
const callee = resolveCallee(moduleId, factoryCall);
|
|
7200
|
-
if (callee.kind === "factory") return { kind: "definition" };
|
|
7201
|
-
if (callee.kind === "unknown") return UNKNOWN;
|
|
7202
|
-
}
|
|
7203
|
-
return NONE;
|
|
7204
|
-
} finally {
|
|
7205
|
-
leave(moduleId, `local:${name}`);
|
|
7206
|
-
}
|
|
7207
|
-
}
|
|
7208
|
-
function resolveCallee(moduleId, ref) {
|
|
7209
|
-
if (ref.kind === "local") return resolveLocal(moduleId, ref.name);
|
|
7210
|
-
return resolveMember(moduleId, ref.object, ref.property);
|
|
7211
|
-
}
|
|
7212
|
-
/** `ns.name` where `ns` is a local binding in `moduleId`. */
|
|
7213
|
-
function resolveMember(moduleId, object, name) {
|
|
7214
|
-
const base = resolveLocal(moduleId, object);
|
|
7215
|
-
if (base.kind === "framework-namespace") return classifySpecifier(base.source, name) ?? NONE;
|
|
7216
|
-
if (base.kind === "namespace") return resolveExport(base.moduleId, name);
|
|
7217
|
-
if (base.kind === "unknown") return UNKNOWN;
|
|
7218
|
-
return NONE;
|
|
7219
|
-
}
|
|
7220
|
-
const taintCache = /* @__PURE__ */ new Map();
|
|
7221
|
-
function computeTainted(moduleId, facts) {
|
|
7222
|
-
for (const local of facts.calledLocals) if (callReadsRequest(resolveLocal(moduleId, local))) return true;
|
|
7223
|
-
for (const [object, members] of facts.calledMembers) for (const member of members) if (callReadsRequest(resolveMember(moduleId, object, member))) return true;
|
|
7224
|
-
for (const local of facts.getterLocals) if (getterReadsRequest(resolveLocal(moduleId, local))) return true;
|
|
7225
|
-
for (const [object, members] of facts.getterMembers) for (const member of members) if (getterReadsRequest(resolveMember(moduleId, object, member))) return true;
|
|
7226
|
-
return holdsRequestBinding(moduleId, facts);
|
|
7227
|
-
}
|
|
7228
|
-
/**
|
|
7229
|
-
* Possession, not use: a module that binds a request accessor or a definition
|
|
7230
|
-
* value under a local name is request-dependent whether or not the call is
|
|
7231
|
-
* one this analysis can see.
|
|
7232
|
-
*
|
|
7233
|
-
* The call-shape rules above only find a read that happens through the
|
|
7234
|
-
* binding itself. A value can leave the binding first — `const read = flag ?
|
|
7235
|
-
* getSearchParams : noop`, `const { get } = filters`, a prop handed to a
|
|
7236
|
-
* helper — and every one of those is a fresh way to be missed, which is the
|
|
7237
|
-
* shape of bug this ticket exists to stop enumerating. Nothing distinguishes
|
|
7238
|
-
* those from an honest unused import except intent, so importing the accessor
|
|
7239
|
-
* at all is treated as reading it.
|
|
7240
|
-
*
|
|
7241
|
-
* The rule is scoped by *reference*, not by export shape, and that scoping is
|
|
7242
|
-
* what keeps it from being useless: `import { getSearchParams } from
|
|
7243
|
-
* '@timber-js/app/server'; export { getSearchParams }` is a barrel whose body
|
|
7244
|
-
* never mentions the name, and tainting it would taint every page that
|
|
7245
|
-
* imports anything from that barrel. The forwarded name stays resolvable
|
|
7246
|
-
* through `resolveExport`, so the page that actually calls it is still caught
|
|
7247
|
-
* one hop later, in the module that uses it.
|
|
7248
|
-
*
|
|
7249
|
-
* Scoping on "the module only forwards it" would have been the natural
|
|
7250
|
-
* phrasing and is wrong: a barrel can forward a name *and* use it
|
|
7251
|
-
* (`export { getSearchParams }` beside `const read = flag ? getSearchParams
|
|
7252
|
-
* : noop`), and that module is exactly the one this rule exists to catch.
|
|
7253
|
-
* `referencedLocals` excludes import/export clauses and nothing else, so
|
|
7254
|
-
* forwarding is exempt only when it is all the module does with the name.
|
|
7255
|
-
*
|
|
7256
|
-
* `unknown` is deliberately not included: an unresolvable specifier taints
|
|
7257
|
-
* only when something is actually called or read on it, or every module with
|
|
7258
|
-
* one broken import would go request-dependent.
|
|
7259
|
-
*/
|
|
7260
|
-
function holdsRequestBinding(moduleId, facts) {
|
|
7261
|
-
for (const local of facts.referencedLocals) {
|
|
7262
|
-
const origin = resolveLocal(moduleId, local);
|
|
7263
|
-
if (origin.kind === "accessor" || origin.kind === "definition") return true;
|
|
7264
|
-
}
|
|
7265
|
-
return false;
|
|
7266
|
-
}
|
|
7267
|
-
return {
|
|
7268
|
-
isTainted(moduleId) {
|
|
7269
|
-
const cached = taintCache.get(moduleId);
|
|
7270
|
-
if (cached !== void 0) return cached;
|
|
7271
|
-
const facts = factsMap.get(moduleId);
|
|
7272
|
-
const result = facts ? computeTainted(moduleId, facts) : false;
|
|
7273
|
-
taintCache.set(moduleId, result);
|
|
7274
|
-
return result;
|
|
7275
|
-
},
|
|
7276
|
-
isDefinitionModule(moduleId) {
|
|
7277
|
-
const facts = factsMap.get(moduleId);
|
|
7278
|
-
if (!facts) return false;
|
|
7279
|
-
for (const edge of facts.importedBindings.values()) {
|
|
7280
|
-
const origin = resolveEdge(moduleId, edge);
|
|
7281
|
-
if (origin.kind === "factory") return true;
|
|
7282
|
-
if (origin.kind === "framework-namespace" && DEFINITION_FACTORY_SOURCES.has(origin.source)) return true;
|
|
7283
|
-
}
|
|
7284
|
-
return false;
|
|
7285
|
-
},
|
|
7286
|
-
callsGetterOnImport(moduleId) {
|
|
7287
|
-
const facts = factsMap.get(moduleId);
|
|
7288
|
-
if (!facts) return false;
|
|
7289
|
-
for (const local of facts.getterLocals) if (facts.importedBindings.has(local)) return true;
|
|
7290
|
-
return false;
|
|
7291
|
-
}
|
|
7292
|
-
};
|
|
7293
|
-
}
|
|
7294
|
-
// src/plugins/request-dep/index.ts
|
|
7295
|
-
function isFrameworkModule(id) {
|
|
7296
|
-
return /[\\/]node_modules[\\/]@timber-js[\\/]app[\\/]/.test(id) || /[\\/]packages[\\/]timber-app[\\/]src[\\/]/.test(id);
|
|
7297
|
-
}
|
|
7298
|
-
/**
|
|
7299
|
-
* Cheap gate before parsing.
|
|
7300
|
-
*
|
|
7301
|
-
* This used to be a substring match on the accessor and factory names, which
|
|
7302
|
-
* was sound only for the analysis it served: when a call site had to name the
|
|
7303
|
-
* framework binding in its own import declaration, a module with no such name
|
|
7304
|
-
* could not be a call site. Resolving bindings across the graph removes that
|
|
7305
|
-
* guarantee — with
|
|
7306
|
-
*
|
|
7307
|
-
* // _lib/index.ts
|
|
7308
|
-
* export { getSearchParams as query } from '@timber-js/app/server';
|
|
7309
|
-
* // page.tsx
|
|
7310
|
-
* import { query } from './_lib';
|
|
7311
|
-
* export default function Page() { return query(); }
|
|
7312
|
-
*
|
|
7313
|
-
* the page contains no accessor name, no `.get(`, and no re-export syntax, and
|
|
7314
|
-
* skipping it would have put the rename right back where the barrel was. So the
|
|
7315
|
-
* gate is now structural: a module matters if it has any module-level binding
|
|
7316
|
-
* to follow. What it skips is source with no `import` and no `export` at all —
|
|
7317
|
-
* data blobs, generated constants, side-effect scripts — none of which can name
|
|
7318
|
-
* a framework binding or forward one.
|
|
7319
|
-
*/
|
|
7320
|
-
function hasModuleBindings(code) {
|
|
7321
|
-
return code.includes("import") || code.includes("export");
|
|
7322
|
-
}
|
|
7323
|
-
/**
|
|
7324
|
-
* Walk the module graph from an entry, returning true if any module reachable
|
|
7325
|
-
* from it reads the request.
|
|
7326
|
-
*
|
|
7327
|
-
* Two passes, and the second is a deliberately blunt backstop:
|
|
7328
|
-
*
|
|
7329
|
-
* 1. **Binding origins.** For each reachable module, resolve every call site's
|
|
7330
|
-
* binding to its origin. This is precise and indifferent to indirection.
|
|
7331
|
-
* 2. **Definition reachability.** A module that calls `.get()` on *something*
|
|
7332
|
-
* it imported, with a module holding a definition factory reachable behind
|
|
7333
|
-
* that import, counts too. The origin walk cannot see through a value that
|
|
7334
|
-
* is computed rather than bound — `getFilterCookie(key).get()`, where the
|
|
7335
|
-
* helper returns a definition — and this pass can.
|
|
7336
|
-
*
|
|
7337
|
-
* The second pass over-reports by construction, which is the safe direction: a
|
|
7338
|
-
* needlessly request-dependent segment costs a re-render, a wrongly static one
|
|
7339
|
-
* serves stale content.
|
|
7340
|
-
*
|
|
7341
|
-
* An entry the graph does not contain is an edge we failed to walk, not the
|
|
7342
|
-
* absence of one — the same rule an unresolvable specifier gets. Without the
|
|
7343
|
-
* check it reads as an entry with no imports and no facts, and both passes fall
|
|
7344
|
-
* through to `false`: confidently request-INdependent, for a module nothing
|
|
7345
|
-
* ever looked at. In the build that answer is worse than no answer, because it
|
|
7346
|
-
* is written into `requestDep` as a definite `false` and the runtime's own
|
|
7347
|
-
* "absent key → conservative" fallback never fires.
|
|
7348
|
-
*/
|
|
7349
|
-
function isReachableTaintSource(entryId, input) {
|
|
7350
|
-
const { factsMap, getImports, isKnownModule } = input;
|
|
7351
|
-
if (!isKnownModule(entryId)) return true;
|
|
7352
|
-
const resolver = createOriginResolver(factsMap);
|
|
7353
|
-
const visited = /* @__PURE__ */ new Set();
|
|
7354
|
-
const stack = [entryId];
|
|
7355
|
-
while (stack.length > 0) {
|
|
7356
|
-
const id = stack.pop();
|
|
7357
|
-
if (visited.has(id)) continue;
|
|
7358
|
-
visited.add(id);
|
|
7359
|
-
if (resolver.isTainted(id)) return true;
|
|
7360
|
-
for (const imp of getImports(id)) if (!imp.startsWith("\0") && !visited.has(imp)) stack.push(imp);
|
|
7361
|
-
}
|
|
7362
|
-
const reachesDefinition = makeDefinitionReachability(resolver.isDefinitionModule, getImports);
|
|
7363
|
-
for (const id of visited) {
|
|
7364
|
-
if (!resolver.callsGetterOnImport(id)) continue;
|
|
7365
|
-
if (reachesDefinition(id)) return true;
|
|
7366
|
-
}
|
|
7367
|
-
return false;
|
|
7368
|
-
}
|
|
7369
|
-
/**
|
|
7370
|
-
* "Can a definition module be reached from this module's imports?", memoized
|
|
7371
|
-
* across the queries one entry makes.
|
|
7372
|
-
*
|
|
7373
|
-
* Walks the graph rather than testing direct imports, because `export … from`
|
|
7374
|
-
* is an ordinary module edge and a barrel is the common way an app shares one
|
|
7375
|
-
* `defineSearchParams` across routes.
|
|
7376
|
-
*
|
|
7377
|
-
* Cycles terminate on the memo seeded with `false`; a module already being
|
|
7378
|
-
* resolved contributes nothing, which is correct — anything it could reach is
|
|
7379
|
-
* reachable on the path that is still unwinding.
|
|
7380
|
-
*/
|
|
7381
|
-
function makeDefinitionReachability(isDefinitionModule, getImports) {
|
|
7382
|
-
const cache = /* @__PURE__ */ new Map();
|
|
7383
|
-
return function reaches(id) {
|
|
7384
|
-
const cached = cache.get(id);
|
|
7385
|
-
if (cached !== void 0) return cached;
|
|
7386
|
-
cache.set(id, false);
|
|
7387
|
-
let result = false;
|
|
7388
|
-
for (const imp of getImports(id)) {
|
|
7389
|
-
if (imp.startsWith("\0")) continue;
|
|
7390
|
-
if (isDefinitionModule(imp) || reaches(imp)) {
|
|
7391
|
-
result = true;
|
|
7392
|
-
break;
|
|
7393
|
-
}
|
|
7394
|
-
}
|
|
7395
|
-
cache.set(id, result);
|
|
7396
|
-
return result;
|
|
7397
|
-
};
|
|
7398
|
-
}
|
|
7399
|
-
var BRIDGE_KEY = Symbol.for("timber:request-dep");
|
|
7400
|
-
/**
|
|
7401
|
-
* Resolve every specifier the module has an edge to, so the origin walk can
|
|
7402
|
-
* follow them later without a module graph.
|
|
7403
|
-
*
|
|
7404
|
-
* Framework specifiers are classified by name and never resolved — that is what
|
|
7405
|
-
* keeps the terminal check independent of how `@timber-js/app` happens to be
|
|
7406
|
-
* installed. A specifier that fails to resolve is recorded as unresolved rather
|
|
7407
|
-
* than dropped, so the walk can take the conservative branch on it.
|
|
7408
|
-
*/
|
|
7409
|
-
async function resolveEdgeSources(pluginCtx, facts, importer) {
|
|
7410
|
-
for (const source of usedSources(facts)) {
|
|
7411
|
-
if (FRAMEWORK_SOURCES.has(source)) continue;
|
|
7412
|
-
try {
|
|
7413
|
-
const resolved = await pluginCtx.resolve(source, importer);
|
|
7414
|
-
if (resolved?.id) facts.resolvedSources.set(source, resolved.id);
|
|
7415
|
-
else facts.unresolvedSources.add(source);
|
|
7416
|
-
} catch {
|
|
7417
|
-
facts.unresolvedSources.add(source);
|
|
7418
|
-
}
|
|
7419
|
-
}
|
|
7420
|
-
}
|
|
7421
|
-
function timberRequestDep(ctx) {
|
|
7422
|
-
const factsMap = /* @__PURE__ */ new Map();
|
|
7423
|
-
const cache = /* @__PURE__ */ new Map();
|
|
7424
|
-
return {
|
|
7425
|
-
name: "timber-request-dep",
|
|
7426
|
-
applyToEnvironment(env) {
|
|
7427
|
-
return env.name === "rsc";
|
|
7428
|
-
},
|
|
7429
|
-
async transform(code, id) {
|
|
7430
|
-
if (!/\.[mc]?[jt]sx?$/.test(id) && !/\.mdx?$/.test(id)) return;
|
|
7431
|
-
if (id.startsWith("\0") || id.startsWith("virtual:")) return;
|
|
7432
|
-
if (isFrameworkModule(id)) return;
|
|
7433
|
-
if (!hasModuleBindings(code)) return;
|
|
7434
|
-
const pluginCtx = this;
|
|
7435
|
-
const facts = analyzeModule(pluginCtx.parse(code));
|
|
7436
|
-
if (contributesNothing(facts)) {
|
|
7437
|
-
factsMap.delete(id);
|
|
7438
|
-
return;
|
|
7439
|
-
}
|
|
7440
|
-
await resolveEdgeSources(pluginCtx, facts, id);
|
|
7441
|
-
factsMap.set(id, facts);
|
|
7442
|
-
},
|
|
7443
|
-
configureServer(server) {
|
|
7444
|
-
const resolver = (filePath) => {
|
|
7445
|
-
if (cache.has(filePath)) return cache.get(filePath);
|
|
7446
|
-
const rscEnv = server.environments?.rsc;
|
|
7447
|
-
if (!rscEnv?.moduleGraph) return true;
|
|
7448
|
-
const getImports = (moduleId) => {
|
|
7449
|
-
const mod = rscEnv.moduleGraph.getModuleById(moduleId);
|
|
7450
|
-
if (!mod) return [];
|
|
7451
|
-
const result = [];
|
|
7452
|
-
for (const imp of mod.importedModules) if (imp.id) result.push(imp.id);
|
|
7453
|
-
return result;
|
|
7454
|
-
};
|
|
7455
|
-
const isKnownModule = (moduleId) => rscEnv.moduleGraph.getModuleById(moduleId) !== void 0;
|
|
7456
|
-
const result = isReachableTaintSource(filePath, {
|
|
7457
|
-
factsMap,
|
|
7458
|
-
getImports,
|
|
7459
|
-
isKnownModule
|
|
7460
|
-
});
|
|
7461
|
-
if (isKnownModule(filePath)) cache.set(filePath, result);
|
|
7462
|
-
return result;
|
|
7463
|
-
};
|
|
7464
|
-
globalThis[BRIDGE_KEY] = resolver;
|
|
7465
|
-
const clearCache = () => cache.clear();
|
|
7466
|
-
server.watcher.on("change", clearCache);
|
|
7467
|
-
server.watcher.on("add", clearCache);
|
|
7468
|
-
server.watcher.on("unlink", clearCache);
|
|
7469
|
-
},
|
|
7470
|
-
buildEnd() {
|
|
7471
|
-
if (ctx.dev) return;
|
|
7472
|
-
const getModuleInfo = this.getModuleInfo;
|
|
7473
|
-
const getImports = (moduleId) => {
|
|
7474
|
-
const info = getModuleInfo(moduleId);
|
|
7475
|
-
if (!info) return [];
|
|
7476
|
-
return [...info.importedIds ?? [], ...info.dynamicallyImportedIds ?? []];
|
|
7477
|
-
};
|
|
7478
|
-
const isKnownModule = (moduleId) => getModuleInfo(moduleId) != null;
|
|
7479
|
-
const requestDepMap = {};
|
|
7480
|
-
if (ctx.routeTree) walkSegmentTree(ctx.routeTree.root, (filePath) => {
|
|
7481
|
-
requestDepMap[filePath] = isReachableTaintSource(filePath, {
|
|
7482
|
-
factsMap,
|
|
7483
|
-
getImports,
|
|
7484
|
-
isKnownModule
|
|
7485
|
-
});
|
|
7486
|
-
});
|
|
7487
|
-
ctx.requestDepMap = requestDepMap;
|
|
7488
|
-
}
|
|
7489
|
-
};
|
|
7490
|
-
}
|
|
7491
|
-
function walkSegmentTree(node, fn) {
|
|
7492
|
-
if (node.layout) fn(node.layout.filePath);
|
|
7493
|
-
if (node.page) fn(node.page.filePath);
|
|
7494
|
-
if (node.default) fn(node.default.filePath);
|
|
7495
|
-
if (node.children) for (const child of node.children) walkSegmentTree(child, fn);
|
|
7496
|
-
if (node.slots) for (const slot of Object.values(node.slots)) walkSegmentTree(slot, fn);
|
|
7497
|
-
}
|
|
7498
6776
|
// src/plugins/optimize-package-imports-defaults.ts
|
|
7499
6777
|
/**
|
|
7500
6778
|
* Import specifiers whose barrel imports timber rewrites by default.
|
|
@@ -11003,7 +10281,7 @@ function timber(config) {
|
|
|
11003
10281
|
console: originalConsole
|
|
11004
10282
|
});
|
|
11005
10283
|
ctx.timer.start("client-deps-scan");
|
|
11006
|
-
const { clientOptimizeDepsEntries, skipUseServerScanPlugin } = await import("./_chunks/client-dep-entries-
|
|
10284
|
+
const { clientOptimizeDepsEntries, skipUseServerScanPlugin } = await import("./_chunks/client-dep-entries-ZETBdLgv.js");
|
|
11007
10285
|
const entries = await clientOptimizeDepsEntries(resolvedRoot, BROWSER_ENTRY_FILE, buildDir);
|
|
11008
10286
|
ctx.timer.end("client-deps-scan");
|
|
11009
10287
|
return {
|
|
@@ -11060,7 +10338,6 @@ function timber(config) {
|
|
|
11060
10338
|
timberMdx(ctx),
|
|
11061
10339
|
timberOptimizePackageImports(ctx),
|
|
11062
10340
|
timberClientInServerPackageDeps(),
|
|
11063
|
-
timberRequestDep(ctx),
|
|
11064
10341
|
timberCacheTransform(ctx),
|
|
11065
10342
|
timberPrerenderSugar(ctx),
|
|
11066
10343
|
prebuilt,
|