@timber-js/app 0.2.0-alpha.185 → 0.2.0-alpha.187
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{actions-O_LsyCE4.js → actions-35jnMdeJ.js} +4 -3
- package/dist/_chunks/{actions-O_LsyCE4.js.map → actions-35jnMdeJ.js.map} +1 -1
- package/dist/_chunks/als-registry-C6kcfprT.js +41 -0
- package/dist/_chunks/als-registry-C6kcfprT.js.map +1 -0
- package/dist/_chunks/als-slots-BEEIPKYm.js +26 -0
- package/dist/_chunks/als-slots-BEEIPKYm.js.map +1 -0
- package/dist/_chunks/base-path-DaQrzbez.js +80 -0
- package/dist/_chunks/base-path-DaQrzbez.js.map +1 -0
- package/dist/_chunks/build-manifest-DWppEdLB.js +86 -0
- package/dist/_chunks/build-manifest-DWppEdLB.js.map +1 -0
- package/dist/_chunks/build-output-helper-C3DrfzZR.js +369 -0
- package/dist/_chunks/build-output-helper-C3DrfzZR.js.map +1 -0
- package/dist/_chunks/{cache-api-B-lhk9p4.js → cache-api-DjNrIWRR.js} +8 -14
- package/dist/_chunks/cache-api-DjNrIWRR.js.map +1 -0
- package/dist/_chunks/cli-check-CpmN7Nh-.js +256 -0
- package/dist/_chunks/cli-check-CpmN7Nh-.js.map +1 -0
- package/dist/_chunks/cli-schema-sync-CGMp_Psg.js +298 -0
- package/dist/_chunks/cli-schema-sync-CGMp_Psg.js.map +1 -0
- package/dist/_chunks/{cloudflare-CnT5Lr7U.js → cloudflare-CGP6BZKO.js} +92 -14
- package/dist/_chunks/{cloudflare-CnT5Lr7U.js.map → cloudflare-CGP6BZKO.js.map} +1 -1
- package/dist/_chunks/convention-lint-kXsgc_-7.js +784 -0
- package/dist/_chunks/convention-lint-kXsgc_-7.js.map +1 -0
- package/dist/_chunks/error-boundary-D-ODYX41.js +353 -0
- package/dist/_chunks/error-boundary-D-ODYX41.js.map +1 -0
- package/dist/_chunks/{fast-hash-D6hIVt1Y.js → fast-hash-C-tVYrLb.js} +6 -1
- package/dist/_chunks/fast-hash-C-tVYrLb.js.map +1 -0
- package/dist/_chunks/file-cache-DmX7OqZP.js +454 -0
- package/dist/_chunks/file-cache-DmX7OqZP.js.map +1 -0
- package/dist/_chunks/fs-identity-D7vb6GdI.js +208 -0
- package/dist/_chunks/fs-identity-D7vb6GdI.js.map +1 -0
- package/dist/_chunks/{logger-AWfuX-KJ.js → logger-D8xJZXIN.js} +34 -51
- package/dist/_chunks/logger-D8xJZXIN.js.map +1 -0
- package/dist/_chunks/mdx-file-C005ay-P.js +25 -0
- package/dist/_chunks/mdx-file-C005ay-P.js.map +1 -0
- package/dist/_chunks/{plugin-context---kTF5v8.js → plugin-context-rCinWLiE.js} +8 -2
- package/dist/_chunks/plugin-context-rCinWLiE.js.map +1 -0
- package/dist/_chunks/purge-store-Byr8XOjU.js +14 -0
- package/dist/_chunks/purge-store-Byr8XOjU.js.map +1 -0
- package/dist/_chunks/{resolve-schema-Dz3fcFUo.js → resolve-schema-5ma5pp1b.js} +2 -2
- package/dist/_chunks/{resolve-schema-Dz3fcFUo.js.map → resolve-schema-5ma5pp1b.js.map} +1 -1
- package/dist/_chunks/{router-ref-CtmF-aPv.js → router-ref-DuYuV_0Q.js} +2 -2
- package/dist/_chunks/router-ref-DuYuV_0Q.js.map +1 -0
- package/dist/_chunks/rsc-cache-key-DD0fl_-s.js +243 -0
- package/dist/_chunks/rsc-cache-key-DD0fl_-s.js.map +1 -0
- package/dist/_chunks/rsc-error-envelope-tT5PJs4q.js +40 -0
- package/dist/_chunks/rsc-error-envelope-tT5PJs4q.js.map +1 -0
- package/dist/_chunks/rsc-media-type-DRqE_lD_.js +46 -0
- package/dist/_chunks/rsc-media-type-DRqE_lD_.js.map +1 -0
- package/dist/_chunks/rsc-payload-path-B_LBodc2.js +48 -0
- package/dist/_chunks/rsc-payload-path-B_LBodc2.js.map +1 -0
- package/dist/_chunks/scanner-C8b0Gcw3.js +1564 -0
- package/dist/_chunks/scanner-C8b0Gcw3.js.map +1 -0
- package/dist/_chunks/schema-bridge-Cc2Gngu1.js +199 -0
- package/dist/_chunks/schema-bridge-Cc2Gngu1.js.map +1 -0
- package/dist/_chunks/{segment-classify-Byy425ng.js → segment-classify-C539Pa2O.js} +23 -2
- package/dist/_chunks/segment-classify-C539Pa2O.js.map +1 -0
- package/dist/_chunks/segment-context-CjOlyB8Y.js +97 -0
- package/dist/_chunks/segment-context-CjOlyB8Y.js.map +1 -0
- package/dist/_chunks/{canonicalize-DQHyFClh.js → segment-keys-BawYuNFO.js} +61 -2
- package/dist/_chunks/segment-keys-BawYuNFO.js.map +1 -0
- package/dist/_chunks/slot-params-BCTmZkQB.js +76 -0
- package/dist/_chunks/slot-params-BCTmZkQB.js.map +1 -0
- package/dist/_chunks/{ssr-data-BOWsq18U.js → ssr-data-14MXm7Pj.js} +17 -2
- package/dist/_chunks/ssr-data-14MXm7Pj.js.map +1 -0
- package/dist/_chunks/{use-query-states-DFvWd-EA.js → use-query-states-BbU5Ge1V.js} +74 -26
- package/dist/_chunks/use-query-states-BbU5Ge1V.js.map +1 -0
- package/dist/_chunks/use-segment-params-C4r4BD9T.js +398 -0
- package/dist/_chunks/use-segment-params-C4r4BD9T.js.map +1 -0
- package/dist/_chunks/walkers-RzN6AFjr.js +141 -0
- package/dist/_chunks/walkers-RzN6AFjr.js.map +1 -0
- package/dist/adapters/build-output-helper.d.ts +37 -0
- package/dist/adapters/build-output-helper.d.ts.map +1 -1
- package/dist/adapters/cloudflare-dev.js +1 -1
- package/dist/adapters/cloudflare-kv-cache.js +1 -1
- package/dist/adapters/cloudflare.d.ts.map +1 -1
- package/dist/adapters/cloudflare.js +1 -1
- package/dist/adapters/compress-module.d.ts +12 -0
- package/dist/adapters/compress-module.d.ts.map +1 -1
- package/dist/adapters/fs-identity.d.ts +64 -0
- package/dist/adapters/fs-identity.d.ts.map +1 -0
- package/dist/adapters/nitro.d.ts.map +1 -1
- package/dist/adapters/nitro.js +56 -5
- package/dist/adapters/nitro.js.map +1 -1
- package/dist/adapters/shared.d.ts +57 -1
- package/dist/adapters/shared.d.ts.map +1 -1
- package/dist/adapters/types.d.ts +13 -1
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/cache/fast-hash.d.ts +5 -0
- package/dist/cache/fast-hash.d.ts.map +1 -1
- package/dist/cache/index.js +1 -1
- package/dist/cdn/cloudflare-purge.js +30 -0
- package/dist/cdn/cloudflare-purge.js.map +1 -0
- package/dist/cdn/fastly-purge.js +33 -0
- package/dist/cdn/fastly-purge.js.map +1 -0
- package/dist/cdn/index.js +94 -0
- package/dist/cdn/index.js.map +1 -0
- package/dist/cdn/workers-cache-purge.js +35 -0
- package/dist/cdn/workers-cache-purge.js.map +1 -0
- package/dist/cli-check.d.ts +153 -0
- package/dist/cli-check.d.ts.map +1 -0
- package/dist/cli.d.ts +34 -8
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +46 -21
- package/dist/cli.js.map +1 -1
- package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -1
- package/dist/client/browser-entry/hydrate.d.ts +20 -9
- package/dist/client/browser-entry/hydrate.d.ts.map +1 -1
- package/dist/client/browser-entry/index.d.ts +1 -1
- package/dist/client/browser-entry/index.d.ts.map +1 -1
- package/dist/client/browser-entry/post-hydration.d.ts +4 -1
- package/dist/client/browser-entry/post-hydration.d.ts.map +1 -1
- package/dist/client/browser-entry/router-init.d.ts +3 -0
- package/dist/client/browser-entry/router-init.d.ts.map +1 -1
- package/dist/client/browser-entry/rsc-stream.d.ts +8 -0
- package/dist/client/browser-entry/rsc-stream.d.ts.map +1 -1
- package/dist/client/error-boundary.d.ts +7 -0
- package/dist/client/error-boundary.d.ts.map +1 -1
- package/dist/client/error-boundary.js +1 -162
- package/dist/client/history.d.ts +13 -6
- package/dist/client/history.d.ts.map +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +42 -41
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.d.ts +4 -3
- package/dist/client/internal.d.ts.map +1 -1
- package/dist/client/internal.js +877 -311
- package/dist/client/internal.js.map +1 -1
- package/dist/client/link.d.ts +1 -7
- package/dist/client/link.d.ts.map +1 -1
- package/dist/client/navigation-api.d.ts +2 -2
- package/dist/client/navigation-commit.d.ts +87 -0
- package/dist/client/navigation-commit.d.ts.map +1 -0
- package/dist/client/navigation-context.d.ts +37 -20
- package/dist/client/navigation-context.d.ts.map +1 -1
- package/dist/client/navigation-root.d.ts +63 -23
- package/dist/client/navigation-root.d.ts.map +1 -1
- package/dist/client/params-context.d.ts +81 -0
- package/dist/client/params-context.d.ts.map +1 -0
- package/dist/client/router-effects.d.ts +129 -0
- package/dist/client/router-effects.d.ts.map +1 -0
- package/dist/client/router-lifecycle.d.ts +55 -0
- package/dist/client/router-lifecycle.d.ts.map +1 -0
- package/dist/client/router-pipeline.d.ts +84 -0
- package/dist/client/router-pipeline.d.ts.map +1 -0
- package/dist/client/router-ref.d.ts +1 -1
- package/dist/client/router-ref.d.ts.map +1 -1
- package/dist/client/router-skew.d.ts +21 -0
- package/dist/client/router-skew.d.ts.map +1 -0
- package/dist/client/router-types.d.ts +207 -0
- package/dist/client/router-types.d.ts.map +1 -0
- package/dist/client/router.d.ts +1 -182
- package/dist/client/router.d.ts.map +1 -1
- package/dist/client/rsc-fetch.d.ts +47 -26
- package/dist/client/rsc-fetch.d.ts.map +1 -1
- package/dist/client/segment-cache.d.ts +87 -34
- package/dist/client/segment-cache.d.ts.map +1 -1
- package/dist/client/ssr-data.d.ts +6 -0
- package/dist/client/ssr-data.d.ts.map +1 -1
- package/dist/client/stale-client.d.ts +69 -0
- package/dist/client/stale-client.d.ts.map +1 -0
- package/dist/client/state.d.ts +10 -1
- package/dist/client/state.d.ts.map +1 -1
- package/dist/client/top-loader.d.ts +2 -1
- package/dist/client/top-loader.d.ts.map +1 -1
- package/dist/client/unload-guard.d.ts +5 -0
- package/dist/client/unload-guard.d.ts.map +1 -1
- package/dist/client/use-cookie.d.ts.map +1 -1
- package/dist/client/use-query-states.d.ts +9 -3
- package/dist/client/use-query-states.d.ts.map +1 -1
- package/dist/client/use-router.d.ts +1 -1
- package/dist/client/use-segment-params.d.ts +18 -8
- package/dist/client/use-segment-params.d.ts.map +1 -1
- package/dist/codec.js +1 -1
- package/dist/cookies/define-cookie.d.ts.map +1 -1
- package/dist/cookies/index.js +5 -5
- package/dist/cookies/index.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1009 -759
- package/dist/index.js.map +1 -1
- package/dist/params/index.js +1 -1
- package/dist/plugin-context.d.ts +46 -0
- package/dist/plugin-context.d.ts.map +1 -1
- package/dist/plugins/adapter-build.d.ts.map +1 -1
- package/dist/plugins/build-manifest.d.ts +1 -1
- package/dist/plugins/build-manifest.d.ts.map +1 -1
- package/dist/plugins/entries.d.ts.map +1 -1
- package/dist/plugins/fonts.d.ts.map +1 -1
- package/dist/plugins/request-dep/analysis.d.ts +106 -0
- package/dist/plugins/request-dep/analysis.d.ts.map +1 -0
- package/dist/plugins/request-dep/index.d.ts +75 -0
- package/dist/plugins/request-dep/index.d.ts.map +1 -0
- package/dist/plugins/request-dep/origin.d.ts +61 -0
- package/dist/plugins/request-dep/origin.d.ts.map +1 -0
- package/dist/plugins/routing.d.ts.map +1 -1
- package/dist/plugins/shims.d.ts.map +1 -1
- package/dist/plugins/static-build.d.ts +160 -8
- package/dist/plugins/static-build.d.ts.map +1 -1
- package/dist/routing/codegen-shared.d.ts +3 -44
- package/dist/routing/codegen-shared.d.ts.map +1 -1
- package/dist/routing/codegen-types.d.ts +28 -31
- package/dist/routing/codegen-types.d.ts.map +1 -1
- package/dist/routing/codegen-write.d.ts +51 -0
- package/dist/routing/codegen-write.d.ts.map +1 -0
- package/dist/routing/codegen.d.ts.map +1 -1
- package/dist/routing/collision-probe.d.ts +104 -0
- package/dist/routing/collision-probe.d.ts.map +1 -0
- package/dist/routing/collision-spaces.d.ts +26 -0
- package/dist/routing/collision-spaces.d.ts.map +1 -0
- package/dist/routing/convention-lint.d.ts +18 -4
- package/dist/routing/convention-lint.d.ts.map +1 -1
- package/dist/routing/export-detect.d.ts +16 -0
- package/dist/routing/export-detect.d.ts.map +1 -1
- package/dist/routing/index.js +4 -3
- package/dist/routing/interception.d.ts +235 -6
- package/dist/routing/interception.d.ts.map +1 -1
- package/dist/routing/link-codegen.d.ts +19 -4
- package/dist/routing/link-codegen.d.ts.map +1 -1
- package/dist/routing/manifest-codegen.d.ts +1 -7
- package/dist/routing/manifest-codegen.d.ts.map +1 -1
- package/dist/routing/scanner.d.ts.map +1 -1
- package/dist/routing/segment-classify.d.ts +33 -0
- package/dist/routing/segment-classify.d.ts.map +1 -1
- package/dist/routing/segment-keys.d.ts +95 -0
- package/dist/routing/segment-keys.d.ts.map +1 -0
- package/dist/routing/slot-placement.d.ts +48 -0
- package/dist/routing/slot-placement.d.ts.map +1 -0
- package/dist/routing/types.d.ts +0 -6
- package/dist/routing/types.d.ts.map +1 -1
- package/dist/routing/walkers.d.ts +6 -0
- package/dist/routing/walkers.d.ts.map +1 -1
- package/dist/schema-bridge.d.ts +60 -9
- package/dist/schema-bridge.d.ts.map +1 -1
- package/dist/search-params/define.d.ts +62 -14
- package/dist/search-params/define.d.ts.map +1 -1
- package/dist/search-params/index.d.ts +0 -1
- package/dist/search-params/index.d.ts.map +1 -1
- package/dist/search-params/index.js +221 -10
- package/dist/search-params/index.js.map +1 -1
- package/dist/search-params/parse-total.d.ts +70 -0
- package/dist/search-params/parse-total.d.ts.map +1 -0
- package/dist/search-params/wrappers.d.ts +26 -3
- package/dist/search-params/wrappers.d.ts.map +1 -1
- package/dist/server/access-gate.d.ts +19 -8
- package/dist/server/access-gate.d.ts.map +1 -1
- package/dist/server/action-handler.d.ts.map +1 -1
- package/dist/server/actions.d.ts +6 -3
- package/dist/server/actions.d.ts.map +1 -1
- package/dist/server/als-registry.d.ts +18 -1
- package/dist/server/als-registry.d.ts.map +1 -1
- package/dist/server/build-manifest.d.ts +13 -1
- package/dist/server/build-manifest.d.ts.map +1 -1
- package/dist/server/chain-url-parts.d.ts +82 -0
- package/dist/server/chain-url-parts.d.ts.map +1 -0
- package/dist/server/children-interception.d.ts +49 -0
- package/dist/server/children-interception.d.ts.map +1 -0
- package/dist/server/compress.d.ts.map +1 -1
- package/dist/server/default-status-page.d.ts +45 -0
- package/dist/server/default-status-page.d.ts.map +1 -0
- package/dist/server/deny-boundary.d.ts +148 -15
- package/dist/server/deny-boundary.d.ts.map +1 -1
- package/dist/server/deny-renderer.d.ts +15 -4
- package/dist/server/deny-renderer.d.ts.map +1 -1
- package/dist/server/error-boundary-wrapper.d.ts +85 -15
- package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
- package/dist/server/head-response.d.ts +35 -0
- package/dist/server/head-response.d.ts.map +1 -0
- package/dist/server/index.d.ts +0 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +3 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/internal.d.ts +3 -1
- package/dist/server/internal.d.ts.map +1 -1
- package/dist/server/internal.js +712 -418
- package/dist/server/internal.js.map +1 -1
- package/dist/server/metadata-collector.d.ts +52 -0
- package/dist/server/metadata-collector.d.ts.map +1 -0
- package/dist/server/param-coercion.d.ts +22 -6
- package/dist/server/param-coercion.d.ts.map +1 -1
- package/dist/server/pipeline-helpers.d.ts +0 -18
- package/dist/server/pipeline-helpers.d.ts.map +1 -1
- package/dist/server/pipeline-interception.d.ts +59 -9
- package/dist/server/pipeline-interception.d.ts.map +1 -1
- package/dist/server/pipeline-outcome.d.ts.map +1 -1
- package/dist/server/pipeline-phases.d.ts.map +1 -1
- package/dist/server/pipeline.d.ts +11 -0
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/primitives.d.ts +23 -0
- package/dist/server/primitives.d.ts.map +1 -1
- package/dist/server/publish-params.d.ts +33 -0
- package/dist/server/publish-params.d.ts.map +1 -0
- package/dist/server/request-context.d.ts +48 -0
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/route-element-builder.d.ts +22 -3
- package/dist/server/route-element-builder.d.ts.map +1 -1
- package/dist/server/route-handler.d.ts.map +1 -1
- package/dist/server/route-matcher.d.ts +13 -0
- package/dist/server/route-matcher.d.ts.map +1 -1
- package/dist/server/rsc-cache-key-guard.d.ts +78 -0
- package/dist/server/rsc-cache-key-guard.d.ts.map +1 -0
- package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
- package/dist/server/rsc-entry/deny-fallback.d.ts.map +1 -1
- package/dist/server/rsc-entry/error-renderer.d.ts +15 -3
- package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/helpers.d.ts +2 -17
- package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
- package/dist/server/rsc-entry/index.d.ts +0 -1
- package/dist/server/rsc-entry/index.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 +15 -2
- package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
- package/dist/server/skippable-prefix.d.ts +23 -0
- package/dist/server/skippable-prefix.d.ts.map +1 -0
- package/dist/server/slot-interception.d.ts +80 -0
- package/dist/server/slot-interception.d.ts.map +1 -0
- package/dist/server/slot-resolver.d.ts +70 -8
- package/dist/server/slot-resolver.d.ts.map +1 -1
- package/dist/server/ssr-bridge-types.d.ts +17 -0
- package/dist/server/ssr-bridge-types.d.ts.map +1 -1
- package/dist/server/ssr-entry.d.ts +0 -1
- package/dist/server/ssr-entry.d.ts.map +1 -1
- package/dist/server/ssr-wrappers.d.ts +24 -13
- package/dist/server/ssr-wrappers.d.ts.map +1 -1
- package/dist/server/state-tree-diff.d.ts +6 -27
- package/dist/server/state-tree-diff.d.ts.map +1 -1
- package/dist/server/static-generator.d.ts +6 -0
- package/dist/server/static-generator.d.ts.map +1 -1
- package/dist/server/static-not-found.d.ts +52 -0
- package/dist/server/static-not-found.d.ts.map +1 -0
- package/dist/server/status-code-resolver.d.ts +8 -1
- package/dist/server/status-code-resolver.d.ts.map +1 -1
- package/dist/server/tree-builder.d.ts +28 -36
- package/dist/server/tree-builder.d.ts.map +1 -1
- package/dist/server/types.d.ts +12 -7
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/utils/element-type.d.ts +40 -0
- package/dist/server/utils/element-type.d.ts.map +1 -0
- package/dist/shared/als-slots.d.ts +41 -0
- package/dist/shared/als-slots.d.ts.map +1 -0
- package/dist/shared/base-path.d.ts +56 -0
- package/dist/shared/base-path.d.ts.map +1 -0
- package/dist/shared/param-value.d.ts +80 -0
- package/dist/shared/param-value.d.ts.map +1 -0
- package/dist/shared/payload-root.d.ts +108 -0
- package/dist/shared/payload-root.d.ts.map +1 -0
- package/dist/shared/rsc-cache-key.d.ts +163 -0
- package/dist/shared/rsc-cache-key.d.ts.map +1 -0
- package/dist/shared/rsc-error-envelope.d.ts +25 -0
- package/dist/shared/rsc-error-envelope.d.ts.map +1 -0
- package/dist/shared/rsc-manifest.d.ts +28 -0
- package/dist/shared/rsc-manifest.d.ts.map +1 -0
- package/dist/shared/rsc-media-type.d.ts +40 -0
- package/dist/shared/rsc-media-type.d.ts.map +1 -0
- package/dist/shared/rsc-payload-path.d.ts +42 -0
- package/dist/shared/rsc-payload-path.d.ts.map +1 -0
- package/dist/shared/segment-info.d.ts +59 -0
- package/dist/shared/segment-info.d.ts.map +1 -0
- package/dist/shared/slot-params.d.ts +51 -0
- package/dist/shared/slot-params.d.ts.map +1 -0
- package/dist/shared/static-platform-files.d.ts +71 -0
- package/dist/shared/static-platform-files.d.ts.map +1 -0
- package/docs/api/30-api-server.mdx +1 -1
- package/docs/api/31-api-client.mdx +4 -2
- package/docs/api/33-api-search-params.mdx +38 -16
- package/docs/api/35-api-typescript.mdx +3 -3
- package/docs/api/36-cli.mdx +34 -7
- package/docs/learn/00-introduction.mdx +1 -1
- package/docs/learn/02-pages-and-layouts.mdx +2 -2
- package/docs/learn/05-typed-params.mdx +8 -8
- package/docs/learn/07-typed-routes.mdx +12 -7
- package/docs/learn/11-error-handling.mdx +18 -0
- package/docs/learn/12-client-navigation.mdx +2 -2
- package/docs/learn/14-deploying.mdx +23 -0
- package/docs/more/01-advanced-routing.mdx +173 -3
- package/docs/more/03-coming-from-nextjs.mdx +2 -2
- package/docs/more/04-metadata-and-fonts.mdx +1 -1
- package/docs/more/50-ai-agent-instructions.mdx +6 -4
- package/package.json +9 -6
- package/src/adapters/build-output-helper.ts +116 -3
- package/src/adapters/cloudflare.ts +90 -12
- package/src/adapters/compress-module.ts +79 -1
- package/src/adapters/fs-identity.ts +156 -0
- package/src/adapters/nitro.ts +6 -6
- package/src/adapters/shared.ts +196 -21
- package/src/adapters/types.ts +13 -1
- package/src/cache/fast-hash.ts +5 -0
- package/src/cli-check.ts +458 -0
- package/src/cli.ts +59 -24
- package/src/client/browser-entry/action-dispatch.ts +11 -5
- package/src/client/browser-entry/hydrate.ts +40 -29
- package/src/client/browser-entry/index.ts +15 -6
- package/src/client/browser-entry/post-hydration.ts +10 -9
- package/src/client/browser-entry/router-init.ts +104 -48
- package/src/client/browser-entry/rsc-stream.ts +11 -2
- package/src/client/error-boundary.tsx +85 -16
- package/src/client/history.ts +13 -6
- package/src/client/index.ts +14 -3
- package/src/client/internal.ts +4 -3
- package/src/client/link.tsx +120 -72
- package/src/client/navigation-api.ts +3 -3
- package/src/client/navigation-commit.ts +197 -0
- package/src/client/navigation-context.ts +40 -67
- package/src/client/navigation-root.tsx +326 -101
- package/src/client/params-context.ts +192 -0
- package/src/client/router-effects.ts +231 -0
- package/src/client/router-lifecycle.ts +288 -0
- package/src/client/router-pipeline.ts +393 -0
- package/src/client/router-ref.ts +1 -1
- package/src/client/router-skew.ts +30 -0
- package/src/client/router-types.ts +230 -0
- package/src/client/router.ts +243 -707
- package/src/client/rsc-fetch.ts +183 -106
- package/src/client/segment-cache.ts +129 -44
- package/src/client/ssr-data.ts +6 -0
- package/src/client/stale-client.ts +191 -0
- package/src/client/state.ts +14 -1
- package/src/client/top-loader.tsx +2 -1
- package/src/client/unload-guard.ts +34 -2
- package/src/client/use-cookie.ts +9 -2
- package/src/client/use-query-states.ts +102 -39
- package/src/client/use-router.ts +1 -1
- package/src/client/use-segment-params.ts +41 -18
- package/src/cookies/define-cookie.ts +6 -1
- package/src/index.ts +25 -4
- package/src/plugin-context.ts +58 -0
- package/src/plugins/adapter-build.ts +4 -0
- package/src/plugins/build-manifest.ts +34 -13
- package/src/plugins/entries.ts +4 -0
- package/src/plugins/fonts.ts +11 -8
- package/src/plugins/request-dep/analysis.ts +447 -0
- package/src/plugins/request-dep/index.ts +376 -0
- package/src/plugins/request-dep/origin.ts +310 -0
- package/src/plugins/routing.ts +97 -102
- package/src/plugins/shims.ts +0 -1
- package/src/plugins/static-build.ts +391 -95
- package/src/routing/codegen-shared.ts +3 -79
- package/src/routing/codegen-types.ts +28 -31
- package/src/routing/codegen-write.ts +139 -0
- package/src/routing/codegen.ts +86 -172
- package/src/routing/collision-probe.ts +438 -0
- package/src/routing/collision-spaces.ts +281 -0
- package/src/routing/convention-lint.ts +139 -40
- package/src/routing/export-detect.ts +151 -7
- package/src/routing/interception.ts +896 -50
- package/src/routing/link-codegen.ts +32 -65
- package/src/routing/manifest-codegen.ts +6 -62
- package/src/routing/scanner.ts +117 -92
- package/src/routing/segment-classify.ts +57 -0
- package/src/routing/segment-keys.ts +146 -0
- package/src/routing/slot-placement.ts +97 -0
- package/src/routing/types.ts +0 -6
- package/src/routing/walkers.ts +8 -0
- package/src/schema-bridge.ts +180 -58
- package/src/search-params/define.ts +108 -66
- package/src/search-params/index.ts +0 -1
- package/src/search-params/parse-total.ts +78 -0
- package/src/search-params/wrappers.ts +60 -11
- package/src/server/access-gate.tsx +60 -40
- package/src/server/action-handler.ts +4 -5
- package/src/server/actions.ts +6 -3
- package/src/server/als-registry.ts +18 -1
- package/src/server/build-manifest.ts +14 -1
- package/src/server/chain-url-parts.ts +163 -0
- package/src/server/children-interception.ts +115 -0
- package/src/server/compress.ts +9 -1
- package/src/server/default-status-page.ts +127 -0
- package/src/server/deny-boundary.ts +269 -41
- package/src/server/deny-renderer.ts +111 -39
- package/src/server/error-boundary-wrapper.ts +166 -79
- package/src/server/head-response.ts +54 -0
- package/src/server/index.ts +1 -3
- package/src/server/internal.ts +2 -2
- package/src/server/metadata-collector.ts +115 -0
- package/src/server/param-coercion.ts +51 -69
- package/src/server/pipeline-helpers.ts +2 -47
- package/src/server/pipeline-interception.ts +81 -32
- package/src/server/pipeline-outcome.ts +4 -5
- package/src/server/pipeline-phases.ts +77 -25
- package/src/server/pipeline.ts +57 -10
- package/src/server/prebuilt-runtime.ts +4 -4
- package/src/server/primitives.ts +25 -0
- package/src/server/publish-params.ts +42 -0
- package/src/server/request-context.ts +97 -18
- package/src/server/route-element-builder.ts +241 -253
- package/src/server/route-handler.ts +8 -8
- package/src/server/route-matcher.ts +21 -9
- package/src/server/rsc-cache-key-guard.ts +164 -0
- package/src/server/rsc-entry/api-handler.ts +6 -8
- package/src/server/rsc-entry/deny-fallback.ts +3 -2
- package/src/server/rsc-entry/error-renderer.ts +94 -35
- package/src/server/rsc-entry/helpers.ts +33 -28
- package/src/server/rsc-entry/index.ts +36 -33
- package/src/server/rsc-entry/render-route.ts +18 -10
- package/src/server/rsc-entry/revalidate-renderer.ts +3 -2
- package/src/server/rsc-entry/rsc-payload.ts +113 -40
- package/src/server/rsc-entry/rsc-stream.ts +29 -5
- package/src/server/rsc-entry/ssr-renderer.ts +38 -22
- package/src/server/skippable-prefix.ts +92 -0
- package/src/server/slot-interception.ts +168 -0
- package/src/server/slot-resolver.ts +263 -158
- package/src/server/ssr-bridge-types.ts +18 -0
- package/src/server/ssr-entry.ts +20 -10
- package/src/server/ssr-wrappers.tsx +33 -32
- package/src/server/state-tree-diff.ts +14 -55
- package/src/server/static-generator.ts +68 -29
- package/src/server/static-not-found.ts +134 -0
- package/src/server/status-code-resolver.ts +28 -11
- package/src/server/tree-builder.ts +35 -218
- package/src/server/types.ts +12 -7
- package/src/server/utils/element-type.ts +72 -0
- package/src/shared/als-slots.ts +72 -0
- package/src/shared/base-path.ts +80 -0
- package/src/shared/param-value.ts +244 -0
- package/src/shared/payload-root.ts +151 -0
- package/src/shared/rsc-cache-key.ts +269 -0
- package/src/shared/rsc-error-envelope.ts +31 -0
- package/src/shared/rsc-manifest.ts +29 -0
- package/src/shared/rsc-media-type.ts +43 -0
- package/src/shared/rsc-payload-path.ts +45 -0
- package/src/shared/segment-info.ts +60 -0
- package/src/shared/slot-params.ts +111 -0
- package/src/shared/static-platform-files.ts +75 -0
- package/dist/_chunks/build-output-helper-DOGYFb_X.js +0 -196
- package/dist/_chunks/build-output-helper-DOGYFb_X.js.map +0 -1
- package/dist/_chunks/cache-api-B-lhk9p4.js.map +0 -1
- package/dist/_chunks/canonicalize-DQHyFClh.js.map +0 -1
- package/dist/_chunks/cli-schema-sync-BTWEKJXo.js +0 -668
- package/dist/_chunks/cli-schema-sync-BTWEKJXo.js.map +0 -1
- package/dist/_chunks/define-COtkxMRT.js +0 -191
- package/dist/_chunks/define-COtkxMRT.js.map +0 -1
- package/dist/_chunks/define-c4au4I9R.js +0 -82
- package/dist/_chunks/define-c4au4I9R.js.map +0 -1
- package/dist/_chunks/fast-hash-D6hIVt1Y.js.map +0 -1
- package/dist/_chunks/logger-AWfuX-KJ.js.map +0 -1
- package/dist/_chunks/navigation-root-bUDZLw74.js +0 -124
- package/dist/_chunks/navigation-root-bUDZLw74.js.map +0 -1
- package/dist/_chunks/plugin-context---kTF5v8.js.map +0 -1
- package/dist/_chunks/registry-DbJPKoBp.js +0 -20
- package/dist/_chunks/registry-DbJPKoBp.js.map +0 -1
- package/dist/_chunks/router-ref-CtmF-aPv.js.map +0 -1
- package/dist/_chunks/schema-bridge-DT_Tn0Xf.js +0 -119
- package/dist/_chunks/schema-bridge-DT_Tn0Xf.js.map +0 -1
- package/dist/_chunks/segment-classify-Byy425ng.js.map +0 -1
- package/dist/_chunks/segment-context-ZDnXDkbz.js +0 -34
- package/dist/_chunks/segment-context-ZDnXDkbz.js.map +0 -1
- package/dist/_chunks/ssr-data-BOWsq18U.js.map +0 -1
- package/dist/_chunks/use-query-states-DFvWd-EA.js.map +0 -1
- package/dist/_chunks/use-segment-params-D1CzlgBo.js +0 -151
- package/dist/_chunks/use-segment-params-D1CzlgBo.js.map +0 -1
- package/dist/_chunks/walkers-_6zKFlch.js +0 -1002
- package/dist/_chunks/walkers-_6zKFlch.js.map +0 -1
- package/dist/client/error-boundary.js.map +0 -1
- package/dist/plugins/request-dep.d.ts +0 -32
- package/dist/plugins/request-dep.d.ts.map +0 -1
- package/dist/search-params/registry.d.ts +0 -20
- package/dist/search-params/registry.d.ts.map +0 -1
- package/dist/segment-params/define.d.ts +0 -89
- package/dist/segment-params/define.d.ts.map +0 -1
- package/dist/segment-params/index.d.ts +0 -3
- package/dist/segment-params/index.d.ts.map +0 -1
- package/dist/segment-params/index.js +0 -2
- package/src/plugins/request-dep.ts +0 -499
- package/src/search-params/registry.ts +0 -31
- package/src/segment-params/define.ts +0 -249
- package/src/segment-params/index.ts +0 -9
package/dist/params/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as toBracketKey, t as resolveSchemaCodecs } from "../_chunks/resolve-schema-
|
|
1
|
+
import { n as toBracketKey, t as resolveSchemaCodecs } from "../_chunks/resolve-schema-5ma5pp1b.js";
|
|
2
2
|
import { n as setLinkCodecs, t as getLinkCodec } from "../_chunks/codec-registry-oOUxugz3.js";
|
|
3
3
|
//#region src/params/define-schema.ts
|
|
4
4
|
/**
|
package/dist/plugin-context.d.ts
CHANGED
|
@@ -44,6 +44,21 @@ export interface PluginContext {
|
|
|
44
44
|
root: string;
|
|
45
45
|
/** Whether the dev server is running (set by timber-root-sync in configResolved) */
|
|
46
46
|
dev: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Vite's resolved `base` (set by timber-root-sync in configResolved).
|
|
49
|
+
* Always has a trailing slash; `'/'` unless the app is deployed under a
|
|
50
|
+
* sub-path. Every URL the framework emits — assets, fonts, RSC payloads —
|
|
51
|
+
* carries this prefix. This is the single copy: sub-plugins read it here
|
|
52
|
+
* rather than capturing `config.base` in their own configResolved.
|
|
53
|
+
*
|
|
54
|
+
* **Availability:** written by timber-root-sync, which has no `enforce`, so
|
|
55
|
+
* it is populated from `buildStart`/`load`/`generateBundle`/`configureServer`
|
|
56
|
+
* onward — but NOT during the `configResolved` of an `enforce: 'pre'`
|
|
57
|
+
* plugin, which Vite runs first. A pre plugin that needs the base inside
|
|
58
|
+
* its own `configResolved` must read `config.base` there (timber-fonts
|
|
59
|
+
* does). See TIM-1261.
|
|
60
|
+
*/
|
|
61
|
+
base: string;
|
|
47
62
|
/** CSS build manifest (populated by adapter after client build, null in dev) */
|
|
48
63
|
buildManifest: BuildManifest | null;
|
|
49
64
|
/** Per-build deployment ID for version skew detection (null in dev) */
|
|
@@ -69,6 +84,22 @@ export interface PluginContext {
|
|
|
69
84
|
* populate per-route modulepreload entries from clientReferenceDeps.
|
|
70
85
|
*/
|
|
71
86
|
routeClientRefKeys?: Map<string, Set<string>>;
|
|
87
|
+
/**
|
|
88
|
+
* Static request-dependency verdict per segment entry file, keyed by the
|
|
89
|
+
* absolute `filePath` the route scanner produced. Computed once by
|
|
90
|
+
* `timber-request-dep`'s RSC `buildEnd` and serialized into
|
|
91
|
+
* `buildManifest.requestDep` by `timber-build-manifest` (build only — dev
|
|
92
|
+
* answers the same question through the `Symbol.for('timber:request-dep')`
|
|
93
|
+
* bridge instead).
|
|
94
|
+
*
|
|
95
|
+
* `undefined` and `{}` are different states and the difference is the whole
|
|
96
|
+
* of TIM-1300: an empty object means the analysis ran and found no segments,
|
|
97
|
+
* `undefined` means it never ran, and the runtime cannot tell them apart —
|
|
98
|
+
* every key is absent either way, so every segment falls to the conservative
|
|
99
|
+
* `true` and nothing is ever skipped. The build fails loudly on `undefined`
|
|
100
|
+
* rather than shipping that silently.
|
|
101
|
+
*/
|
|
102
|
+
requestDepMap?: Record<string, boolean>;
|
|
72
103
|
/**
|
|
73
104
|
* Maps absolute module IDs of client references in non-facade RSC
|
|
74
105
|
* chunks to the absolute paths of their consuming facade modules.
|
|
@@ -160,6 +191,21 @@ export declare class ParseMemo {
|
|
|
160
191
|
parse(code: string): ProgramNode;
|
|
161
192
|
get size(): number;
|
|
162
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* What `timber-root-sync` publishes on its Vite `plugin.api`.
|
|
196
|
+
*
|
|
197
|
+
* The single supported way to read timber's *resolved* configuration from
|
|
198
|
+
* outside the plugin pipeline. Re-reading `timber.config.ts` is not equivalent:
|
|
199
|
+
* config passed inline as `timber({ ... })` in `vite.config.ts` exists only in
|
|
200
|
+
* the plugin's closure, and `root`/`appDir` are resolved against Vite's root
|
|
201
|
+
* rather than the caller's cwd.
|
|
202
|
+
*/
|
|
203
|
+
export interface TimberPluginApi {
|
|
204
|
+
/** The live plugin context. Fully populated from `configResolved` onward. */
|
|
205
|
+
getContext(): PluginContext;
|
|
206
|
+
}
|
|
207
|
+
/** Narrow an unknown Vite `plugin.api` to timber's. */
|
|
208
|
+
export declare function isTimberPluginApi(api: unknown): api is TimberPluginApi;
|
|
163
209
|
/**
|
|
164
210
|
* Resolve the app directory. Checks (in order):
|
|
165
211
|
* 1. Explicit `configAppDir` from timber.config.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-context.d.ts","sourceRoot":"","sources":["../src/plugin-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,a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C7B,MAAM,EAAE,gBAAgB,EACxB,UAAU,EAAE,gBAAgB,GAC3B,gBAAgB,CAiBlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-build.d.ts","sourceRoot":"","sources":["../../src/plugins/adapter-build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter-build.d.ts","sourceRoot":"","sources":["../../src/plugins/adapter-build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAIjE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAgF7D;AAgHD;;;;;;;GAOG;AACH;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,aAAa,EAC5B,kBAAkB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,GAC5C,OAAO,CAAC,IAAI,CAAC,CAmDf;AAED,wBAAsB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA+CnF"}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import type { Plugin } from 'vite';
|
|
19
19
|
import type { PluginContext } from '../plugin-context.js';
|
|
20
|
-
import type
|
|
20
|
+
import { type BuildManifest } from '../server/build-manifest.js';
|
|
21
21
|
interface OutputChunk {
|
|
22
22
|
type: 'chunk';
|
|
23
23
|
fileName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-manifest.d.ts","sourceRoot":"","sources":["../../src/plugins/build-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"build-manifest.d.ts","sourceRoot":"","sources":["../../src/plugins/build-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAMvF,UAAU,WAAW;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC3E;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAAC,CAAC;AAK9D;;;GAGG;AACH,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAC/C,IAAI,EAAE,MAAM,GACX,aAAa,CAmBf;AAqCD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,aAAa,CA0Cf;AA+ID;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAiK9D"}
|
|
@@ -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":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAmK1D;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUlF;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAErE;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE3D;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAqBxF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CA+B3E;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAiFxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../src/plugins/fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAiC,MAAM,MAAM,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AA2B1D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../src/plugins/fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAiC,MAAM,MAAM,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AA2B1D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA8OtD"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-module syntactic facts for request-dependency analysis.
|
|
3
|
+
*
|
|
4
|
+
* This module is deliberately dumb: it records *what the source says*, with no
|
|
5
|
+
* knowledge of which specifiers or names are interesting. Every judgement —
|
|
6
|
+
* "is this an accessor", "is this a definition object" — lives in `origin.ts`,
|
|
7
|
+
* which resolves a binding to the module it actually came from.
|
|
8
|
+
*
|
|
9
|
+
* That split is the point. The previous shape asked each module in isolation
|
|
10
|
+
* "do you import `getSearchParams` from `@timber-js/app/server` and call it",
|
|
11
|
+
* which any indirection defeats: a barrel re-export, a namespace import, a
|
|
12
|
+
* factory reached through the app's own `_lib`. Each of those was a separate
|
|
13
|
+
* hole and each was found separately (TIM-1291). Recording bindings and edges
|
|
14
|
+
* here, and resolving them across the graph there, closes the family instead of
|
|
15
|
+
* its members.
|
|
16
|
+
*
|
|
17
|
+
* See design/19-client-navigation.md §"Why the slot comparison ignores the query".
|
|
18
|
+
*/
|
|
19
|
+
import type { ProgramNode } from '../callsite-ast.js';
|
|
20
|
+
/**
|
|
21
|
+
* One module-graph edge introduced by an `import` or `export … from`.
|
|
22
|
+
*
|
|
23
|
+
* `imported` is the name as it exists in the *source* module: an export name,
|
|
24
|
+
* `'default'`, or `'*'` for a namespace/star form.
|
|
25
|
+
*/
|
|
26
|
+
export interface ImportEdge {
|
|
27
|
+
source: string;
|
|
28
|
+
imported: string;
|
|
29
|
+
}
|
|
30
|
+
/** The callee of `const x = f()` / `const x = ns.f()`. */
|
|
31
|
+
export type CalleeRef = {
|
|
32
|
+
kind: 'local';
|
|
33
|
+
name: string;
|
|
34
|
+
} | {
|
|
35
|
+
kind: 'member';
|
|
36
|
+
object: string;
|
|
37
|
+
property: string;
|
|
38
|
+
};
|
|
39
|
+
export interface ModuleFacts {
|
|
40
|
+
/** Local name → the edge that bound it (`import { a as b } from 'x'`). */
|
|
41
|
+
importedBindings: Map<string, ImportEdge>;
|
|
42
|
+
/** Exported name → edge, for `export { a as b } from 'x'`. */
|
|
43
|
+
reExports: Map<string, ImportEdge>;
|
|
44
|
+
/** Sources of anonymous `export * from 'x'`, in source order. */
|
|
45
|
+
starReExports: string[];
|
|
46
|
+
/** Exported name → local name, for `export { x }`, `export const x = …`. */
|
|
47
|
+
localExports: Map<string, string>;
|
|
48
|
+
/** Local variable name → the callee that produced its value. */
|
|
49
|
+
factoryCalls: Map<string, CalleeRef>;
|
|
50
|
+
/** Local names invoked directly: `f()`. */
|
|
51
|
+
calledLocals: Set<string>;
|
|
52
|
+
/** `ns.f()` → `ns` → `{ f }`. */
|
|
53
|
+
calledMembers: Map<string, Set<string>>;
|
|
54
|
+
/** Base identifier of a `.get()` chain: `x.get()`, `x().get()`, `x.p.get()`. */
|
|
55
|
+
getterLocals: Set<string>;
|
|
56
|
+
/** `ns.defs.get()` → `ns` → `{ defs }`. */
|
|
57
|
+
getterMembers: Map<string, Set<string>>;
|
|
58
|
+
/** Every name the module *body* mentions — import/export clauses excluded. */
|
|
59
|
+
referencedLocals: Set<string>;
|
|
60
|
+
/** Specifier → resolved module id, filled by the plugin via `this.resolve`. */
|
|
61
|
+
resolvedSources: Map<string, string>;
|
|
62
|
+
/** Specifiers that failed to resolve — treated as request-dependent. */
|
|
63
|
+
unresolvedSources: Set<string>;
|
|
64
|
+
}
|
|
65
|
+
/** `export default` has no local name of its own; this stands in for one. */
|
|
66
|
+
export declare const DEFAULT_EXPORT = "default";
|
|
67
|
+
export declare function createModuleFacts(): ModuleFacts;
|
|
68
|
+
/**
|
|
69
|
+
* Specifiers the origin walk can actually reach, so the plugin resolves those
|
|
70
|
+
* and not every import in the file.
|
|
71
|
+
*
|
|
72
|
+
* A re-export edge is always reachable — a downstream module can ask for any
|
|
73
|
+
* name it forwards. An `import` edge is reachable through any local name the
|
|
74
|
+
* module body mentions, or that it re-exports.
|
|
75
|
+
*
|
|
76
|
+
* The name set must be **the same one the taint rules consult**. Deriving it
|
|
77
|
+
* from the call shapes instead (called, `.get()`d, member-called, minted from)
|
|
78
|
+
* left `read(filters)` — a definition passed as an argument — with its
|
|
79
|
+
* specifier unresolved, so the origin walk reported it inert and the page read
|
|
80
|
+
* as request-independent. Two hand-maintained lists of "names that matter" is
|
|
81
|
+
* one list too many; this is the one, and `referencedLocals` is a superset of
|
|
82
|
+
* every call shape by construction, since each of them is an identifier the
|
|
83
|
+
* walk visits. (Codex review round 1 on PR #991.)
|
|
84
|
+
*/
|
|
85
|
+
export declare function usedSources(facts: ModuleFacts): Set<string>;
|
|
86
|
+
/**
|
|
87
|
+
* True when the module cannot affect any answer, so its facts need not be kept.
|
|
88
|
+
*
|
|
89
|
+
* Every judgement bottoms out at a module edge: a call site resolves through
|
|
90
|
+
* `importedBindings`, a chain link through `reExports` / `starReExports`. A
|
|
91
|
+
* module with none of those can only ever resolve to `none` — its exports lead
|
|
92
|
+
* to locals that lead nowhere — which is exactly what a *missing* entry
|
|
93
|
+
* produces. Dropping it is behaviour-preserving and keeps the dev-time map from
|
|
94
|
+
* holding an entry for every leaf module in the graph.
|
|
95
|
+
*/
|
|
96
|
+
export declare function contributesNothing(facts: ModuleFacts): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Record every binding, module edge, and call shape in one module.
|
|
99
|
+
*
|
|
100
|
+
* Names are recorded without scope analysis, so a parameter that shadows an
|
|
101
|
+
* imported name is credited to the import. That direction is deliberate: a
|
|
102
|
+
* needlessly request-dependent segment costs a re-render, a wrongly static one
|
|
103
|
+
* serves stale content.
|
|
104
|
+
*/
|
|
105
|
+
export declare function analyzeModule(program: ProgramNode): ModuleFacts;
|
|
106
|
+
//# sourceMappingURL=analysis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../../src/plugins/request-dep/analysis.ts"],"names":[],"mappings":"AAAA;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AE,MAAM,CAAC,CAAC;IACrC,wEAAwE;IACxE,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAChC;AAED,6EAA6E;AAC7E,eAAO,MAAM,cAAc,YAAY,CAAC;AAExC,wBAAgB,iBAAiB,IAAI,WAAW,CAe/C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAa3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAM9D;AAsRD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,WAAW,CAsB/D"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* timber-request-dep — Static module-graph analysis for request-dependency.
|
|
3
|
+
*
|
|
4
|
+
* Replaces runtime ALS-based taint tracking with a build/dev-time computed
|
|
5
|
+
* map: segment entry file → statically request-dependent?
|
|
6
|
+
*
|
|
7
|
+
* A segment/slot is request-dependent iff any module reachable from its
|
|
8
|
+
* layout/page/default in the RSC module graph (stopping at client-reference
|
|
9
|
+
* boundaries) reads the request: it calls a request accessor (`getHeaders`,
|
|
10
|
+
* `getSearchParams`, `cookies`, …) or calls `.get()` on a value minted by
|
|
11
|
+
* `defineSearchParams` / `defineCookie`.
|
|
12
|
+
*
|
|
13
|
+
* "Calls a request accessor" is decided by resolving the call site's binding
|
|
14
|
+
* back through import and re-export edges (`origin.ts`), not by matching the
|
|
15
|
+
* calling module's own import declarations. That distinction is the whole
|
|
16
|
+
* ticket: a barrel, an alias, or a namespace import used to make a page that
|
|
17
|
+
* reads the query look static, and a static slot is cached and skipped on a
|
|
18
|
+
* query-only navigation — serving stale content (TIM-1273, TIM-1291).
|
|
19
|
+
*
|
|
20
|
+
* This is deterministic, covers children/barrels/node_modules/Suspense-
|
|
21
|
+
* deferred code, and is computed before any byte is flushed.
|
|
22
|
+
*
|
|
23
|
+
* See design/19-client-navigation.md §"X-Timber-State-Tree Header"
|
|
24
|
+
*/
|
|
25
|
+
import type { Plugin } from 'vite';
|
|
26
|
+
import type { PluginContext } from '../../plugin-context.js';
|
|
27
|
+
import { type ModuleFacts } from './analysis.js';
|
|
28
|
+
export type { ModuleFacts } from './analysis.js';
|
|
29
|
+
export { analyzeModule, usedSources } from './analysis.js';
|
|
30
|
+
export { createOriginResolver } from './origin.js';
|
|
31
|
+
export declare function isFrameworkModule(id: string): boolean;
|
|
32
|
+
export interface ReachabilityInput {
|
|
33
|
+
factsMap: ReadonlyMap<string, ModuleFacts>;
|
|
34
|
+
getImports: (id: string) => string[];
|
|
35
|
+
/**
|
|
36
|
+
* Does the graph this walk runs over contain this module at all?
|
|
37
|
+
*
|
|
38
|
+
* Only the entry needs asking. Every other id the walk visits comes out of
|
|
39
|
+
* `getImports`, which enumerates edges the graph already resolved, so those
|
|
40
|
+
* are known by construction. The entry comes from outside — the route
|
|
41
|
+
* manifest's `filePath`, produced by the scanner from the filesystem — and
|
|
42
|
+
* nothing guarantees it is spelled the way the graph spells it, or that the
|
|
43
|
+
* module has been pulled through the pipeline yet.
|
|
44
|
+
*/
|
|
45
|
+
isKnownModule: (id: string) => boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Walk the module graph from an entry, returning true if any module reachable
|
|
49
|
+
* from it reads the request.
|
|
50
|
+
*
|
|
51
|
+
* Two passes, and the second is a deliberately blunt backstop:
|
|
52
|
+
*
|
|
53
|
+
* 1. **Binding origins.** For each reachable module, resolve every call site's
|
|
54
|
+
* binding to its origin. This is precise and indifferent to indirection.
|
|
55
|
+
* 2. **Definition reachability.** A module that calls `.get()` on *something*
|
|
56
|
+
* it imported, with a module holding a definition factory reachable behind
|
|
57
|
+
* that import, counts too. The origin walk cannot see through a value that
|
|
58
|
+
* is computed rather than bound — `getFilterCookie(key).get()`, where the
|
|
59
|
+
* helper returns a definition — and this pass can.
|
|
60
|
+
*
|
|
61
|
+
* The second pass over-reports by construction, which is the safe direction: a
|
|
62
|
+
* needlessly request-dependent segment costs a re-render, a wrongly static one
|
|
63
|
+
* serves stale content.
|
|
64
|
+
*
|
|
65
|
+
* An entry the graph does not contain is an edge we failed to walk, not the
|
|
66
|
+
* absence of one — the same rule an unresolvable specifier gets. Without the
|
|
67
|
+
* check it reads as an entry with no imports and no facts, and both passes fall
|
|
68
|
+
* through to `false`: confidently request-INdependent, for a module nothing
|
|
69
|
+
* ever looked at. In the build that answer is worse than no answer, because it
|
|
70
|
+
* is written into `requestDep` as a definite `false` and the runtime's own
|
|
71
|
+
* "absent key → conservative" fallback never fires.
|
|
72
|
+
*/
|
|
73
|
+
export declare function isReachableTaintSource(entryId: string, input: ReachabilityInput): boolean;
|
|
74
|
+
export declare function timberRequestDep(ctx: PluginContext): Plugin;
|
|
75
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/request-dep/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAkD,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjG,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAInD,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAKrD;AAgCD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC3C,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;IACrC;;;;;;;;;OASG;IACH,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;CACxC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAgCzF;AAyED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAkI3D"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Binding-origin resolution across the module graph.
|
|
3
|
+
*
|
|
4
|
+
* Given a local name at a call site, walk import and re-export edges until the
|
|
5
|
+
* binding lands somewhere that can be classified: a framework request accessor,
|
|
6
|
+
* a definition factory, a definition object minted by one, or nothing of
|
|
7
|
+
* interest. The walk is what makes the analysis indifferent to how the app
|
|
8
|
+
* organises its own code — a barrel, an alias, a namespace import, and a
|
|
9
|
+
* re-export chain five hops deep all reach the same origin (TIM-1291).
|
|
10
|
+
*
|
|
11
|
+
* The asymmetry that governs every judgement here: over-reporting costs a
|
|
12
|
+
* re-render, under-reporting serves stale content to a client that cached a
|
|
13
|
+
* slot whose render varies with the query. So an edge we cannot follow resolves
|
|
14
|
+
* to `unknown`, and `unknown` counts as request-dependent.
|
|
15
|
+
*
|
|
16
|
+
* See design/19-client-navigation.md §"Why the slot comparison ignores the query".
|
|
17
|
+
*/
|
|
18
|
+
import type { ModuleFacts } from './analysis.js';
|
|
19
|
+
/** Every specifier the classifier recognises without resolving it. */
|
|
20
|
+
export declare const FRAMEWORK_SOURCES: ReadonlySet<string>;
|
|
21
|
+
export type Origin =
|
|
22
|
+
/** A request accessor: `getSearchParams`, `cookies`, … */
|
|
23
|
+
{
|
|
24
|
+
kind: 'accessor';
|
|
25
|
+
}
|
|
26
|
+
/** A definition factory: `defineSearchParams`, `defineCookie`. */
|
|
27
|
+
| {
|
|
28
|
+
kind: 'factory';
|
|
29
|
+
}
|
|
30
|
+
/** A value minted by a definition factory — `.get()` on it reads the request. */
|
|
31
|
+
| {
|
|
32
|
+
kind: 'definition';
|
|
33
|
+
}
|
|
34
|
+
/** A namespace object for a framework module (`import * as h from 'next/headers'`). */
|
|
35
|
+
| {
|
|
36
|
+
kind: 'framework-namespace';
|
|
37
|
+
source: string;
|
|
38
|
+
}
|
|
39
|
+
/** A namespace object for an app module. */
|
|
40
|
+
| {
|
|
41
|
+
kind: 'namespace';
|
|
42
|
+
moduleId: string;
|
|
43
|
+
}
|
|
44
|
+
/** An edge that could not be followed. Treated as request-dependent. */
|
|
45
|
+
| {
|
|
46
|
+
kind: 'unknown';
|
|
47
|
+
}
|
|
48
|
+
/** Resolved, and not interesting. */
|
|
49
|
+
| {
|
|
50
|
+
kind: 'none';
|
|
51
|
+
};
|
|
52
|
+
export interface OriginResolver {
|
|
53
|
+
/** Does this module itself read the request? */
|
|
54
|
+
isTainted(moduleId: string): boolean;
|
|
55
|
+
/** Does this module hold a definition factory binding? */
|
|
56
|
+
isDefinitionModule(moduleId: string): boolean;
|
|
57
|
+
/** Does this module call `.get()` on a binding it imported? */
|
|
58
|
+
callsGetterOnImport(moduleId: string): boolean;
|
|
59
|
+
}
|
|
60
|
+
export declare function createOriginResolver(factsMap: ReadonlyMap<string, ModuleFacts>): OriginResolver;
|
|
61
|
+
//# sourceMappingURL=origin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"origin.d.ts","sourceRoot":"","sources":["../../../src/plugins/request-dep/origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAyB,WAAW,EAAE,MAAM,eAAe,CAAC;AAwBxE,sEAAsE;AACtE,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAGhD,CAAC;AAIH,MAAM,MAAM,MAAM;AAChB,0DAA0D;AACxD;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE;AACtB,kEAAkE;GAChE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE;AACrB,iFAAiF;GAC/E;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE;AACxB,uFAAuF;GACrF;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AACjD,4CAA4C;GAC1C;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE;AACzC,wEAAwE;GACtE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE;AACrB,qCAAqC;GACnC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAkCrB,MAAM,WAAW,cAAc;IAC7B,gDAAgD;IAChD,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IACrC,0DAA0D;IAC1D,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9C,+DAA+D;IAC/D,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAChD;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,cAAc,CA0M/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/plugins/routing.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/plugins/routing.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAYlD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AA+C1D,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAwRxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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,
|
|
1
|
+
{"version":3,"file":"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,CAkPvD"}
|
|
@@ -10,16 +10,14 @@
|
|
|
10
10
|
import type { Plugin } from 'vite';
|
|
11
11
|
import type { PluginContext } from '../plugin-context.js';
|
|
12
12
|
import type { StaticPageEntry, StaticRedirectEntry } from '../server/static-generator.js';
|
|
13
|
+
import type { RscManifest } from '../shared/rsc-manifest.js';
|
|
14
|
+
import { type FsIdentity } from '../adapters/fs-identity.js';
|
|
13
15
|
/**
|
|
14
16
|
* A single entry in the RSC manifest injected into static HTML.
|
|
15
17
|
* Maps an unhashed `/_rsc/*.rsc` path to its hashed URL, with
|
|
16
18
|
* optional route params inlined to avoid a sidecar fetch.
|
|
17
19
|
*/
|
|
18
|
-
export
|
|
19
|
-
url: string;
|
|
20
|
-
params?: Record<string, string | string[]>;
|
|
21
|
-
}
|
|
22
|
-
export type RscManifest = Record<string, RscManifestEntry>;
|
|
20
|
+
export type { RscManifestEntry, RscManifest } from '../shared/rsc-manifest.js';
|
|
23
21
|
export interface StaticValidationError {
|
|
24
22
|
type: 'dynamic-api';
|
|
25
23
|
file: string;
|
|
@@ -37,17 +35,165 @@ export declare function detectDynamicApis(code: string, fileId: string): StaticV
|
|
|
37
35
|
* Generate a `_redirects` file from collected redirect entries.
|
|
38
36
|
* Uses the Cloudflare Pages / Netlify format: `/from /to statusCode`
|
|
39
37
|
*
|
|
38
|
+
* Both sides are base-prefixed (TIM-1274). `from` is matched by the host
|
|
39
|
+
* against the request path and `to` is served to the browser as a `Location`,
|
|
40
|
+
* so both are deployed-URL space while `StaticRedirectEntry` carries route
|
|
41
|
+
* space — under `base: '/repo/'`, a rule `/old /new 301` would match nothing
|
|
42
|
+
* and, if it did, would send the browser off the deployment.
|
|
43
|
+
*
|
|
44
|
+
* An off-origin `to` is left alone: `redirectExternal()` produces an absolute
|
|
45
|
+
* URL, and a protocol-relative one addresses another host too. Neither is a
|
|
46
|
+
* path on this deployment, so neither takes the prefix.
|
|
47
|
+
*
|
|
48
|
+
* @param base Normalized deployment base (see `shared/base-path.ts`).
|
|
40
49
|
* @internal Exported for testing.
|
|
41
50
|
*/
|
|
42
|
-
export declare function generateRedirectsFile(redirects: StaticRedirectEntry[]): string;
|
|
51
|
+
export declare function generateRedirectsFile(redirects: StaticRedirectEntry[], base: string): string;
|
|
43
52
|
/**
|
|
44
53
|
* Determine the output file path for a static page entry.
|
|
45
54
|
*
|
|
46
55
|
* Pages: /about → about/index.html, / → index.html
|
|
47
|
-
* RSC: /about → _rsc/about.rsc, / → _rsc/index.rsc
|
|
56
|
+
* RSC: /about → _rsc/about/index.rsc, / → _rsc/index.rsc
|
|
48
57
|
* API: /feed.xml → feed.xml, /api/data → api/data
|
|
58
|
+
*
|
|
59
|
+
* The RSC shape mirrors the HTML shape for the reason the HTML shape has it:
|
|
60
|
+
* a route gets a directory and the artifact is the `index` inside it, so the
|
|
61
|
+
* mapping is injective. See `shared/rsc-payload-path.ts` (TIM-1266).
|
|
49
62
|
*/
|
|
50
63
|
export declare function staticOutputPath(entry: StaticPageEntry): string;
|
|
64
|
+
/**
|
|
65
|
+
* Records which entry claimed each output path and reports second claims.
|
|
66
|
+
*
|
|
67
|
+
* Two entries landing on one path is not a rendering failure — both render
|
|
68
|
+
* fine — so nothing downstream notices. The file is written twice, the second
|
|
69
|
+
* write wins, and the deployment serves one route's bytes at another route's
|
|
70
|
+
* URL with the same content type and the same shape (TIM-1266).
|
|
71
|
+
*
|
|
72
|
+
* The naming rules are injective by construction (a route path is a directory
|
|
73
|
+
* and the artifact is the `index` inside it), so a collision here means either
|
|
74
|
+
* two entries were enumerated for one URL or a route reached a path the
|
|
75
|
+
* framework reserves for itself (`404.html`). Both are build errors: there is
|
|
76
|
+
* no correct file to write.
|
|
77
|
+
*
|
|
78
|
+
* Two entries can also be unwritable together without claiming the same
|
|
79
|
+
* string: one wants a file where the other wants a directory (`about` from an
|
|
80
|
+
* API route, `about/index.html` from a page). The filesystem does refuse that
|
|
81
|
+
* one — `EISDIR` on the rename, `ENOTDIR` on the mkdir, depending on which
|
|
82
|
+
* lands second — but an errno names a path, and in the rename case the path
|
|
83
|
+
* it names is `about.tmp`. Reported here instead, so the message says which
|
|
84
|
+
* two routes.
|
|
85
|
+
*
|
|
86
|
+
* Collisions are **collected, not thrown**. `onEntry` runs inside the
|
|
87
|
+
* generator, whose RSC branch treats a throw as "this payload is unavailable,
|
|
88
|
+
* SPA navigation falls back to a full load" and swallows it — which for a
|
|
89
|
+
* collision is the wrong end state, since the two payloads are still
|
|
90
|
+
* ambiguous. The caller raises them once generation is done.
|
|
91
|
+
*
|
|
92
|
+
* @internal Exported for testing.
|
|
93
|
+
*/
|
|
94
|
+
export declare class StaticOutputPaths {
|
|
95
|
+
private readonly identity;
|
|
96
|
+
private readonly claimed;
|
|
97
|
+
/** Every ancestor directory of a claimed path, mapped to its claimant. */
|
|
98
|
+
private readonly directories;
|
|
99
|
+
private readonly collisions;
|
|
100
|
+
/**
|
|
101
|
+
* @param identity How the output filesystem decides two paths name one
|
|
102
|
+
* file, from `detectFsIdentity`. The guard predicts whether two writes
|
|
103
|
+
* land on one file, which is a property of the filesystem — so it is
|
|
104
|
+
* asked, not assumed. Folding unconditionally would reject `/Foo` beside
|
|
105
|
+
* `/foo` on Linux, where both are perfectly servable files.
|
|
106
|
+
*/
|
|
107
|
+
constructor(identity?: FsIdentity);
|
|
108
|
+
/** The identity under which the filesystem will compare this path. */
|
|
109
|
+
private key;
|
|
110
|
+
/**
|
|
111
|
+
* Claim `relPath` for `entry`. Returns false when the path cannot be
|
|
112
|
+
* written alongside an earlier claim, in which case the caller must not
|
|
113
|
+
* write the file — the losing entry is recorded and the build fails at
|
|
114
|
+
* the end.
|
|
115
|
+
*/
|
|
116
|
+
claim(relPath: string, entry: StaticPageEntry): boolean;
|
|
117
|
+
/** Throw if any two entries could not both be written. */
|
|
118
|
+
assertNoCollisions(): void;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Writes generated entries into the static output directory, one file per
|
|
122
|
+
* entry, refusing any write that would land on a path another entry holds.
|
|
123
|
+
*
|
|
124
|
+
* @internal Exported for testing.
|
|
125
|
+
*/
|
|
126
|
+
export declare class StaticSiteWriter {
|
|
127
|
+
private readonly staticDir;
|
|
128
|
+
/** Content-Type per URL path for extensionless API routes (TIM-1241). */
|
|
129
|
+
readonly contentTypes: Record<string, string>;
|
|
130
|
+
private readonly paths;
|
|
131
|
+
constructor(staticDir: string, identity?: FsIdentity);
|
|
132
|
+
write(entry: StaticPageEntry): Promise<void>;
|
|
133
|
+
/** Throw if any two entries could not both be written. */
|
|
134
|
+
assertNoCollisions(): void;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Remove artifacts a generation pass produces only *conditionally*, so none
|
|
138
|
+
* of them can survive from an earlier build into this one.
|
|
139
|
+
*
|
|
140
|
+
* Pages are not in this set: every page is rewritten each pass, and a page
|
|
141
|
+
* whose route was deleted is a different problem (a stale file nothing links
|
|
142
|
+
* to) from the one here.
|
|
143
|
+
*
|
|
144
|
+
* - `_rsc/` because the files are content-hashed. Left in place, a previous
|
|
145
|
+
* build's already-hashed payload gets hashed again and accumulates.
|
|
146
|
+
* - `_redirects` because it is written only when this pass found redirects.
|
|
147
|
+
* A build whose redirects were removed would otherwise ship the previous
|
|
148
|
+
* build's rules — and would break the merge exemption in
|
|
149
|
+
* `shared/static-platform-files.ts`, which lets the pre-rendered copy
|
|
150
|
+
* overwrite `public/_redirects` on the grounds that it *contains* it. That
|
|
151
|
+
* holds only for a file the current pass produced (TIM-1266).
|
|
152
|
+
*
|
|
153
|
+
* @internal Exported for testing.
|
|
154
|
+
*/
|
|
155
|
+
export declare function cleanConditionalArtifacts(staticDir: string): Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Run `fn` with `MessageChannel` instrumented, then stop every channel opened
|
|
158
|
+
* while it ran from holding the process open.
|
|
159
|
+
*
|
|
160
|
+
* Static generation is the only build pass that renders **HTML** in the build
|
|
161
|
+
* process: it imports the built app bundle and drives the full SSR pipeline
|
|
162
|
+
* through it. React's scheduler opens a `MessageChannel` at module scope in
|
|
163
|
+
* that bundle (`scheduler`'s DOM build) and never closes it, and a ref'd
|
|
164
|
+
* `MessagePort` keeps Node's event loop alive on its own — so `timber build`
|
|
165
|
+
* finished the site, printed its summary, and then hung forever. Server-mode
|
|
166
|
+
* builds are unaffected because nothing there renders through react-dom.
|
|
167
|
+
*
|
|
168
|
+
* `unref()` is the whole fix: it leaves the port working and only drops the
|
|
169
|
+
* "keep the process alive" property. It is applied **after** `fn` resolves, so
|
|
170
|
+
* a render in flight can never be cut short by the process exiting under it —
|
|
171
|
+
* an unref'd port would let Node exit while the scheduler still had a
|
|
172
|
+
* continuation queued, which is a silently truncated page rather than a hang.
|
|
173
|
+
*
|
|
174
|
+
* Nothing renders after this pass. If that ever changes, the release has to
|
|
175
|
+
* move to the end of whatever renders last.
|
|
176
|
+
*
|
|
177
|
+
* @internal Exported for testing.
|
|
178
|
+
*/
|
|
179
|
+
export declare function withSchedulerPortsReleased<T>(fn: () => Promise<T>): Promise<T>;
|
|
180
|
+
/**
|
|
181
|
+
* Warn when Vite's `base` is document-relative (`'./'`) in static mode.
|
|
182
|
+
*
|
|
183
|
+
* Payload URLs are addressed from the deployment root plus the base prefix.
|
|
184
|
+
* A relative base gives no prefix to compute (see shared/base-path.ts), so
|
|
185
|
+
* `/_rsc/about.rsc` is requested at the domain root — correct only when the
|
|
186
|
+
* site is served from there. The build still succeeds: relative bases work
|
|
187
|
+
* fine for assets, and for a root-served site nothing is wrong. The warning
|
|
188
|
+
* exists so a sub-path deployment does not silently degrade to a hard
|
|
189
|
+
* navigation on every link.
|
|
190
|
+
*
|
|
191
|
+
* Skipped when client JS is disabled — there is no SPA navigation and no
|
|
192
|
+
* payload fetch to mis-address.
|
|
193
|
+
*
|
|
194
|
+
* @internal Exported for testing.
|
|
195
|
+
*/
|
|
196
|
+
export declare function warnUnusableBase(ctx: PluginContext): void;
|
|
51
197
|
/**
|
|
52
198
|
* Compute a short content hash for immutable caching.
|
|
53
199
|
* Uses 8 chars of base64url-encoded SHA-256, matching Vite's asset hash style.
|
|
@@ -63,6 +209,12 @@ export declare function contentHash(data: Buffer | Uint8Array): string;
|
|
|
63
209
|
* The manifest maps the original `_rsc/` URL to an entry object:
|
|
64
210
|
* `{"/_rsc/index.rsc":{"url":"/_rsc/index-B7YxEKdN.rsc"}, ...}`
|
|
65
211
|
*
|
|
212
|
+
* Keys and URLs are **route-space**: root-relative, never carrying Vite's
|
|
213
|
+
* `base`. The client applies the base once, at fetch time
|
|
214
|
+
* (`client/rsc-fetch.ts` → `toStaticRscUrl`), so the generated site stays
|
|
215
|
+
* relocatable and the base has exactly one expression at runtime rather
|
|
216
|
+
* than two that must agree. See TIM-1261.
|
|
217
|
+
*
|
|
66
218
|
* Route params (from `routeParams`) are inlined into the manifest
|
|
67
219
|
* entry, eliminating the need for .params.json sidecar files. TIM-1255.
|
|
68
220
|
*
|
|
@@ -71,7 +223,7 @@ export declare function contentHash(data: Buffer | Uint8Array): string;
|
|
|
71
223
|
*
|
|
72
224
|
* @internal Exported for testing.
|
|
73
225
|
*/
|
|
74
|
-
export declare function hashRscPayloads(staticDir: string
|
|
226
|
+
export declare function hashRscPayloads(staticDir: string): Promise<RscManifest>;
|
|
75
227
|
/**
|
|
76
228
|
* Inject the RSC manifest into all HTML files as a `<script>` tag
|
|
77
229
|
* before `</head>`. This lets the client resolve hashed RSC URLs
|
|
@@ -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;
|
|
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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