@timber-js/app 0.2.0-alpha.207 → 0.2.0-alpha.209
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/{primitives-DLAnvsrk.js → actions-BerlqoXA.js} +640 -410
- package/dist/_chunks/actions-BerlqoXA.js.map +1 -0
- package/dist/_chunks/{als-registry-C6kcfprT.js → als-registry-DaxkVjt5.js} +6 -2
- package/dist/_chunks/als-registry-DaxkVjt5.js.map +1 -0
- package/dist/_chunks/{build-manifest-DTmSGLRz.js → build-manifest-DWppEdLB.js} +2 -51
- package/dist/_chunks/build-manifest-DWppEdLB.js.map +1 -0
- package/dist/_chunks/{build-output-helper-9dqCv1pZ.js → build-output-helper-RV_BRcF1.js} +50 -53
- package/dist/_chunks/build-output-helper-RV_BRcF1.js.map +1 -0
- package/dist/_chunks/{cache-api-CUD9Ezaq.js → cache-api-CR23J_NC.js} +64 -32
- package/dist/_chunks/cache-api-CR23J_NC.js.map +1 -0
- package/dist/_chunks/{chains-B4bgOl2g.js → chains-CpFg56UB.js} +2 -2
- package/dist/_chunks/{chains-B4bgOl2g.js.map → chains-CpFg56UB.js.map} +1 -1
- package/dist/_chunks/{cli-check-G8o30ldg.js → cli-check-C6Ev6wBO.js} +11 -52
- package/dist/_chunks/cli-check-C6Ev6wBO.js.map +1 -0
- package/dist/_chunks/cli-context-By7k2xVo.js +70 -0
- package/dist/_chunks/cli-context-By7k2xVo.js.map +1 -0
- package/dist/_chunks/{cli-schema-sync--LZKs8Zn.js → cli-schema-sync-CbT2AUUI.js} +3 -3
- package/dist/_chunks/{cli-schema-sync--LZKs8Zn.js.map → cli-schema-sync-CbT2AUUI.js.map} +1 -1
- package/dist/_chunks/{cloudflare-BFb__LYG.js → cloudflare-Byxl8FWP.js} +96 -53
- package/dist/_chunks/{cloudflare-BFb__LYG.js.map → cloudflare-Byxl8FWP.js.map} +1 -1
- package/dist/_chunks/{convention-lint-5KzoMg_A.js → convention-lint-jKTwKwPe.js} +21 -6
- package/dist/_chunks/convention-lint-jKTwKwPe.js.map +1 -0
- package/dist/_chunks/{dev-server-BzBxgYAV.js → dev-server-C4WZdB7L.js} +15 -167
- package/dist/_chunks/dev-server-C4WZdB7L.js.map +1 -0
- package/dist/_chunks/{error-boundary-BndF-3Td.js → error-boundary-tA7kVfs4.js} +84 -104
- package/dist/_chunks/error-boundary-tA7kVfs4.js.map +1 -0
- package/dist/_chunks/{fs-identity-D7vb6GdI.js → fs-identity-BRKuL215.js} +3 -4
- package/dist/_chunks/fs-identity-BRKuL215.js.map +1 -0
- package/dist/_chunks/{graph-cache-CP4GEmf9.js → graph-cache-CYiUS2aS.js} +4 -5
- package/dist/_chunks/graph-cache-CYiUS2aS.js.map +1 -0
- package/dist/_chunks/{json-lossy-check-ClNvBM_3.js → json-lossy-check-ip0Qi0MT.js} +6 -3
- package/dist/_chunks/json-lossy-check-ip0Qi0MT.js.map +1 -0
- package/dist/_chunks/{live-graph-Bm5WTvcr.js → live-graph-Dv-JJCZw.js} +3 -3
- package/dist/_chunks/{live-graph-Bm5WTvcr.js.map → live-graph-Dv-JJCZw.js.map} +1 -1
- package/dist/_chunks/{logger-k2DQ4EUf.js → logger-DiDt5ppH.js} +192 -51
- package/dist/_chunks/logger-DiDt5ppH.js.map +1 -0
- package/dist/_chunks/{navigation-root-mHSK9psY.js → navigation-root-BQfo1-kG.js} +2 -2
- package/dist/_chunks/{navigation-root-mHSK9psY.js.map → navigation-root-BQfo1-kG.js.map} +1 -1
- package/dist/_chunks/{plugin-context-8idfR3UZ.js → plugin-context-BPBPc3lL.js} +28 -4
- package/dist/_chunks/plugin-context-BPBPc3lL.js.map +1 -0
- package/dist/_chunks/{poison-scan-DG5eI2_z.js → poison-scan-CpeT6_OJ.js} +2 -2
- package/dist/_chunks/{poison-scan-DG5eI2_z.js.map → poison-scan-CpeT6_OJ.js.map} +1 -1
- package/dist/_chunks/render-timeout-DOf_BBcO.js +46 -0
- package/dist/_chunks/render-timeout-DOf_BBcO.js.map +1 -0
- package/dist/_chunks/{rsc-payload-path-B_LBodc2.js → rsc-payload-path-dffcs4jp.js} +9 -3
- package/dist/_chunks/{rsc-payload-path-B_LBodc2.js.map → rsc-payload-path-dffcs4jp.js.map} +1 -1
- package/dist/_chunks/{scanner-BQ5sPIJ7.js → scanner-Bw0oq1HB.js} +2 -2
- package/dist/_chunks/{scanner-BQ5sPIJ7.js.map → scanner-Bw0oq1HB.js.map} +1 -1
- package/dist/_chunks/{navigation-context-D0TU0Jog.js → segment-context-xtPUGfdq.js} +36 -34
- package/dist/_chunks/segment-context-xtPUGfdq.js.map +1 -0
- package/dist/_chunks/{singleflight-2lUWfcAk.js → singleflight-BeVMMKi0.js} +4 -3
- package/dist/_chunks/{singleflight-2lUWfcAk.js.map → singleflight-BeVMMKi0.js.map} +1 -1
- package/dist/_chunks/{sizeof-lXffQ1Vr.js → sizeof-UwzwB1uM.js} +3 -2
- package/dist/_chunks/sizeof-UwzwB1uM.js.map +1 -0
- package/dist/_chunks/ssr-data-nA3I70_n.js +49 -0
- package/dist/_chunks/ssr-data-nA3I70_n.js.map +1 -0
- package/dist/_chunks/{state-FippDgxN.js → state-BhNGPsdi.js} +6 -8
- package/dist/_chunks/state-BhNGPsdi.js.map +1 -0
- package/dist/_chunks/{status-page-marker-DwQBrLBz.js → status-page-marker-gaihi0KZ.js} +140 -28
- package/dist/_chunks/status-page-marker-gaihi0KZ.js.map +1 -0
- package/dist/_chunks/{walkers-CN2N_bA-.js → walkers-BXExhzzk.js} +2 -2
- package/dist/_chunks/{walkers-CN2N_bA-.js.map → walkers-BXExhzzk.js.map} +1 -1
- package/dist/_chunks/write-file-atomic-D1qWqHb4.js +32 -0
- package/dist/_chunks/write-file-atomic-D1qWqHb4.js.map +1 -0
- package/dist/adapters/build-output-helper.d.ts +7 -7
- package/dist/adapters/build-output-helper.d.ts.map +1 -1
- package/dist/adapters/canonicalize-module.d.ts +8 -0
- package/dist/adapters/canonicalize-module.d.ts.map +1 -0
- package/dist/adapters/cloudflare-dev.js +1 -1
- package/dist/adapters/cloudflare-kv-cache.js +2 -2
- package/dist/adapters/cloudflare.d.ts +30 -8
- package/dist/adapters/cloudflare.d.ts.map +1 -1
- package/dist/adapters/cloudflare.js +2 -2
- package/dist/adapters/compress-module.d.ts +8 -0
- package/dist/adapters/compress-module.d.ts.map +1 -1
- package/dist/adapters/fs-identity.d.ts +2 -3
- package/dist/adapters/fs-identity.d.ts.map +1 -1
- package/dist/adapters/nitro-presets.d.ts +0 -6
- package/dist/adapters/nitro-presets.d.ts.map +1 -1
- package/dist/adapters/nitro-preview.d.ts +43 -11
- package/dist/adapters/nitro-preview.d.ts.map +1 -1
- package/dist/adapters/nitro.d.ts +1 -13
- package/dist/adapters/nitro.d.ts.map +1 -1
- package/dist/adapters/nitro.js +291 -176
- package/dist/adapters/nitro.js.map +1 -1
- package/dist/adapters/shared.d.ts +7 -2
- package/dist/adapters/shared.d.ts.map +1 -1
- package/dist/adapters/types.d.ts +105 -21
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/adapters/types.js +0 -0
- package/dist/analyze/crawl-entry.js +3 -3
- package/dist/analyze/graph-cache.d.ts.map +1 -1
- package/dist/analyze/graph-command.js +4 -4
- package/dist/cache/index.js +2 -2
- package/dist/cache/json-lossy-check.d.ts.map +1 -1
- package/dist/cache/singleflight.d.ts.map +1 -1
- package/dist/cache/sizeof.d.ts.map +1 -1
- package/dist/cache/stores/memory.js +1 -1
- package/dist/cache/tag-aware-handler.d.ts.map +1 -1
- package/dist/cdn/workers-cache-purge.js +1 -1
- package/dist/cli-check.d.ts +7 -37
- package/dist/cli-check.d.ts.map +1 -1
- package/dist/cli-context.d.ts +54 -0
- package/dist/cli-context.d.ts.map +1 -0
- package/dist/cli.d.ts +9 -9
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +20 -24
- package/dist/cli.js.map +1 -1
- package/dist/client/browser-dev.d.ts +1 -1
- package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -1
- package/dist/client/browser-entry/hydrate.d.ts +19 -29
- package/dist/client/browser-entry/hydrate.d.ts.map +1 -1
- package/dist/client/browser-entry/index.d.ts +7 -7
- package/dist/client/browser-entry/post-hydration.d.ts +6 -9
- package/dist/client/browser-entry/post-hydration.d.ts.map +1 -1
- package/dist/client/browser-entry/router-init.d.ts +6 -11
- package/dist/client/browser-entry/router-init.d.ts.map +1 -1
- package/dist/client/error-boundary.d.ts +4 -3
- package/dist/client/error-boundary.d.ts.map +1 -1
- package/dist/client/error-boundary.js +1 -1
- package/dist/client/error-reconstituter.d.ts +3 -9
- package/dist/client/error-reconstituter.d.ts.map +1 -1
- package/dist/client/history.d.ts +20 -11
- package/dist/client/history.d.ts.map +1 -1
- package/dist/client/index.d.ts +0 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +5 -6
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.d.ts +3 -3
- package/dist/client/internal.d.ts.map +1 -1
- package/dist/client/internal.js +95 -108
- package/dist/client/internal.js.map +1 -1
- package/dist/client/navigation-commit.d.ts +20 -7
- package/dist/client/navigation-commit.d.ts.map +1 -1
- package/dist/client/navigation-context.d.ts +3 -5
- package/dist/client/navigation-context.d.ts.map +1 -1
- package/dist/client/react-root.d.ts +3 -2
- package/dist/client/react-root.d.ts.map +1 -1
- package/dist/client/router-pipeline.d.ts +3 -8
- package/dist/client/router-pipeline.d.ts.map +1 -1
- package/dist/client/router-types.d.ts +45 -39
- package/dist/client/router-types.d.ts.map +1 -1
- package/dist/client/router-url.d.ts +24 -0
- package/dist/client/router-url.d.ts.map +1 -0
- package/dist/client/router.d.ts.map +1 -1
- package/dist/client/rsc-fetch.d.ts +8 -4
- package/dist/client/rsc-fetch.d.ts.map +1 -1
- package/dist/client/segment-cache.d.ts +44 -4
- package/dist/client/segment-cache.d.ts.map +1 -1
- package/dist/client/ssr-data.d.ts +18 -64
- package/dist/client/ssr-data.d.ts.map +1 -1
- package/dist/client/state.d.ts +2 -5
- package/dist/client/state.d.ts.map +1 -1
- package/dist/client/use-pathname.d.ts +1 -1
- package/dist/config-types.d.ts +2 -1
- package/dist/config-types.d.ts.map +1 -1
- package/dist/config-validation.d.ts.map +1 -1
- package/dist/cookies/index.js +1 -1
- package/dist/dev-tools/dev-page-shell.d.ts +17 -0
- package/dist/dev-tools/dev-page-shell.d.ts.map +1 -1
- package/dist/dev-tools/index.d.ts +1 -1
- package/dist/dev-tools/index.d.ts.map +1 -1
- package/dist/dev-tools/instrumentation.d.ts +17 -2
- package/dist/dev-tools/instrumentation.d.ts.map +1 -1
- package/dist/dev-tools/overlay.d.ts +6 -27
- package/dist/dev-tools/overlay.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +632 -373
- package/dist/index.js.map +1 -1
- package/dist/plugin-context.d.ts +26 -40
- package/dist/plugin-context.d.ts.map +1 -1
- package/dist/plugins/build-manifest.d.ts.map +1 -1
- package/dist/plugins/build-report.d.ts +15 -2
- package/dist/plugins/build-report.d.ts.map +1 -1
- package/dist/plugins/dev-server.d.ts.map +1 -1
- package/dist/plugins/entries.d.ts.map +1 -1
- package/dist/plugins/fonts.d.ts +19 -1
- package/dist/plugins/fonts.d.ts.map +1 -1
- package/dist/plugins/post-build.d.ts +110 -0
- package/dist/plugins/post-build.d.ts.map +1 -0
- package/dist/plugins/prebuilt-capture.d.ts +11 -4
- package/dist/plugins/prebuilt-capture.d.ts.map +1 -1
- package/dist/plugins/prebuilt.d.ts +17 -1
- package/dist/plugins/prebuilt.d.ts.map +1 -1
- package/dist/plugins/prerender-sugar.d.ts.map +1 -1
- package/dist/plugins/react-resolve.d.ts +49 -0
- package/dist/plugins/react-resolve.d.ts.map +1 -0
- package/dist/plugins/rsc-assets-manifest.d.ts +33 -0
- package/dist/plugins/rsc-assets-manifest.d.ts.map +1 -0
- package/dist/plugins/shims.d.ts.map +1 -1
- package/dist/plugins/static-build.d.ts +32 -9
- package/dist/plugins/static-build.d.ts.map +1 -1
- package/dist/routing/codegen-write.d.ts +0 -9
- package/dist/routing/codegen-write.d.ts.map +1 -1
- package/dist/routing/index.js +2 -2
- package/dist/routing/segment-codegen.d.ts.map +1 -1
- package/dist/server/access-gate.d.ts.map +1 -1
- package/dist/server/action-handler.d.ts +5 -4
- package/dist/server/action-handler.d.ts.map +1 -1
- package/dist/server/actions.d.ts +46 -7
- package/dist/server/actions.d.ts.map +1 -1
- package/dist/server/als-registry.d.ts +58 -5
- package/dist/server/als-registry.d.ts.map +1 -1
- package/dist/server/children-interception.d.ts.map +1 -1
- package/dist/server/cookie-context.d.ts +2 -23
- package/dist/server/cookie-context.d.ts.map +1 -1
- package/dist/server/csp-nonce.d.ts +0 -9
- package/dist/server/csp-nonce.d.ts.map +1 -1
- package/dist/server/csrf.d.ts +27 -4
- package/dist/server/csrf.d.ts.map +1 -1
- package/dist/server/debug.d.ts +0 -1
- package/dist/server/debug.d.ts.map +1 -1
- package/dist/server/default-logger.d.ts +2 -1
- package/dist/server/default-logger.d.ts.map +1 -1
- package/dist/server/deny-boundary.d.ts +12 -6
- package/dist/server/deny-boundary.d.ts.map +1 -1
- package/dist/server/deny-renderer.d.ts +2 -2
- package/dist/server/deny-renderer.d.ts.map +1 -1
- package/dist/server/error-boundary-wrapper.d.ts +7 -3
- package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
- package/dist/server/fallback-error.d.ts +9 -2
- package/dist/server/fallback-error.d.ts.map +1 -1
- package/dist/server/head-response.d.ts +4 -4
- package/dist/server/html-injectors.d.ts.map +1 -1
- package/dist/server/index.d.ts +0 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +3 -4
- package/dist/server/index.js.map +1 -1
- package/dist/server/instrumentation.d.ts +10 -3
- package/dist/server/instrumentation.d.ts.map +1 -1
- package/dist/server/internal.d.ts +1 -4
- package/dist/server/internal.d.ts.map +1 -1
- package/dist/server/internal.js +961 -581
- package/dist/server/internal.js.map +1 -1
- package/dist/server/json-status-response.d.ts +34 -0
- package/dist/server/json-status-response.d.ts.map +1 -0
- package/dist/server/logger.d.ts +26 -0
- package/dist/server/logger.d.ts.map +1 -1
- package/dist/server/param-coercion.d.ts +11 -6
- package/dist/server/param-coercion.d.ts.map +1 -1
- package/dist/server/pipeline-helpers.d.ts +95 -7
- package/dist/server/pipeline-helpers.d.ts.map +1 -1
- package/dist/server/pipeline-interception.d.ts +11 -0
- package/dist/server/pipeline-interception.d.ts.map +1 -1
- package/dist/server/pipeline-outcome.d.ts +11 -1
- package/dist/server/pipeline-outcome.d.ts.map +1 -1
- package/dist/server/pipeline-phases.d.ts +2 -2
- package/dist/server/pipeline-phases.d.ts.map +1 -1
- package/dist/server/pipeline.d.ts +23 -35
- package/dist/server/pipeline.d.ts.map +1 -1
- package/dist/server/prebuilt/capture-render.d.ts +25 -0
- package/dist/server/prebuilt/capture-render.d.ts.map +1 -0
- package/dist/server/prebuilt/capture-routes.d.ts +37 -0
- package/dist/server/prebuilt/capture-routes.d.ts.map +1 -0
- package/dist/server/prebuilt/capture-state.d.ts +79 -35
- package/dist/server/prebuilt/capture-state.d.ts.map +1 -1
- package/dist/server/prebuilt/lifetime.d.ts +38 -0
- package/dist/server/prebuilt/lifetime.d.ts.map +1 -0
- package/dist/server/prebuilt/slots.d.ts +7 -0
- package/dist/server/prebuilt/slots.d.ts.map +1 -1
- package/dist/server/prebuilt/synthetic-store.d.ts.map +1 -1
- package/dist/server/prebuilt-builder.d.ts.map +1 -1
- package/dist/server/prebuilt-runtime.d.ts.map +1 -1
- package/dist/server/primitives.d.ts +6 -81
- package/dist/server/primitives.d.ts.map +1 -1
- package/dist/server/react-cache-bridge.d.ts +59 -0
- package/dist/server/react-cache-bridge.d.ts.map +1 -0
- package/dist/server/react-cache-scope.d.ts +49 -0
- package/dist/server/react-cache-scope.d.ts.map +1 -0
- package/dist/server/render-timeout.d.ts +15 -0
- package/dist/server/render-timeout.d.ts.map +1 -1
- package/dist/server/render-utils.d.ts +9 -0
- package/dist/server/render-utils.d.ts.map +1 -1
- package/dist/server/request-context.d.ts +26 -5
- package/dist/server/request-context.d.ts.map +1 -1
- 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 +7 -0
- package/dist/server/route-matcher.d.ts.map +1 -1
- package/dist/server/rsc-entry/action-middleware-runner.d.ts +22 -22
- package/dist/server/rsc-entry/action-middleware-runner.d.ts.map +1 -1
- package/dist/server/rsc-entry/api-handler.d.ts +7 -0
- package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
- package/dist/server/rsc-entry/deny-fallback.d.ts +32 -6
- package/dist/server/rsc-entry/deny-fallback.d.ts.map +1 -1
- package/dist/server/rsc-entry/error-renderer.d.ts +11 -18
- package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/helpers.d.ts +0 -1
- package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
- package/dist/server/rsc-entry/index.d.ts +5 -15
- package/dist/server/rsc-entry/index.d.ts.map +1 -1
- package/dist/server/rsc-entry/render-route.d.ts +5 -6
- package/dist/server/rsc-entry/render-route.d.ts.map +1 -1
- package/dist/server/rsc-entry/render-signals.d.ts +65 -0
- package/dist/server/rsc-entry/render-signals.d.ts.map +1 -0
- package/dist/server/rsc-entry/revalidate-renderer.d.ts +6 -16
- package/dist/server/rsc-entry/revalidate-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-payload.d.ts +7 -3
- package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
- package/dist/server/rsc-entry/rsc-stream.d.ts +8 -53
- package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-bridge.d.ts +2 -2
- package/dist/server/rsc-entry/ssr-bridge.d.ts.map +1 -1
- package/dist/server/rsc-entry/ssr-renderer.d.ts +9 -4
- package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
- package/dist/server/rsc-entry/wrap-action-dispatch.d.ts +1 -1
- package/dist/server/rsc-entry/wrap-action-dispatch.d.ts.map +1 -1
- package/dist/server/signal-identity.d.ts +43 -0
- package/dist/server/signal-identity.d.ts.map +1 -0
- package/dist/server/slot-resolver.d.ts +4 -3
- package/dist/server/slot-resolver.d.ts.map +1 -1
- package/dist/server/slot-subtree-contain.d.ts.map +1 -1
- package/dist/server/ssr-bridge-types.d.ts +91 -53
- package/dist/server/ssr-bridge-types.d.ts.map +1 -1
- package/dist/server/ssr-entry.d.ts +8 -5
- package/dist/server/ssr-entry.d.ts.map +1 -1
- package/dist/server/ssr-render.d.ts +26 -40
- package/dist/server/ssr-render.d.ts.map +1 -1
- package/dist/server/ssr-wrappers.d.ts +1 -1
- package/dist/server/static-generator.d.ts.map +1 -1
- package/dist/server/stream-utils.d.ts +12 -0
- package/dist/server/stream-utils.d.ts.map +1 -1
- package/dist/server/tracing.d.ts +12 -16
- package/dist/server/tracing.d.ts.map +1 -1
- package/dist/server/types.d.ts +1 -1
- package/dist/server/version-skew.d.ts +3 -3
- package/dist/shared/csrf-reject.d.ts +16 -0
- package/dist/shared/csrf-reject.d.ts.map +1 -0
- package/dist/shared/error-digest.d.ts +28 -0
- package/dist/shared/error-digest.d.ts.map +1 -0
- package/dist/shared/payload-root.d.ts +11 -10
- package/dist/shared/payload-root.d.ts.map +1 -1
- package/dist/shared/rsc-payload-path.d.ts +6 -0
- package/dist/shared/rsc-payload-path.d.ts.map +1 -1
- package/dist/utils/write-file-atomic.d.ts +17 -0
- package/dist/utils/write-file-atomic.d.ts.map +1 -0
- package/docs/api/30-api-server.mdx +17 -14
- package/docs/api/32-api-cache.mdx +51 -23
- package/docs/api/34-api-config.mdx +34 -6
- package/docs/api/36-cli.mdx +11 -1
- package/docs/learn/03-fetching-data.mdx +17 -1
- package/docs/learn/04-access-control.mdx +1 -1
- package/docs/learn/10-caching.mdx +29 -11
- package/docs/learn/11-middleware.mdx +8 -2
- package/docs/learn/12-error-handling.mdx +6 -1
- package/package.json +7 -3
- package/src/adapters/build-output-helper.ts +55 -53
- package/src/adapters/canonicalize-module.ts +29 -0
- package/src/adapters/cloudflare.ts +105 -63
- package/src/adapters/compress-module.ts +16 -5
- package/src/adapters/fs-identity.ts +2 -3
- package/src/adapters/nitro-presets.ts +0 -15
- package/src/adapters/nitro-preview.ts +272 -136
- package/src/adapters/nitro.ts +119 -82
- package/src/adapters/shared.ts +23 -14
- package/src/adapters/types.ts +110 -21
- package/src/analyze/graph-cache.ts +3 -4
- package/src/cache/json-lossy-check.ts +3 -9
- package/src/cache/singleflight.ts +5 -2
- package/src/cache/sizeof.ts +3 -1
- package/src/cache/tag-aware-handler.ts +43 -26
- package/src/cli-check.ts +8 -98
- package/src/cli-context.ts +119 -0
- package/src/cli.ts +19 -28
- package/src/client/browser-dev.ts +1 -1
- package/src/client/browser-entry/action-dispatch.ts +26 -4
- package/src/client/browser-entry/hydrate.ts +53 -58
- package/src/client/browser-entry/index.ts +16 -27
- package/src/client/browser-entry/post-hydration.ts +6 -40
- package/src/client/browser-entry/router-init.ts +66 -84
- package/src/client/error-boundary.tsx +9 -41
- package/src/client/error-reconstituter.tsx +10 -5
- package/src/client/history.ts +35 -21
- package/src/client/index.ts +0 -1
- package/src/client/internal.ts +2 -7
- package/src/client/navigation-commit.ts +41 -18
- package/src/client/navigation-context.ts +3 -39
- package/src/client/react-root.ts +3 -2
- package/src/client/router-pipeline.ts +96 -132
- package/src/client/router-types.ts +46 -44
- package/src/client/router-url.ts +32 -0
- package/src/client/router.ts +62 -21
- package/src/client/rsc-fetch.ts +117 -155
- package/src/client/segment-cache.ts +110 -11
- package/src/client/ssr-data.ts +19 -80
- package/src/client/state.ts +2 -9
- package/src/client/use-pathname.ts +1 -1
- package/src/config-types.ts +2 -1
- package/src/config-validation.ts +2 -1
- package/src/dev-tools/dev-page-shell.ts +18 -0
- package/src/dev-tools/index.ts +0 -2
- package/src/dev-tools/instrumentation.ts +50 -2
- package/src/dev-tools/overlay.ts +8 -238
- package/src/index.ts +26 -14
- package/src/plugin-context.ts +39 -40
- package/src/plugins/build-manifest.ts +4 -11
- package/src/plugins/build-report.ts +70 -70
- package/src/plugins/dev-server.ts +24 -44
- package/src/plugins/entries.ts +2 -1
- package/src/plugins/fonts.ts +35 -7
- package/src/plugins/post-build.ts +327 -0
- package/src/plugins/prebuilt-capture.ts +28 -32
- package/src/plugins/prebuilt.ts +54 -39
- package/src/plugins/prerender-sugar.ts +0 -4
- package/src/plugins/react-resolve.ts +149 -0
- package/src/plugins/{adapter-build.ts → rsc-assets-manifest.ts} +20 -109
- package/src/plugins/shims.ts +1 -0
- package/src/plugins/static-build.ts +42 -74
- package/src/routing/codegen-write.ts +25 -3
- package/src/routing/segment-codegen.ts +3 -2
- package/src/rsc-runtime/vendor-types.d.ts +8 -0
- package/src/server/access-gate.tsx +2 -1
- package/src/server/action-client.ts +1 -1
- package/src/server/action-handler.ts +253 -110
- package/src/server/actions.ts +73 -25
- package/src/server/als-registry.ts +73 -5
- package/src/server/chain-url-parts.ts +1 -1
- package/src/server/children-interception.ts +2 -1
- package/src/server/cookie-context.ts +18 -48
- package/src/server/csp-nonce.ts +0 -12
- package/src/server/csrf.ts +140 -8
- package/src/server/debug.ts +0 -1
- package/src/server/default-logger.ts +2 -1
- package/src/server/deny-boundary.ts +25 -13
- package/src/server/deny-renderer.ts +30 -97
- package/src/server/error-boundary-wrapper.ts +7 -3
- package/src/server/fallback-error.ts +26 -11
- package/src/server/flight-scripts.ts +1 -1
- package/src/server/head-response.ts +4 -4
- package/src/server/html-injector-core.ts +2 -2
- package/src/server/html-injectors.ts +2 -4
- package/src/server/index.ts +0 -4
- package/src/server/instrumentation.ts +10 -3
- package/src/server/internal.ts +1 -6
- package/src/server/json-status-response.ts +105 -0
- package/src/server/logger.ts +39 -3
- package/src/server/param-coercion.ts +15 -12
- package/src/server/pipeline-helpers.ts +257 -12
- package/src/server/pipeline-interception.ts +133 -0
- package/src/server/pipeline-outcome.ts +103 -31
- package/src/server/pipeline-phases.ts +127 -237
- package/src/server/pipeline.ts +204 -207
- package/src/server/prebuilt/capture-render.ts +118 -0
- package/src/server/prebuilt/capture-routes.ts +104 -0
- package/src/server/prebuilt/capture-state.ts +155 -48
- package/src/server/prebuilt/lifetime.ts +151 -0
- package/src/server/prebuilt/slots.ts +14 -2
- package/src/server/prebuilt/synthetic-store.ts +3 -0
- package/src/server/prebuilt-builder.ts +30 -320
- package/src/server/prebuilt-runtime.ts +125 -129
- package/src/server/primitives.ts +8 -168
- package/src/server/react-cache-bridge.ts +124 -0
- package/src/server/react-cache-scope.ts +104 -0
- package/src/server/render-timeout.ts +20 -0
- package/src/server/render-utils.ts +11 -1
- package/src/server/request-context.ts +36 -9
- package/src/server/route-element-builder.ts +11 -6
- package/src/server/route-handler.ts +36 -23
- package/src/server/route-matcher.ts +15 -1
- package/src/server/rsc-entry/action-middleware-runner.ts +79 -123
- package/src/server/rsc-entry/api-handler.ts +27 -103
- package/src/server/rsc-entry/deny-fallback.ts +93 -26
- package/src/server/rsc-entry/error-renderer.ts +39 -91
- package/src/server/rsc-entry/helpers.ts +2 -4
- package/src/server/rsc-entry/index.ts +64 -58
- package/src/server/rsc-entry/render-route.ts +15 -80
- package/src/server/rsc-entry/render-signals.ts +108 -0
- package/src/server/rsc-entry/revalidate-renderer.ts +56 -57
- package/src/server/rsc-entry/rsc-payload.ts +28 -61
- package/src/server/rsc-entry/rsc-stream.ts +113 -213
- package/src/server/rsc-entry/ssr-bridge.ts +2 -2
- package/src/server/rsc-entry/ssr-renderer.ts +182 -263
- package/src/server/rsc-entry/wrap-action-dispatch.ts +12 -14
- package/src/server/signal-identity.ts +112 -0
- package/src/server/slot-resolver.ts +18 -18
- package/src/server/slot-subtree-contain.ts +2 -1
- package/src/server/ssr-bridge-types.ts +92 -56
- package/src/server/ssr-entry.ts +87 -111
- package/src/server/ssr-render.ts +55 -64
- package/src/server/ssr-wrappers.tsx +2 -2
- package/src/server/static-generator.ts +7 -42
- package/src/server/static-not-found.ts +3 -3
- package/src/server/stream-utils.ts +51 -0
- package/src/server/tracing.ts +58 -75
- package/src/server/types.ts +1 -1
- package/src/server/version-skew.ts +5 -5
- package/src/shared/csrf-reject.ts +15 -0
- package/src/shared/error-digest.ts +46 -0
- package/src/shared/payload-root.ts +11 -10
- package/src/shared/rsc-payload-path.ts +8 -1
- package/src/utils/write-file-atomic.ts +32 -0
- package/dist/_chunks/actions-jNrXdzgs.js +0 -346
- package/dist/_chunks/actions-jNrXdzgs.js.map +0 -1
- package/dist/_chunks/als-registry-C6kcfprT.js.map +0 -1
- package/dist/_chunks/build-manifest-DTmSGLRz.js.map +0 -1
- package/dist/_chunks/build-output-helper-9dqCv1pZ.js.map +0 -1
- package/dist/_chunks/cache-api-CUD9Ezaq.js.map +0 -1
- package/dist/_chunks/cli-check-G8o30ldg.js.map +0 -1
- package/dist/_chunks/convention-lint-5KzoMg_A.js.map +0 -1
- package/dist/_chunks/dev-server-BzBxgYAV.js.map +0 -1
- package/dist/_chunks/error-boundary-BndF-3Td.js.map +0 -1
- package/dist/_chunks/fs-identity-D7vb6GdI.js.map +0 -1
- package/dist/_chunks/graph-cache-CP4GEmf9.js.map +0 -1
- package/dist/_chunks/json-lossy-check-ClNvBM_3.js.map +0 -1
- package/dist/_chunks/logger-k2DQ4EUf.js.map +0 -1
- package/dist/_chunks/navigation-context-D0TU0Jog.js.map +0 -1
- package/dist/_chunks/plugin-context-8idfR3UZ.js.map +0 -1
- package/dist/_chunks/primitives-DLAnvsrk.js.map +0 -1
- package/dist/_chunks/segment-context-D9_89u34.js +0 -34
- package/dist/_chunks/segment-context-D9_89u34.js.map +0 -1
- package/dist/_chunks/sizeof-lXffQ1Vr.js.map +0 -1
- package/dist/_chunks/ssr-data-D6T6Y3ef.js +0 -60
- package/dist/_chunks/ssr-data-D6T6Y3ef.js.map +0 -1
- package/dist/_chunks/state-FippDgxN.js.map +0 -1
- package/dist/_chunks/status-page-marker-DwQBrLBz.js.map +0 -1
- package/dist/client/types.d.ts +0 -14
- package/dist/client/types.d.ts.map +0 -1
- package/dist/plugins/adapter-build.d.ts +0 -38
- package/dist/plugins/adapter-build.d.ts.map +0 -1
- package/dist/server/asset-headers.d.ts +0 -32
- package/dist/server/asset-headers.d.ts.map +0 -1
- package/dist/server/dev-source-map.d.ts +0 -22
- package/dist/server/dev-source-map.d.ts.map +0 -1
- package/src/client/types.ts +0 -21
- package/src/server/asset-headers.ts +0 -59
- package/src/server/dev-source-map.ts +0 -31
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* timber-post-build — the post-build phase, as one ordered handler.
|
|
3
|
+
*
|
|
4
|
+
* Everything timber does after Vite has built the three environments runs
|
|
5
|
+
* here, in this order, each step handed what the previous one returned:
|
|
6
|
+
*
|
|
7
|
+
* 1. finalize the build manifest — font entries, the RSC assets manifest
|
|
8
|
+
* merged in once, JavaScript stripped once when client JS is disabled
|
|
9
|
+
* 2. prebuilt capture (cache.component prerender payloads, design/44)
|
|
10
|
+
* 3. static generation (output: 'static', design/11)
|
|
11
|
+
* 4. the build report
|
|
12
|
+
* 5. assemble `BuildArtifacts` and call the adapter's `buildOutput`
|
|
13
|
+
*
|
|
14
|
+
* One `buildApp` hook with `order: 'post'` — so Vite runs the RSC plugin's
|
|
15
|
+
* buildApp, which orchestrates every environment build and writes the
|
|
16
|
+
* assets manifests, first. The order above is this function's, not the
|
|
17
|
+
* plugin array's, and no step reads another's result off the shared
|
|
18
|
+
* context: sibling plugins contribute through the typed steps they expose
|
|
19
|
+
* (`FontsBuildStep`, `PrebuiltBuildStep`, `BuildReportStep`), which
|
|
20
|
+
* `timber()` hands to this plugin directly.
|
|
21
|
+
*
|
|
22
|
+
* Design docs: 18-build-system.md §"Post-Build Phase", 11-platform.md
|
|
23
|
+
* §"Build Artifacts", 49-explicit-subsystem-boundaries.md §B
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import type { Plugin, Rollup } from 'vite';
|
|
27
|
+
import { readdir } from 'node:fs/promises';
|
|
28
|
+
import { join, relative, resolve } from 'node:path';
|
|
29
|
+
import { adapterConfig, contextAdapter, type PluginContext } from '../plugin-context.ts';
|
|
30
|
+
import type { BuildArtifacts, DirectoryArtifact } from '../adapters/types.ts';
|
|
31
|
+
import type { BuildManifest } from '../server/build-manifest.ts';
|
|
32
|
+
import type { FontsBuildStep } from './fonts.ts';
|
|
33
|
+
import type { PrebuiltBuildStep } from './prebuilt.ts';
|
|
34
|
+
import type { BuildReportStep } from './build-report.ts';
|
|
35
|
+
import { runStaticGeneration, type StaticSite } from './static-build.ts';
|
|
36
|
+
import { mergeRscAssetsManifest, stripJsFromRscAssetsManifests } from './rsc-assets-manifest.ts';
|
|
37
|
+
|
|
38
|
+
/** The Vite environments whose output adapters consume. */
|
|
39
|
+
const ARTIFACT_ENVIRONMENTS = ['client', 'rsc', 'ssr'] as const;
|
|
40
|
+
type ArtifactEnvironment = (typeof ARTIFACT_ENVIRONMENTS)[number];
|
|
41
|
+
|
|
42
|
+
function isArtifactEnvironment(name: string): name is ArtifactEnvironment {
|
|
43
|
+
return (ARTIFACT_ENVIRONMENTS as readonly string[]).includes(name);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Each environment's output directory, as its own `writeBundle` recorded it. */
|
|
47
|
+
export type EnvironmentOutputs = Partial<Record<ArtifactEnvironment, DirectoryArtifact>>;
|
|
48
|
+
|
|
49
|
+
/** The steps sibling plugins own. */
|
|
50
|
+
export interface PostBuildSteps {
|
|
51
|
+
fonts: FontsBuildStep;
|
|
52
|
+
prebuilt: PrebuiltBuildStep;
|
|
53
|
+
report: BuildReportStep;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function timberPostBuild(ctx: PluginContext, steps: PostBuildSteps): Plugin {
|
|
57
|
+
const environments: EnvironmentOutputs = {};
|
|
58
|
+
/** What the client environment's bundle wrote, from its `writeBundle`. */
|
|
59
|
+
let clientOutput: ClientOutput = { assetsDir: '', emitted: new Set() };
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
name: 'timber-post-build',
|
|
63
|
+
|
|
64
|
+
// Record each environment's output directory as it is written, so the
|
|
65
|
+
// phase learns what exists from the build rather than by probing for
|
|
66
|
+
// it. The RSC plugin's scan builds run with `write: false` and never
|
|
67
|
+
// reach this hook; only the real bundles do.
|
|
68
|
+
writeBundle(options, bundle) {
|
|
69
|
+
if (ctx.dev) return;
|
|
70
|
+
const env = this.environment;
|
|
71
|
+
if (!isArtifactEnvironment(env.name)) return;
|
|
72
|
+
environments[env.name] = { path: resolve(env.config.root, env.config.build.outDir) };
|
|
73
|
+
if (env.name === 'client') {
|
|
74
|
+
clientOutput = {
|
|
75
|
+
assetsDir: hashedAssetsDir(env.config.build.assetsDir, options),
|
|
76
|
+
emitted: new Set(Object.keys(bundle)),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
buildApp: {
|
|
82
|
+
order: 'post' as const,
|
|
83
|
+
async handler() {
|
|
84
|
+
if (ctx.dev) return;
|
|
85
|
+
await runPostBuild(ctx, steps, environments, clientOutput);
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The client bundle's assets directory, in the artifacts' form (no leading
|
|
93
|
+
* or trailing slash) — or `''` when its files are not all content-hashed.
|
|
94
|
+
*
|
|
95
|
+
* `assetsDir` names where Vite writes; it is the naming patterns that decide
|
|
96
|
+
* whether a file name carries a hash. Vite's defaults do
|
|
97
|
+
* (`<assetsDir>/[name]-[hash].js`), but an app can set
|
|
98
|
+
* `assetFileNames: 'static/[name][extname]'`, and marking that directory
|
|
99
|
+
* immutable would pin a changed image under an unchanged URL for a year. A
|
|
100
|
+
* pattern given as a function cannot be inspected, so it counts as unhashed:
|
|
101
|
+
* those files fall back to the revalidating per-file rule.
|
|
102
|
+
*
|
|
103
|
+
* @internal Exported for testing.
|
|
104
|
+
*/
|
|
105
|
+
export function hashedAssetsDir(
|
|
106
|
+
assetsDir: string,
|
|
107
|
+
output: Pick<
|
|
108
|
+
Rollup.NormalizedOutputOptions,
|
|
109
|
+
'entryFileNames' | 'chunkFileNames' | 'assetFileNames'
|
|
110
|
+
>
|
|
111
|
+
): string {
|
|
112
|
+
const dir = assetsDir.replace(/^\/+|\/+$/g, '');
|
|
113
|
+
const patterns = [output.entryFileNames, output.chunkFileNames, output.assetFileNames];
|
|
114
|
+
const hashed = patterns.every((p) => typeof p === 'string' && p.includes('[hash'));
|
|
115
|
+
return hashed ? dir : '';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** The client bundle as its own `writeBundle` saw it. */
|
|
119
|
+
interface ClientOutput {
|
|
120
|
+
/** From `hashedAssetsDir` — `''` when the naming patterns are not all hashed. */
|
|
121
|
+
assetsDir: string;
|
|
122
|
+
/** Every file name the bundle emitted, relative to the client output directory. */
|
|
123
|
+
emitted: ReadonlySet<string>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Keep only the directories whose every file the client bundle emitted.
|
|
128
|
+
*
|
|
129
|
+
* A producer knows it hashes what *it* writes, not what else lands beside it:
|
|
130
|
+
* Vite copies `public/` into the client output verbatim, so `public/assets/logo.png`
|
|
131
|
+
* sits in `assets/` under a stable name, and `public/_rsc/…` would sit among
|
|
132
|
+
* the hashed payloads. A directory holding any file the bundle did not emit
|
|
133
|
+
* is not content-hashed as a whole, and marking it immutable would pin that
|
|
134
|
+
* file for a year — so it is dropped, and its files take the per-file rule.
|
|
135
|
+
*
|
|
136
|
+
* @internal Exported for testing.
|
|
137
|
+
*/
|
|
138
|
+
export async function onlyEmittedDirs(
|
|
139
|
+
clientDir: string,
|
|
140
|
+
dirs: readonly string[],
|
|
141
|
+
emitted: ReadonlySet<string>
|
|
142
|
+
): Promise<string[]> {
|
|
143
|
+
const kept: string[] = [];
|
|
144
|
+
for (const dir of dirs) {
|
|
145
|
+
const root = join(clientDir, dir);
|
|
146
|
+
const entries = await readdir(root, { recursive: true, withFileTypes: true }).catch(() => []);
|
|
147
|
+
const foreign = entries.some(
|
|
148
|
+
(entry) =>
|
|
149
|
+
entry.isFile() &&
|
|
150
|
+
!emitted.has(relative(clientDir, join(entry.parentPath, entry.name)).replace(/\\/g, '/'))
|
|
151
|
+
);
|
|
152
|
+
if (!foreign) kept.push(dir);
|
|
153
|
+
}
|
|
154
|
+
return kept;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
async function runPostBuild(
|
|
158
|
+
ctx: PluginContext,
|
|
159
|
+
steps: PostBuildSteps,
|
|
160
|
+
environments: EnvironmentOutputs,
|
|
161
|
+
clientOutput: ClientOutput
|
|
162
|
+
): Promise<void> {
|
|
163
|
+
const output = ctx.config.output ?? 'server';
|
|
164
|
+
const rsc = requireEnvironment(environments, 'rsc');
|
|
165
|
+
const ssr = requireEnvironment(environments, 'ssr');
|
|
166
|
+
|
|
167
|
+
// 1. The manifest is complete before anything renders with it. Published
|
|
168
|
+
// for the steps that import the built bundle in this process — the same
|
|
169
|
+
// value `manifestInit` carries to production. Assigned, never `??=`: a
|
|
170
|
+
// second build in one process must not render with the first one's.
|
|
171
|
+
const manifest = await finalizeBuildManifest(ctx, steps.fonts, rsc, ssr);
|
|
172
|
+
if (manifest) Reflect.set(globalThis, '__TIMBER_BUILD_MANIFEST__', manifest);
|
|
173
|
+
|
|
174
|
+
// 2–3. Each writes its own output and returns what it wrote.
|
|
175
|
+
const prebuilt = await steps.prebuilt.capture(rsc.path);
|
|
176
|
+
const site = output === 'static' ? await runStaticGeneration(ctx, rsc.path) : undefined;
|
|
177
|
+
|
|
178
|
+
// 4.
|
|
179
|
+
steps.report.print(prebuilt);
|
|
180
|
+
|
|
181
|
+
// 5.
|
|
182
|
+
const adapter = contextAdapter(ctx);
|
|
183
|
+
if (!adapter || typeof adapter.buildOutput !== 'function') return;
|
|
184
|
+
|
|
185
|
+
await adapter.buildOutput(
|
|
186
|
+
adapterConfig(ctx),
|
|
187
|
+
assembleBuildArtifacts({
|
|
188
|
+
output,
|
|
189
|
+
outputDir: ctx.buildDir,
|
|
190
|
+
environments,
|
|
191
|
+
immutableDirs: await onlyEmittedDirs(
|
|
192
|
+
requireEnvironment(environments, 'client').path,
|
|
193
|
+
[
|
|
194
|
+
...(clientOutput.assetsDir ? [clientOutput.assetsDir] : []),
|
|
195
|
+
...steps.fonts.immutableDirs(),
|
|
196
|
+
...(site?.immutableDirs ?? []),
|
|
197
|
+
],
|
|
198
|
+
clientOutput.emitted
|
|
199
|
+
),
|
|
200
|
+
prebuilt: prebuilt?.artifact,
|
|
201
|
+
site,
|
|
202
|
+
manifestInit: manifest ? serializeManifestInit(manifest) : undefined,
|
|
203
|
+
})
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function requireEnvironment(
|
|
208
|
+
environments: EnvironmentOutputs,
|
|
209
|
+
name: ArtifactEnvironment
|
|
210
|
+
): DirectoryArtifact {
|
|
211
|
+
const artifact = environments[name];
|
|
212
|
+
if (!artifact) {
|
|
213
|
+
throw new Error(`[timber] Build output: the ${name} environment wrote no bundle`);
|
|
214
|
+
}
|
|
215
|
+
return artifact;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Step 1: bring the build manifest to its final shape, once.
|
|
220
|
+
*
|
|
221
|
+
* `timber-build-manifest` creates it from the client bundle; this adds what
|
|
222
|
+
* only exists once every environment is built — the font entries and the
|
|
223
|
+
* per-route CSS and modulepreloads in the RSC plugin's assets manifest —
|
|
224
|
+
* and then, when client JavaScript is disabled, removes every JavaScript
|
|
225
|
+
* reference, from the manifest and from the assets manifests on disk. The
|
|
226
|
+
* manifest's `js` / `modulepreload` are cleared after the merge has written
|
|
227
|
+
* into them, so nothing the merge adds survives.
|
|
228
|
+
*
|
|
229
|
+
* Returns null only when no client bundle produced a manifest.
|
|
230
|
+
*
|
|
231
|
+
* @internal Exported for testing.
|
|
232
|
+
*/
|
|
233
|
+
export async function finalizeBuildManifest(
|
|
234
|
+
ctx: PluginContext,
|
|
235
|
+
fonts: FontsBuildStep,
|
|
236
|
+
rsc: DirectoryArtifact,
|
|
237
|
+
ssr: DirectoryArtifact
|
|
238
|
+
): Promise<BuildManifest | null> {
|
|
239
|
+
const manifest = ctx.buildManifest;
|
|
240
|
+
if (manifest) {
|
|
241
|
+
fonts.contributeManifest(manifest);
|
|
242
|
+
// Per-route CSS and client reference JS, for <link rel="stylesheet">
|
|
243
|
+
// and <link rel="modulepreload"> on server component routes (TIM-1014).
|
|
244
|
+
await mergeRscAssetsManifest(rsc.path, ctx.root, manifest, ctx.routeClientRefKeys);
|
|
245
|
+
}
|
|
246
|
+
if (ctx.clientJavascript.disabled) {
|
|
247
|
+
// Those files are not served, so hints for them are useless.
|
|
248
|
+
if (manifest) {
|
|
249
|
+
manifest.js = {};
|
|
250
|
+
manifest.modulepreload = {};
|
|
251
|
+
}
|
|
252
|
+
await stripJsFromRscAssetsManifests([rsc.path, ssr.path]);
|
|
253
|
+
}
|
|
254
|
+
return manifest;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* The build manifest as a JS module that sets the global. Adapters write
|
|
259
|
+
* it as `_timber-manifest-init.js` (or prepend it to the entry) and
|
|
260
|
+
* evaluate it before the RSC handler, so `virtual:timber-build-manifest`
|
|
261
|
+
* finds it.
|
|
262
|
+
*/
|
|
263
|
+
function serializeManifestInit(manifest: BuildManifest): string {
|
|
264
|
+
return `globalThis.__TIMBER_BUILD_MANIFEST__ = ${JSON.stringify(manifest)};\n`;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Dedupe the producers' directories and drop any that sits inside another.
|
|
269
|
+
*
|
|
270
|
+
* Two producers can name overlapping directories — a custom `assetsDir` of
|
|
271
|
+
* `_timber` beside the fonts' `_timber/fonts`. Cloudflare and Netlify apply
|
|
272
|
+
* every matching `_headers` rule, so emitting both would send two
|
|
273
|
+
* `Cache-Control` values for one file; the outer directory already covers
|
|
274
|
+
* the inner one.
|
|
275
|
+
*/
|
|
276
|
+
function canonicalImmutableDirs(dirs: readonly string[]): string[] {
|
|
277
|
+
const unique = [...new Set(dirs)];
|
|
278
|
+
return unique.filter(
|
|
279
|
+
(dir) => !unique.some((other) => other !== dir && dir.startsWith(`${other}/`))
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Assemble the adapter's view of the build from what each step returned.
|
|
285
|
+
*
|
|
286
|
+
* Not a validator: every field is copied from the phase that produced it.
|
|
287
|
+
* The throws are the states the union cannot represent — a Vite environment
|
|
288
|
+
* that wrote no bundle, a static build with no site. Each means an earlier
|
|
289
|
+
* phase failed without failing the build, and a deploy missing its SSR
|
|
290
|
+
* bundle fails on the first request rather than here.
|
|
291
|
+
*
|
|
292
|
+
* @internal Exported for testing.
|
|
293
|
+
*/
|
|
294
|
+
export function assembleBuildArtifacts(input: {
|
|
295
|
+
output: 'server' | 'static';
|
|
296
|
+
outputDir: string;
|
|
297
|
+
environments: EnvironmentOutputs;
|
|
298
|
+
immutableDirs: readonly string[];
|
|
299
|
+
prebuilt?: DirectoryArtifact;
|
|
300
|
+
site?: StaticSite;
|
|
301
|
+
manifestInit?: string;
|
|
302
|
+
}): BuildArtifacts {
|
|
303
|
+
const { output, outputDir, environments } = input;
|
|
304
|
+
const client = requireEnvironment(environments, 'client');
|
|
305
|
+
const immutableDirs = canonicalImmutableDirs(input.immutableDirs);
|
|
306
|
+
|
|
307
|
+
if (output === 'static') {
|
|
308
|
+
if (!input.site) {
|
|
309
|
+
throw new Error(
|
|
310
|
+
"[timber] Build output: output is 'static' but static generation recorded no site"
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
const { pages, contentTypes } = input.site;
|
|
314
|
+
return { output, outputDir, client, immutableDirs, pages, contentTypes };
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
return {
|
|
318
|
+
output,
|
|
319
|
+
outputDir,
|
|
320
|
+
client,
|
|
321
|
+
immutableDirs,
|
|
322
|
+
rsc: requireEnvironment(environments, 'rsc'),
|
|
323
|
+
ssr: requireEnvironment(environments, 'ssr'),
|
|
324
|
+
prebuilt: input.prebuilt,
|
|
325
|
+
manifestInit: input.manifestInit,
|
|
326
|
+
};
|
|
327
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Post-build prebuilt capture — Node-side orchestration (TIM-1119).
|
|
3
3
|
*
|
|
4
|
-
* Runs
|
|
5
|
-
* build sequence. Imports the BUILT `rsc/index.js` (the bundle carries
|
|
4
|
+
* Runs as the capture step of the post-build phase (plugins/post-build.ts),
|
|
5
|
+
* after Vite's 5-step build sequence and the manifest finalization step. Imports the BUILT `rsc/index.js` (the bundle carries
|
|
6
6
|
* the react-server condition resolved at build time, so a plain dynamic
|
|
7
7
|
* import works) and calls its `__timber_capturePrebuilt` export — the
|
|
8
8
|
* capture itself must run inside the bundle's module graph, where the
|
|
@@ -25,11 +25,12 @@
|
|
|
25
25
|
* prebuilt components.
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
-
import {
|
|
29
|
-
import { mkdir, rename, rm, writeFile } from 'node:fs/promises';
|
|
28
|
+
import { mkdir, rm } from 'node:fs/promises';
|
|
30
29
|
import { dirname, join } from 'node:path';
|
|
31
30
|
import { pathToFileURL } from 'node:url';
|
|
31
|
+
import { writeFileAtomic } from '../utils/write-file-atomic.ts';
|
|
32
32
|
|
|
33
|
+
import type { DirectoryArtifact } from '../adapters/types.ts';
|
|
33
34
|
import type { PluginContext } from '../plugin-context.ts';
|
|
34
35
|
import type { CaptureOptions, CaptureSummary, CapturedEntry } from '../server/prebuilt-builder.ts';
|
|
35
36
|
import type { PrebuiltManifest } from '../server/prebuilt/payload-source.ts';
|
|
@@ -50,13 +51,6 @@ export interface PrebuiltArtifactWriter {
|
|
|
50
51
|
finalize(): Promise<number>;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
/** Write a file atomically: temp sibling + rename. */
|
|
54
|
-
async function writeFileAtomic(path: string, data: Uint8Array | string): Promise<void> {
|
|
55
|
-
const tmp = `${path}.tmp`;
|
|
56
|
-
await writeFile(tmp, data);
|
|
57
|
-
await rename(tmp, path);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
54
|
/**
|
|
61
55
|
* Create the writer for `.timber/dist/prebuilt/`. Storage layout per
|
|
62
56
|
* design/44 §Storage: one directory per component ID, one `.flight` file
|
|
@@ -105,13 +99,20 @@ export function createPrebuiltArtifactWriter(prebuiltDir: string): PrebuiltArtif
|
|
|
105
99
|
};
|
|
106
100
|
}
|
|
107
101
|
|
|
102
|
+
/** What a capture pass produced. */
|
|
103
|
+
export interface PrebuiltCaptureResult {
|
|
104
|
+
summary: CaptureSummary;
|
|
105
|
+
/** The payload directory — present only when the pass wrote a payload. */
|
|
106
|
+
artifact?: DirectoryArtifact;
|
|
107
|
+
}
|
|
108
|
+
|
|
108
109
|
/**
|
|
109
110
|
* Remove any `prebuilt/` output left by a previous build in this
|
|
110
111
|
* directory (watch mode, `emptyOutDir: false`). A stale manifest would
|
|
111
112
|
* make adapters ship payloads from an OLD build — reviving them serves
|
|
112
113
|
* outdated content with that build's chunk references instead of the
|
|
113
114
|
* intended miss → live render. Runs unconditionally at the start of the
|
|
114
|
-
*
|
|
115
|
+
* capture step, BEFORE the capture decision: a build whose app no
|
|
115
116
|
* longer declares any prebuilt components must also shed the artifacts
|
|
116
117
|
* (codex P2 on PR #836).
|
|
117
118
|
*/
|
|
@@ -133,28 +134,19 @@ interface CaptureModule {
|
|
|
133
134
|
* component). Per-entry data errors skip-and-report per design/44
|
|
134
135
|
* §Build-Phase Error Handling.
|
|
135
136
|
*/
|
|
136
|
-
export async function runPrebuiltCapture(
|
|
137
|
+
export async function runPrebuiltCapture(
|
|
138
|
+
ctx: PluginContext,
|
|
139
|
+
rscDir: string
|
|
140
|
+
): Promise<PrebuiltCaptureResult> {
|
|
137
141
|
const routeComponents = ctx.routePrebuiltComponents;
|
|
138
142
|
if (!routeComponents || routeComponents.size === 0) {
|
|
139
|
-
return { captured: 0, skipped: [], hardErrors: [], nestingWarnings: 0 };
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const entryPath = join(ctx.buildDir, 'rsc', 'index.js');
|
|
143
|
-
if (!existsSync(entryPath)) {
|
|
144
|
-
throw new Error(
|
|
145
|
-
`[timber] prebuilt capture: built RSC entry not found at ${entryPath} — ` +
|
|
146
|
-
`the app declares cache.component({ prerender: true }) call sites but the ` +
|
|
147
|
-
`RSC build output is missing`
|
|
148
|
-
);
|
|
143
|
+
return { summary: { captured: 0, skipped: [], hardErrors: [], nestingWarnings: 0 } };
|
|
149
144
|
}
|
|
145
|
+
const entryPath = join(rscDir, 'index.js');
|
|
150
146
|
|
|
151
|
-
// The
|
|
152
|
-
// (
|
|
153
|
-
// back to an empty manifest, but set the real values when available so
|
|
154
|
-
// capture-time behavior matches production startup.
|
|
147
|
+
// The build manifest global the bundle reads is published by the
|
|
148
|
+
// post-build phase before this step runs (plugins/post-build.ts).
|
|
155
149
|
const g = globalThis as Record<string, unknown>;
|
|
156
|
-
if (ctx.buildManifest) g.__TIMBER_BUILD_MANIFEST__ ??= ctx.buildManifest;
|
|
157
|
-
if (ctx.deploymentId) g.__TIMBER_DEPLOYMENT_ID__ ??= ctx.deploymentId;
|
|
158
150
|
|
|
159
151
|
console.log('[timber] cache.component: capturing prebuilt flight payloads…');
|
|
160
152
|
|
|
@@ -173,6 +165,7 @@ export async function runPrebuiltCapture(ctx: PluginContext): Promise<CaptureSum
|
|
|
173
165
|
const entryUrl = `${pathToFileURL(entryPath).href}?t=${Date.now()}`;
|
|
174
166
|
mod = (await import(/* @vite-ignore */ entryUrl)) as CaptureModule;
|
|
175
167
|
} catch (error) {
|
|
168
|
+
// A missing entry lands here too: the import is the existence check.
|
|
176
169
|
throw new Error(
|
|
177
170
|
`[timber] prebuilt capture: failed to load the built RSC entry (${entryPath}). ` +
|
|
178
171
|
`The capture pass runs the production server module inside the build process — ` +
|
|
@@ -188,7 +181,8 @@ export async function runPrebuiltCapture(ctx: PluginContext): Promise<CaptureSum
|
|
|
188
181
|
);
|
|
189
182
|
}
|
|
190
183
|
|
|
191
|
-
const
|
|
184
|
+
const prebuiltDir = join(ctx.buildDir, 'prebuilt');
|
|
185
|
+
const writer = createPrebuiltArtifactWriter(prebuiltDir);
|
|
192
186
|
const summary = await capture({
|
|
193
187
|
fileComponentMap: Object.fromEntries(routeComponents),
|
|
194
188
|
callSiteProps: ctx.prebuiltCallSiteProps
|
|
@@ -206,12 +200,14 @@ export async function runPrebuiltCapture(ctx: PluginContext): Promise<CaptureSum
|
|
|
206
200
|
);
|
|
207
201
|
}
|
|
208
202
|
|
|
209
|
-
|
|
203
|
+
// The manifest is written only when a payload was, so this is the one
|
|
204
|
+
// point that knows whether prebuilt/ is a product of this build.
|
|
205
|
+
const written = await writer.finalize();
|
|
210
206
|
|
|
211
207
|
const total = summary.captured + summary.skipped.length;
|
|
212
208
|
console.log(
|
|
213
209
|
`[timber] Prebuilt ${summary.captured}/${total} entries.` +
|
|
214
210
|
(summary.skipped.length > 0 ? ` ${summary.skipped.length} skipped due to errors.` : '')
|
|
215
211
|
);
|
|
216
|
-
return summary;
|
|
212
|
+
return written > 0 ? { summary, artifact: { path: prebuiltDir } } : { summary };
|
|
217
213
|
}
|
package/src/plugins/prebuilt.ts
CHANGED
|
@@ -71,6 +71,7 @@ import {
|
|
|
71
71
|
import { collectJsxUsages, recordCallSiteProps } from './callsite-jsx.ts';
|
|
72
72
|
import { mayPrerender, unwrapExpression } from './prebuilt-options-analysis.ts';
|
|
73
73
|
import { cleanPrebuiltDir, runPrebuiltCapture } from './prebuilt-capture.ts';
|
|
74
|
+
import type { PrebuiltCaptureResult } from './prebuilt-capture.ts';
|
|
74
75
|
import type {
|
|
75
76
|
CallExpressionNode,
|
|
76
77
|
IdentifierNode,
|
|
@@ -263,12 +264,11 @@ const DEFAULT_SENTINEL = '\0default';
|
|
|
263
264
|
|
|
264
265
|
async function collectCrossModuleProps(
|
|
265
266
|
ctx: PluginContext,
|
|
267
|
+
bindingNames: ReadonlyMap<string, ReadonlyMap<string, string>>,
|
|
266
268
|
moduleId: string,
|
|
267
269
|
getInfo: (id: string) => PrebuiltModuleInfo | null,
|
|
268
270
|
resolve: (source: string, importer: string) => Promise<string | null>
|
|
269
271
|
): Promise<void> {
|
|
270
|
-
const bindingNames = ctx.prebuiltBindingNames!;
|
|
271
|
-
|
|
272
272
|
const info = getInfo(moduleId);
|
|
273
273
|
if (!info) return;
|
|
274
274
|
|
|
@@ -362,10 +362,53 @@ async function collectCrossModuleProps(
|
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
-
|
|
365
|
+
/**
|
|
366
|
+
* What the post-build phase asks of the prebuilt plugin (plugins/post-build.ts).
|
|
367
|
+
*/
|
|
368
|
+
export interface PrebuiltBuildStep {
|
|
369
|
+
/**
|
|
370
|
+
* Run the capture pass against the built RSC bundle in `rscDir`. Always
|
|
371
|
+
* removes the previous build's `prebuilt/` first — even when this build
|
|
372
|
+
* captures nothing, a stale manifest must never ship. Returns null when
|
|
373
|
+
* there was nothing to capture: no prerender call site is reachable from a
|
|
374
|
+
* route, or `output: 'static'` already renders everything at build time.
|
|
375
|
+
*/
|
|
376
|
+
capture(rscDir: string): Promise<PrebuiltCaptureResult | null>;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export function timberPrebuilt(ctx: PluginContext): Plugin & { api: PrebuiltBuildStep } {
|
|
380
|
+
/**
|
|
381
|
+
* Module ID → prerender-capable component IDs declared in it. Recorded by
|
|
382
|
+
* the RSC transform, read by the RSC `generateBundle` module-graph walk
|
|
383
|
+
* that computes `ctx.routePrebuiltComponents`. Build only.
|
|
384
|
+
*/
|
|
385
|
+
const moduleComponents = new Map<string, string[]>();
|
|
386
|
+
/**
|
|
387
|
+
* Module ID → variable name → component ID, for the prebuilt components
|
|
388
|
+
* that module declares. Read at `generateBundle` time to trace imports in
|
|
389
|
+
* other modules back to component IDs (cross-module call-site props).
|
|
390
|
+
*/
|
|
391
|
+
const bindingNames = new Map<string, Map<string, string>>();
|
|
392
|
+
|
|
366
393
|
return {
|
|
367
394
|
name: 'timber-prebuilt',
|
|
368
395
|
|
|
396
|
+
api: {
|
|
397
|
+
async capture(rscDir) {
|
|
398
|
+
await cleanPrebuiltDir(ctx.buildDir);
|
|
399
|
+
if (!ctx.routePrebuiltComponents || ctx.routePrebuiltComponents.size === 0) return null;
|
|
400
|
+
if (ctx.config.output === 'static') {
|
|
401
|
+
// design/44 §output: 'static' — everything already renders at
|
|
402
|
+
// build time there; the wrapper is a no-op, not an error.
|
|
403
|
+
console.log(
|
|
404
|
+
`[timber] cache.component: skipped prerender capture (output: 'static' renders all components at build time)`
|
|
405
|
+
);
|
|
406
|
+
return null;
|
|
407
|
+
}
|
|
408
|
+
return runPrebuiltCapture(ctx, rscDir);
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
|
|
369
412
|
transform(code, id) {
|
|
370
413
|
// Drop this module's stale attribution first — in a long-lived
|
|
371
414
|
// `vite build --watch` process the plugin context outlives builds,
|
|
@@ -374,7 +417,8 @@ export function timberPrebuilt(ctx: PluginContext): Plugin {
|
|
|
374
417
|
// below (codex P2 on PR #836). Re-recorded at the bottom if the
|
|
375
418
|
// edited module still has prerender-capable call sites.
|
|
376
419
|
if (!ctx.dev && this?.environment?.name === 'rsc') {
|
|
377
|
-
|
|
420
|
+
moduleComponents.delete(id);
|
|
421
|
+
bindingNames.delete(id);
|
|
378
422
|
}
|
|
379
423
|
if (!code.includes('@timber-js/app/cache') && !code.includes('timber/cache')) return;
|
|
380
424
|
// Skip node_modules (don't transform third-party code)
|
|
@@ -432,8 +476,7 @@ export function timberPrebuilt(ctx: PluginContext): Plugin {
|
|
|
432
476
|
// Record this module's component IDs for the RSC generateBundle
|
|
433
477
|
// module-graph walk (route → component attribution, TIM-1119).
|
|
434
478
|
if (!ctx.dev && componentIds.length > 0 && this?.environment?.name === 'rsc') {
|
|
435
|
-
|
|
436
|
-
ctx.prebuiltModuleComponents.set(id, componentIds);
|
|
479
|
+
moduleComponents.set(id, componentIds);
|
|
437
480
|
|
|
438
481
|
// Record binding name → component ID mapping for cross-module
|
|
439
482
|
// prop detection at generateBundle time (TIM-1142).
|
|
@@ -485,8 +528,7 @@ export function timberPrebuilt(ctx: PluginContext): Plugin {
|
|
|
485
528
|
}
|
|
486
529
|
|
|
487
530
|
if (bindingMap.size > 0) {
|
|
488
|
-
|
|
489
|
-
ctx.prebuiltBindingNames.set(id, bindingMap);
|
|
531
|
+
bindingNames.set(id, bindingMap);
|
|
490
532
|
}
|
|
491
533
|
|
|
492
534
|
// Same-module JSX usages: if a prebuilt component is declared AND
|
|
@@ -542,8 +584,8 @@ export function timberPrebuilt(ctx: PluginContext): Plugin {
|
|
|
542
584
|
if (ctx.dev) return;
|
|
543
585
|
if (this?.environment?.name !== 'rsc') return;
|
|
544
586
|
ctx.routePrebuiltComponents = undefined;
|
|
545
|
-
|
|
546
|
-
if (
|
|
587
|
+
ctx.prebuiltLazyChunks = undefined;
|
|
588
|
+
if (moduleComponents.size === 0 || !ctx.routeTree) return;
|
|
547
589
|
|
|
548
590
|
const self = this as unknown as {
|
|
549
591
|
getModuleInfo?: (id: string) => PrebuiltModuleInfo | null;
|
|
@@ -592,7 +634,7 @@ export function timberPrebuilt(ctx: PluginContext): Plugin {
|
|
|
592
634
|
// for JSX usages of prebuilt components — not just the route files
|
|
593
635
|
// themselves. A component used in a helper (page → Shell → <BlogBody>)
|
|
594
636
|
// must have its props captured from wherever the JSX lives.
|
|
595
|
-
if (
|
|
637
|
+
if (bindingNames.size > 0) {
|
|
596
638
|
const scannedModules = new Set<string>();
|
|
597
639
|
for (const filePath of routeComponents.keys()) {
|
|
598
640
|
const visited = new Set<string>();
|
|
@@ -603,7 +645,7 @@ export function timberPrebuilt(ctx: PluginContext): Plugin {
|
|
|
603
645
|
visited.add(modId);
|
|
604
646
|
if (!scannedModules.has(modId)) {
|
|
605
647
|
scannedModules.add(modId);
|
|
606
|
-
await collectCrossModuleProps(ctx, modId, getInfo, resolveFn);
|
|
648
|
+
await collectCrossModuleProps(ctx, bindingNames, modId, getInfo, resolveFn);
|
|
607
649
|
}
|
|
608
650
|
const modInfo = getInfo(modId);
|
|
609
651
|
if (!modInfo) continue;
|
|
@@ -624,32 +666,5 @@ export function timberPrebuilt(ctx: PluginContext): Plugin {
|
|
|
624
666
|
);
|
|
625
667
|
}
|
|
626
668
|
},
|
|
627
|
-
|
|
628
|
-
/**
|
|
629
|
-
* Post-build capture (design/44 §Build Phase). `order: 'post'` runs
|
|
630
|
-
* after the RSC plugin's buildApp — all five build steps are complete —
|
|
631
|
-
* and BEFORE timber-adapter-build's post hook (plugin array order), so
|
|
632
|
-
* `prebuilt/` exists when the adapter assembles its output (TIM-1122).
|
|
633
|
-
*/
|
|
634
|
-
buildApp: {
|
|
635
|
-
order: 'post' as const,
|
|
636
|
-
async handler() {
|
|
637
|
-
if (ctx.dev) return;
|
|
638
|
-
ctx.captureSummary = undefined;
|
|
639
|
-
// Always shed a previous build's artifacts first — even when THIS
|
|
640
|
-
// build captures nothing, a stale manifest must never ship.
|
|
641
|
-
await cleanPrebuiltDir(ctx.buildDir);
|
|
642
|
-
if (!ctx.routePrebuiltComponents || ctx.routePrebuiltComponents.size === 0) return;
|
|
643
|
-
if (ctx.config.output === 'static') {
|
|
644
|
-
// design/44 §output: 'static' — everything already renders at
|
|
645
|
-
// build time there; the wrapper is a no-op, not an error.
|
|
646
|
-
console.log(
|
|
647
|
-
`[timber] cache.component: skipped prerender capture (output: 'static' renders all components at build time)`
|
|
648
|
-
);
|
|
649
|
-
return;
|
|
650
|
-
}
|
|
651
|
-
ctx.captureSummary = await runPrebuiltCapture(ctx);
|
|
652
|
-
},
|
|
653
|
-
},
|
|
654
669
|
};
|
|
655
670
|
}
|
|
@@ -227,10 +227,6 @@ export function timberPrerenderSugar(ctx: PluginContext): Plugin {
|
|
|
227
227
|
if (declText.includes('.component(')) return;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
// Record this page as desugared for downstream attribution
|
|
231
|
-
ctx.prerenderSugarPages ??= new Set();
|
|
232
|
-
ctx.prerenderSugarPages.add(id);
|
|
233
|
-
|
|
234
230
|
const s = new MagicString(code);
|
|
235
231
|
const optionsSource = buildOptionsSource(value);
|
|
236
232
|
|