void 1.6.2 → 1.8.0
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/{account-cmd-D903EEWQ.mjs → account-cmd-CZKntRH2.mjs} +6 -6
- package/dist/action-key-ByZ6DDld.mjs +64 -0
- package/dist/{application-analysis-DlUG-XNT.mjs → application-analysis-CyTagJQM.mjs} +31 -10
- package/dist/{application-routing-GCBSwXA9.mjs → application-routing-BLrMVpqi.mjs} +2 -1
- package/dist/{auth-CL-p_rqV.mjs → auth-BN0NU9dz.mjs} +1 -1
- package/dist/{auth-CH4PLAX1.d.mts → auth-Bk9VGtQW.d.mts} +9 -2
- package/dist/{auth-Dy8svcqQ.mjs → auth-CCk9Seol.mjs} +2 -2
- package/dist/{auth-YVjBX5NY.mjs → auth-DyWp-fSo.mjs} +7 -1
- package/dist/{auth-link-g9J7MSmP.mjs → auth-link-BOaQWMKw.mjs} +6 -6
- package/dist/{auth-router-DMZbG9Qn.mjs → auth-router-D0-VcmDs.mjs} +3 -3
- package/dist/{better-auth-shared-BJyG2mH0.d.mts → better-auth-shared-CQFdtguU.d.mts} +2 -2
- package/dist/{better-auth-shared-C958aM7W.mjs → better-auth-shared-CdVyCUou.mjs} +1 -1
- package/dist/boundary-plans-CRmWH68v.d.mts +25 -0
- package/dist/{build-cmd-DmjbuT6d.mjs → build-cmd-JTsXXf2F.mjs} +5 -5
- package/dist/{cache-2khBO1MR.mjs → cache-D0m3Z_Xf.mjs} +5 -5
- package/dist/{cancel-deploy-_itbbvY3.mjs → cancel-deploy-Ce6Os4fa.mjs} +4 -4
- package/dist/{cf-build-output-B1C8U83u.mjs → cf-build-output-CWNOH-KA.mjs} +2 -1
- package/dist/cf-build-output-DUZnAeZ1.mjs +1 -0
- package/dist/{cf-config-migrate-Dy8MrKgF.mjs → cf-config-migrate-Bb-EdAQq.mjs} +5 -1
- package/dist/cli/cli.mjs +68 -1868
- package/dist/cli/cloudflare-operation-process.mjs +101 -26
- package/dist/cli/env-schema-probe.d.mts +1 -1
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/cli-main-rkrJy2Ge.mjs +1889 -0
- package/dist/client-D1Vz1Zep.mjs +1 -0
- package/dist/{client-CoxPEhJq.mjs → client-SZPyj4X_.mjs} +10 -4
- package/dist/{cloudflare-auth-CuS42-9A.mjs → cloudflare-auth-7jTqy9Bx.mjs} +1 -1
- package/dist/{cloudflare-cmd-DTF19-j-.mjs → cloudflare-cmd-ChPLQcTP.mjs} +5 -5
- package/dist/{cloudflare-config-Ce8j5S7V.mjs → cloudflare-config-DtOGAbeB.mjs} +2 -2
- package/dist/{cloudflare-connect-BN4dHp8i.mjs → cloudflare-connect-Co93VYTo.mjs} +3 -3
- package/dist/{cloudflare-operations-DrZGzQap.mjs → cloudflare-operations-CXaDKYj2.mjs} +6 -6
- package/dist/{cloudflare-operations-laxRA8HN.mjs → cloudflare-operations-DATekLwI.mjs} +1 -1
- package/dist/{cloudflare-process-D9aC-jXr.mjs → cloudflare-process-DmTxZR-N.mjs} +2 -2
- package/dist/{config-hL-S-Y9D.mjs → config-5oSQhZNj.mjs} +3 -1
- package/dist/{config-CPxJmt4M.d.mts → config-CTlUaXWZ.d.mts} +3 -1
- package/dist/{config-CNDjO-15.mjs → config-DcqUBGCb.mjs} +1 -1
- package/dist/config-entry.d.mts +1 -1
- package/dist/{config-DMR0i3Z2.mjs → config-wo2EaH0X.mjs} +1 -1
- package/dist/{connect-DHepM7Xs.mjs → connect-DlvXt1JR.mjs} +7 -7
- package/dist/{create-project-Bq0M8MtO.mjs → create-project-CC_7hmYJ.mjs} +5 -5
- package/dist/{create-project-BiMmR5wA.mjs → create-project-DzY05xqC.mjs} +1 -1
- package/dist/{db-CqfT6lhV.mjs → db-FhyYGcJJ.mjs} +39 -39
- package/dist/{db-types-DRmxBJ2K.mjs → db-types-sVwEpyPR.mjs} +4 -2
- package/dist/{delete-CY4L8fi2.mjs → delete-CModjyOC.mjs} +5 -5
- package/dist/{deploy-La_Ly8g_.mjs → deploy-Cz9TEzZy.mjs} +502 -110
- package/dist/deploy-DMieisRu.mjs +2 -0
- package/dist/{deploy-managed-static-CESLfKHN.mjs → deploy-managed-static-DlxxXkAM.mjs} +16 -16
- package/dist/{deploy-transport-DcI6LXhY.mjs → deploy-transport-DUvm6-CR.mjs} +3 -3
- package/dist/deploy.mjs +8 -8
- package/dist/{dispatch-DM4Xdd2l.mjs → dispatch-CCiaAnSK.mjs} +7 -7
- package/dist/{dist-eV_Ep60B.mjs → dist-Cp4b1_T9.mjs} +1 -1
- package/dist/{dist-D23AAMxT.mjs → dist-STQXl8ck.mjs} +86 -138
- package/dist/{domain-BD1KOQL3.mjs → domain-DvdZPA50.mjs} +6 -6
- package/dist/{drizzle-C8MPqt5m.mjs → drizzle-D4V_06-B.mjs} +1 -1
- package/dist/{drizzle-lFdzSEa9.mjs → drizzle-DBSpPpU1.mjs} +34 -8
- package/dist/{email-XAspopcj.mjs → email-ASpNrfLd.mjs} +10 -10
- package/dist/{email-cloudflare-RxIQoPc9.mjs → email-cloudflare-kqoN9jst.mjs} +25 -16
- package/dist/{entry-DFBca6aS.mjs → entry-BweGTCgj.mjs} +1 -1
- package/dist/{env-DrYUh55t.mjs → env-Bpkg3G5i.mjs} +7 -7
- package/dist/{env-CuzZZyjB.mjs → env-UqS-21xi.mjs} +8 -1
- package/dist/env-mask-D31Qztl9.mjs +46 -0
- package/dist/{env-public-CeNeO_AT.d.mts → env-public-DtJL_hZq.d.mts} +8 -7
- package/dist/{env-validation-Del3C8AY.mjs → env-validation-BpCCQE_6.mjs} +6 -6
- package/dist/{env-validation-Bosj7EVg.mjs → env-validation-CN386Utu.mjs} +1 -1
- package/dist/{fetch-C8yhLoF3.mjs → fetch-CAIVkLvW.mjs} +1 -1
- package/dist/{fetch-B-gLGYVl.d.mts → fetch-CbI6lNnk.d.mts} +6 -4
- package/dist/{fetch-stream-DafNtVJC.mjs → fetch-stream-6Op0qlLd.mjs} +1 -1
- package/dist/{fetch-stream-DuwxWmBM.d.mts → fetch-stream-DoED9atq.d.mts} +1 -1
- package/dist/gen-M5fNQKfH.mjs +1 -0
- package/dist/{gen-DSkScMIz.mjs → gen-upKJChvd.mjs} +7 -7
- package/dist/{github-cmd-CA-lBdkn.mjs → github-cmd-BvMOlb8Z.mjs} +6 -6
- package/dist/{handler-BR6Tvjkp.d.mts → handler-BO7Od-z9.d.mts} +22 -8
- package/dist/{handler-DnI_au0K.mjs → handler-C9SnmeW1.mjs} +5 -4
- package/dist/{headers--cbz6iZ8.mjs → headers-COGEDoMN.mjs} +11 -2
- package/dist/help-CItQVDL4.mjs +1 -0
- package/dist/{help-1OCFDsRr.mjs → help-TPCjTu6e.mjs} +7 -3
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +379 -265
- package/dist/{info-BpxpsX0B.mjs → info-EsDyihwf.mjs} +4 -4
- package/dist/{init-DpVXO5S-.mjs → init-a4lVagrb.mjs} +33 -32
- package/dist/{link-DAXOT-G_.mjs → link-CE55DDzS.mjs} +6 -6
- package/dist/{list-BFQ0gcML.mjs → list-CxRthQks.mjs} +7 -7
- package/dist/{live-DF4HUl2m.mjs → live-CYJ4KGoR.mjs} +2 -2
- package/dist/{live-0xrcVpyq.d.mts → live-Kc55iuOQ.d.mts} +2 -2
- package/dist/{local-d1-CLVPP6v7.mjs → local-d1-CFcH9Bx3.mjs} +2 -2
- package/dist/{login-RIw7ffPe.mjs → login-AfcSGSmE.mjs} +5 -5
- package/dist/login-ZHsAm-I6.mjs +1 -0
- package/dist/{logs-B2OeLS4X.mjs → logs-BgRJuvb1.mjs} +6 -6
- package/dist/{migrate-DiI50Chz.mjs → migrate-BNAh6m_C.mjs} +5 -5
- package/dist/migrate-BflbbZQK.mjs +1 -0
- package/dist/nitro.d.mts +5 -0
- package/dist/nitro.mjs +27 -8
- package/dist/{node-Bc-dBAGL.mjs → node-CXFUw0Uz.mjs} +5 -5
- package/dist/{operator-args-D79WQP70.mjs → operator-args-DGTuCdSE.mjs} +9 -1
- package/dist/{operator-auth-CfDcmzpo.mjs → operator-auth-CD3pap65.mjs} +1 -1
- package/dist/{operator-client-BIY4-N_6.mjs → operator-client-XvXTkea6.mjs} +2 -2
- package/dist/{operator-cmd-CEI5Aaza.mjs → operator-cmd-C-viB7Si.mjs} +7 -7
- package/dist/operator-cmd-D6qNuJ_z.mjs +1 -0
- package/dist/output-BsdnNpxa.mjs +1 -0
- package/dist/{output-BCdLioKP.mjs → output-DNVILSz2.mjs} +1 -1
- package/dist/pages/client.d.mts +43 -15
- package/dist/pages/client.mjs +165 -80
- package/dist/pages/index.d.mts +6 -4
- package/dist/pages/index.mjs +6 -6
- package/dist/pages/islands-plugin.d.mts +1 -1
- package/dist/pages/islands-plugin.mjs +13 -2
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +1 -1
- package/dist/pages/serialize.d.mts +2 -2
- package/dist/pages/serialize.mjs +1 -1
- package/dist/{platform-args-Cx1M-7bq.mjs → platform-args-CiYeZmc5.mjs} +1 -1
- package/dist/platform-args-DJvF1-kl.mjs +1 -0
- package/dist/{platform-auth-config-ZrYm8KVs.mjs → platform-auth-config-Dt2qEc2w.mjs} +10 -10
- package/dist/{platform-auth-protection-t6mdY4nn.mjs → platform-auth-protection-B7TaF-PZ.mjs} +8 -8
- package/dist/{platform-auth-recovery-XeBmPTXx.mjs → platform-auth-recovery-suXSteJ6.mjs} +7 -7
- package/dist/{platform-cmd-EXehmSYA.mjs → platform-cmd-9rvYBBtr.mjs} +9 -9
- package/dist/{platform-cmd-C7BevP9b.mjs → platform-cmd-DuAsIxbU.mjs} +1 -1
- package/dist/{platform-domain-DR263ObA.mjs → platform-domain-DhH_vDr6.mjs} +5 -5
- package/dist/{platform-lifecycle-CN4aXldN.mjs → platform-lifecycle-3uI-E2bF.mjs} +1 -1
- package/dist/{platform-lifecycle-BvU_TNji.mjs → platform-lifecycle-CXmXe2xt.mjs} +17 -17
- package/dist/{platform-management-_UE1_GM8.mjs → platform-management-BBCHfwji.mjs} +4 -4
- package/dist/{platform-management-yS2sve3V.mjs → platform-management-PdrgDQTe.mjs} +1 -1
- package/dist/{platform-plans-config-Dx1agneU.mjs → platform-plans-config-BGwkXYDM.mjs} +5 -5
- package/dist/{platform-recovery-CPVk9-Q4.mjs → platform-recovery-C8NxXGRR.mjs} +3 -3
- package/dist/{platform-setup-Vw1AaUN8.mjs → platform-setup-Casiffqj.mjs} +3 -3
- package/dist/{plugin-inference-bQ1Be840.mjs → plugin-inference-CErfTgEx.mjs} +4 -4
- package/dist/{prepare-D8L9AQbw.mjs → prepare-BDKWZgfL.mjs} +12 -9
- package/dist/{prepare-BkRhDnxw.mjs → prepare-BLrzXjIl.mjs} +3 -3
- package/dist/prepare-a1_5usAn.mjs +1 -0
- package/dist/{prerender-render-RlAj6hh8.mjs → prerender-render-BAdYhivW.mjs} +44 -15
- package/dist/prerender-render.d.mts +12 -2
- package/dist/prerender-render.mjs +1 -1
- package/dist/{project-cmd-DH3CuFC6.mjs → project-cmd-DzGvxXKH.mjs} +18 -18
- package/dist/{project-team-MjT5K4rQ.mjs → project-team-C5XtHbZk.mjs} +5 -5
- package/dist/{project-token-BKHGwY3k.mjs → project-token-B4D5yhHQ.mjs} +5 -5
- package/dist/{project-tsconfig-BMveFb4b.mjs → project-tsconfig-nhnTWO_Y.mjs} +3 -1
- package/dist/{project-zero-trust-Bzdd05-h.mjs → project-zero-trust--0LvktDg.mjs} +5 -5
- package/dist/{protocol-COyySMki.mjs → protocol-B1Tvc9-x.mjs} +232 -74
- package/dist/{protocol-CkwjASep.d.mts → protocol-Cg2I81NA.d.mts} +13 -4
- package/dist/{provision-B0HqoRuI.mjs → provision-C3yiHdld.mjs} +2 -2
- package/dist/{provision-CYhZR_Mn.mjs → provision-CAcrauvr.mjs} +1 -1
- package/dist/{requests-daJmVpjk.mjs → requests-CrRiTgQA.mjs} +4 -4
- package/dist/resolve-project-C5wC-Hoi.mjs +1 -0
- package/dist/{resolve-project-D0YNnJfm.mjs → resolve-project-Da3OgCU1.mjs} +1 -1
- package/dist/{rollback-AVwiMAkk.mjs → rollback-BsmQyj-Q.mjs} +7 -7
- package/dist/{route-types-e69EqY88.mjs → route-types-CgtlFCDz.mjs} +268 -14
- package/dist/{route-url-C_YIH_zO.d.mts → route-url-C3JwYrER.d.mts} +8 -3
- package/dist/{route-url-CRDF-I0I.mjs → route-url-CfCR4oMj.mjs} +4 -3
- package/dist/routes-stub.d.mts +14 -4
- package/dist/routes-stub.mjs +1 -1
- package/dist/{runner-QMeOpScZ.mjs → runner-CTk21HrO.mjs} +1 -1
- package/dist/{runner-mysql-0zVmB1JW.mjs → runner-mysql-CHvEg_sy.mjs} +1 -1
- package/dist/runtime/ai.mjs +1 -1
- package/dist/runtime/auth.d.mts +2 -2
- package/dist/runtime/auth.mjs +1 -1
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.d.mts +3 -3
- package/dist/runtime/client-react.mjs +2 -2
- package/dist/runtime/client-solid.d.mts +3 -3
- package/dist/runtime/client-solid.mjs +2 -2
- package/dist/runtime/client-svelte.d.mts +3 -3
- package/dist/runtime/client-svelte.mjs +2 -2
- package/dist/runtime/client-vue.d.mts +3 -3
- package/dist/runtime/client-vue.mjs +2 -2
- package/dist/runtime/client.d.mts +3 -3
- package/dist/runtime/client.mjs +2 -2
- package/dist/runtime/db.d.mts +6 -3
- package/dist/runtime/db.mjs +2 -2
- package/dist/runtime/email/testing.mjs +2 -2
- package/dist/runtime/email.mjs +3 -3
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/env-public.mjs +55 -85
- package/dist/runtime/fetch-server.d.mts +1 -1
- package/dist/runtime/fetch-server.mjs +1 -1
- package/dist/runtime/fetch-stream.d.mts +2 -2
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.d.mts +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +1 -1
- package/dist/runtime/isr.d.mts +3 -1
- package/dist/runtime/live-client.d.mts +11 -2
- package/dist/runtime/live-client.mjs +8 -0
- package/dist/runtime/live-server.mjs +1 -1
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/log.mjs +1 -1
- package/dist/runtime/remote/index.mjs +1 -1
- package/dist/runtime/route-url.d.mts +2 -2
- package/dist/runtime/route-url.mjs +1 -1
- package/dist/runtime/routing.d.mts +21 -5
- package/dist/runtime/routing.mjs +251 -29
- package/dist/runtime/sandbox.mjs +1 -1
- package/dist/runtime/sse-client.d.mts +9 -1
- package/dist/runtime/sse-client.mjs +7 -0
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/validator.mjs +1 -1
- package/dist/runtime/ws-server.d.mts +3 -3
- package/dist/runtime/ws-server.mjs +1 -1
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/runtime/ws.mjs +1 -1
- package/dist/{scan-F0psanp7.mjs → scan-BJ3bj6aP.mjs} +236 -32
- package/dist/{secret-szNdoeKa.mjs → secret-D0g5oBsP.mjs} +7 -7
- package/dist/serialize-DN-envGQ.d.mts +18 -0
- package/dist/serialize-Pf-CIQK_.mjs +39 -0
- package/dist/{skills-D393E4lB.mjs → skills-CoBB9_Ao.mjs} +1 -1
- package/dist/{ast-bindings-BkivMJIo.mjs → static-exports-DFkzL-NX.mjs} +96 -33
- package/dist/{subcommand-prompt-CxJXporl.mjs → subcommand-prompt-0yIARXf2.mjs} +2 -2
- package/dist/{types-agfx0alu.d.mts → types-IPut3_Yx.d.mts} +15 -1
- package/dist/url-CuoEn0o3.mjs +43 -0
- package/dist/validator-8-NZs2Xr.mjs +168 -0
- package/dist/{version-metadata-BC3LK7Y-.mjs → version-metadata-eUd6Ar_U.mjs} +1 -1
- package/dist/wrangler-R3kMdJfw.mjs +1 -0
- package/dist/{wrangler-Gn4EoY4-.mjs → wrangler-k40T7XTQ.mjs} +2 -2
- package/dist/{wrapper-B9W9RE8z.mjs → wrapper-CVMZarxf.mjs} +11 -8
- package/dist/{ws-Dmjg5NH2.d.mts → ws--U7QicYy.d.mts} +2 -2
- package/docs/guide/ai.md +3 -0
- package/docs/guide/app-types.md +1 -0
- package/docs/guide/auth.md +63 -0
- package/docs/guide/database/d1.md +16 -1
- package/docs/guide/database/mysql.md +1 -0
- package/docs/guide/database/postgresql.md +1 -0
- package/docs/guide/database.md +34 -0
- package/docs/guide/deployment.md +9 -0
- package/docs/guide/durable-state.md +1 -0
- package/docs/guide/edge/headers.md +1 -0
- package/docs/guide/edge/prerendering.md +10 -4
- package/docs/guide/edge/redirects.md +1 -0
- package/docs/guide/edge/revalidation.md +6 -0
- package/docs/guide/edge/rewrites.md +1 -0
- package/docs/guide/edge/static-assets.md +1 -0
- package/docs/guide/email/domains.md +1 -0
- package/docs/guide/email/receiving.md +3 -2
- package/docs/guide/email/sending.md +3 -2
- package/docs/guide/email.md +1 -0
- package/docs/guide/env-vars.md +4 -0
- package/docs/guide/index.md +1 -0
- package/docs/guide/jobs.md +1 -0
- package/docs/guide/kv.md +1 -0
- package/docs/guide/live.md +3 -0
- package/docs/guide/pages-routing/actions-and-forms.md +51 -28
- package/docs/guide/pages-routing/errors.md +101 -0
- package/docs/guide/pages-routing/head.md +4 -1
- package/docs/guide/pages-routing/islands.md +2 -1
- package/docs/guide/pages-routing/layouts.md +3 -0
- package/docs/guide/pages-routing/loaders.md +3 -0
- package/docs/guide/pages-routing/markdown.md +3 -3
- package/docs/guide/pages-routing/overview.md +142 -10
- package/docs/guide/pages-routing/view-transitions.md +1 -0
- package/docs/guide/platform/administration/access.md +1 -0
- package/docs/guide/platform/administration/connected-apps.md +4 -0
- package/docs/guide/platform/administration/email.md +1 -0
- package/docs/guide/platform/administration/operations.md +1 -0
- package/docs/guide/platform/administration/plans.md +1 -0
- package/docs/guide/platform/administration/projects.md +11 -0
- package/docs/guide/platform/administration/zero-trust.md +1 -0
- package/docs/guide/platform/development/local.md +1 -0
- package/docs/guide/platform/development/runtime.md +1 -0
- package/docs/guide/platform/development/schema-ci.md +1 -0
- package/docs/guide/platform/installation/ci.md +1 -0
- package/docs/guide/platform/installation/credentials.md +1 -0
- package/docs/guide/platform/installation/domains.md +1 -0
- package/docs/guide/platform/installation/first-deployment.md +1 -0
- package/docs/guide/platform/installation/maintenance.md +1 -0
- package/docs/guide/platform/installation/prerequisites.md +1 -0
- package/docs/guide/platform/installation/setup.md +1 -0
- package/docs/guide/platform/installation/uninstall.md +1 -0
- package/docs/guide/platform-administration.md +1 -0
- package/docs/guide/platform-development.md +1 -0
- package/docs/guide/project-collaboration.md +1 -0
- package/docs/guide/queues.md +3 -0
- package/docs/guide/quickstart.md +4 -2
- package/docs/guide/remote-dev.md +1 -0
- package/docs/guide/sandboxes.md +1 -0
- package/docs/guide/self-hosted-platform.md +1 -0
- package/docs/guide/server-routing.md +1 -0
- package/docs/guide/sse.md +3 -0
- package/docs/guide/ssg.md +24 -2
- package/docs/guide/ssr.md +1 -0
- package/docs/guide/storage.md +7 -2
- package/docs/guide/testing.md +62 -0
- package/docs/guide/type-safety.md +308 -26
- package/docs/guide/typed-fetch.md +8 -3
- package/docs/guide/websockets.md +6 -5
- package/docs/index.md +1 -0
- package/docs/integrations/agents.md +1 -0
- package/docs/integrations/cloudflare.md +11 -10
- package/docs/integrations/frameworks/analog.md +1 -0
- package/docs/integrations/frameworks/astro.md +1 -0
- package/docs/integrations/frameworks/nuxt.md +3 -0
- package/docs/integrations/frameworks/overview.md +3 -0
- package/docs/integrations/frameworks/react-router.md +1 -0
- package/docs/integrations/frameworks/sveltekit.md +1 -0
- package/docs/integrations/frameworks/tanstack-start.md +1 -0
- package/docs/integrations/hono.md +1 -0
- package/docs/integrations/nodejs-bun-deno.md +66 -0
- package/docs/reference/api/auth.md +20 -0
- package/docs/reference/api/client.md +7 -4
- package/docs/reference/api/database.md +24 -1
- package/docs/reference/api/deploy.md +4 -0
- package/docs/reference/api/durable.md +1 -0
- package/docs/reference/api/env.md +1 -0
- package/docs/reference/api/handlers.md +4 -1
- package/docs/reference/api/pages.md +30 -12
- package/docs/reference/api/plugin.md +1 -0
- package/docs/reference/api/resources.md +4 -1
- package/docs/reference/api/rewrites.md +18 -5
- package/docs/reference/api/types.md +10 -2
- package/docs/reference/api.md +1 -0
- package/docs/reference/cli/auth.md +1 -0
- package/docs/reference/cli/database.md +3 -0
- package/docs/reference/cli/deploy.md +18 -11
- package/docs/reference/cli/domains.md +1 -0
- package/docs/reference/cli/email.md +1 -0
- package/docs/reference/cli/generate.md +1 -0
- package/docs/reference/cli/github.md +1 -0
- package/docs/reference/cli/platform-config.md +1 -0
- package/docs/reference/cli/platform-email.md +1 -0
- package/docs/reference/cli/platform-installation.md +1 -0
- package/docs/reference/cli/platform-operations.md +1 -0
- package/docs/reference/cli/platform-users.md +23 -0
- package/docs/reference/cli/platform-zero-trust.md +1 -0
- package/docs/reference/cli/platform.md +1 -0
- package/docs/reference/cli/project.md +1 -0
- package/docs/reference/cli/secrets.md +1 -0
- package/docs/reference/cli/setup.md +1 -0
- package/docs/reference/cli.md +6 -0
- package/docs/reference/config.md +25 -2
- package/docs/reference/resource-inference.md +1 -0
- package/docs/reference/structure.md +1 -0
- package/package.json +27 -25
- package/schema.json +4 -0
- package/skills/void/SKILL.md +7 -0
- package/dist/action-key-XtKKbbsi.mjs +0 -25
- package/dist/cf-build-output-CmDOcA7K.mjs +0 -1
- package/dist/client-CEtr5UOR.mjs +0 -1
- package/dist/deploy-DMhOyebt.mjs +0 -2
- package/dist/gen-BbT1Ku1P.mjs +0 -1
- package/dist/help-Ba8Dq5-r.mjs +0 -1
- package/dist/login-BX2gzHUt.mjs +0 -1
- package/dist/migrate-CUGMGaIM.mjs +0 -1
- package/dist/operator-cmd-oTT2MA9G.mjs +0 -1
- package/dist/output-E6gecbbV.mjs +0 -1
- package/dist/platform-args-C7XUw9mw.mjs +0 -1
- package/dist/prepare-CZRVGNld.mjs +0 -1
- package/dist/resolve-project-CgfjtOwz.mjs +0 -1
- package/dist/serialize-DUuYuaY3.mjs +0 -29
- package/dist/serialize-I4EmS-Wf.d.mts +0 -16
- package/dist/validator-CTfmzZYb.mjs +0 -69
- package/dist/wrangler-CQ5c-MtJ.mjs +0 -1
- package/dist/{cf-access-BmBT2h8_.mjs → cf-access-Dnyw8KFY.mjs} +1 -1
- package/dist/{config-s6TkpSat.mjs → config-eeDzKBS9.mjs} +1 -1
- package/dist/{env-types-Bd8DkQhl.mjs → env-types-Dz9qkiOn.mjs} +1 -1
- package/dist/{inbound-CdO-qY0w.mjs → inbound-C2H6Dzz1.mjs} +2 -2
- package/dist/{runner-5MCSimKx.mjs → runner-CMZb7jNU.mjs} +1 -1
- package/dist/{runner-mysql-Bdmsp_x4.mjs → runner-mysql-BXfcQQj3.mjs} +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Send transactional email with sendEmail. Void captures messages in a local inbox during development.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -232,7 +233,7 @@ Remove the deprecated `sendInDev` option to use the local inbox. Deploy the app
|
|
|
232
233
|
Use the test harness to assert on outgoing messages without mocking the binding:
|
|
233
234
|
|
|
234
235
|
```ts
|
|
235
|
-
import { describe, it, expect } from '
|
|
236
|
+
import { describe, it, expect } from 'vite-plus/test';
|
|
236
237
|
import { sendEmail } from 'void/email';
|
|
237
238
|
import { createEmailTestHarness } from 'void/email/testing';
|
|
238
239
|
|
|
@@ -254,6 +255,6 @@ describe('signup flow', () => {
|
|
|
254
255
|
});
|
|
255
256
|
```
|
|
256
257
|
|
|
257
|
-
The harness intercepts every `sendEmail` call until `dispose()` is called. `clear()` empties the captured list without releasing the sink.
|
|
258
|
+
The harness intercepts every `sendEmail` call until `dispose()` is called. `clear()` empties the captured list without releasing the sink. [Testing](../testing.md) explains how to run tests and how to test code that uses other bindings.
|
|
258
259
|
|
|
259
260
|
To handle incoming messages, see [Receiving Email](./receiving.md).
|
package/docs/guide/email.md
CHANGED
package/docs/guide/env-vars.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Declare environment variables in env.ts and read the typed values from void/env. Use .env locally and secrets in production.'
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# Environment variables
|
|
2
6
|
|
|
3
7
|
Declare your environment variables in `env.ts`, then read them through `env` from `void/env`. Use `.env` for local values and `void secret put` for production server values.
|
package/docs/guide/index.md
CHANGED
package/docs/guide/jobs.md
CHANGED
package/docs/guide/kv.md
CHANGED
package/docs/guide/live.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Subscribe a browser to several topics over one SSE connection, and publish events from routes, jobs, or queues.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -77,6 +78,8 @@ stream.close();
|
|
|
77
78
|
|
|
78
79
|
Subscription IDs are scoped to a connection. Reusing an ID replaces its subscription. After reconnecting, the helper restores active subscriptions and sends their latest `eventId` as `lastEventId`.
|
|
79
80
|
|
|
81
|
+
With [`routing.typedRoutes`](../reference/config.md#routing-typedroutes), the URL must match one of your routes or be an `http://` or `https://` URL. Cast a `string` that TypeScript can't check with `as RouteUrl` from `void/routes`. The cast turns off the check for that URL.
|
|
82
|
+
|
|
80
83
|
## Publish
|
|
81
84
|
|
|
82
85
|
Publish from any server-side code that has a Void runtime env:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Change server data from a form or button with a page action. Actions accept POST, PUT, PATCH, and DELETE.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -24,10 +25,10 @@ export const action = defineHandler.withValidator({
|
|
|
24
25
|
});
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
| Action returns
|
|
28
|
-
|
|
|
29
|
-
| Nothing (void)
|
|
30
|
-
| `c.redirect(
|
|
28
|
+
| Action returns | Behavior |
|
|
29
|
+
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
30
|
+
| Nothing (void) | Re-runs the loader, page re-renders with fresh props. |
|
|
31
|
+
| `c.redirect(url)` | Navigates to another page. With [`routing.typedRoutes`](../type-safety.md#checked-url-strings), the location is checked the same way as a link. Cast a string TypeScript cannot check with `as Href`. |
|
|
31
32
|
|
|
32
33
|
Middleware does not run again after the action. To change [shared data](./layouts.md#shared-data), update it in the action or redirect.
|
|
33
34
|
|
|
@@ -149,21 +150,22 @@ The types are inferred from your action's `withValidator()` schema in the compan
|
|
|
149
150
|
|
|
150
151
|
`useForm` returns a reactive object with:
|
|
151
152
|
|
|
152
|
-
| Property / Method | Purpose
|
|
153
|
-
| -------------------------------- |
|
|
154
|
-
| `data` / `setData` | Current form values, typed to match the action's body schema.
|
|
155
|
-
| `errors` | Field-level validation errors, keys typed to body field names.
|
|
156
|
-
| `error` | Action error, or `null`.
|
|
157
|
-
| `
|
|
158
|
-
| `
|
|
159
|
-
| `
|
|
160
|
-
| `
|
|
161
|
-
| `
|
|
162
|
-
| `
|
|
163
|
-
| `
|
|
164
|
-
| `
|
|
165
|
-
| `
|
|
166
|
-
| `
|
|
153
|
+
| Property / Method | Purpose |
|
|
154
|
+
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
155
|
+
| `data` / `setData` | Current form values, typed to match the action's body schema. |
|
|
156
|
+
| `errors` | Field-level validation errors, keys typed to body field names. |
|
|
157
|
+
| `error` | Action error, or `null`. |
|
|
158
|
+
| `throwOnError` (option) | Set to `false` to keep authentication and server failures in `form.error` instead of throwing them. |
|
|
159
|
+
| `post`, `put`, `patch`, `delete` | Submit the form with that method. In React these are native form action callbacks. |
|
|
160
|
+
| `pending` | `true` while the submission is in flight. |
|
|
161
|
+
| `hasChanges` | `true` if form data differs from the current defaults. After a successful submit, defaults update to the submitted values, so `hasChanges` becomes `false` unless the form was edited during the submit. |
|
|
162
|
+
| `wasSuccessful` | `true` after a successful submission. Stays `true` until the next submission. |
|
|
163
|
+
| `recentlySuccessful` | `true` for 2 seconds after a successful submission. Useful for flash messages. |
|
|
164
|
+
| `reset(...fields)` | Reset form data to the current defaults (last submitted values after success). Field names autocomplete. Pass `{ initial: true }` first to reset to the values passed to `useForm`. |
|
|
165
|
+
| `resetOnSuccess` (option) | When `true`, a successful submit resets defaults to the mount-time values, and form data too unless it was edited during the submit. Useful for create forms that should clear after save. |
|
|
166
|
+
| `setError(field, message)` | Set a client-side validation error on a field. |
|
|
167
|
+
| `clearErrors(...fields)` | Clear validation errors. Field names autocomplete. |
|
|
168
|
+
| `clearError()` | Clear `error`. |
|
|
167
169
|
|
|
168
170
|
Use `setError()` for client-side validation. Editing a field clears its error automatically.
|
|
169
171
|
|
|
@@ -173,7 +175,7 @@ For dynamic routes, pass `params` in the options:
|
|
|
173
175
|
|
|
174
176
|
```ts
|
|
175
177
|
// pages/users/[id].server.ts has an action
|
|
176
|
-
const form = useForm('/users
|
|
178
|
+
const form = useForm('/users/[id]', { name: '' }, { params: { id: '42' } });
|
|
177
179
|
<Form form={form} method="put">{/* submits to /users/42 */}</Form>
|
|
178
180
|
```
|
|
179
181
|
|
|
@@ -202,6 +204,12 @@ If a callback awaits `router.visit()` or `router.refresh()`, pass `{ resolveOn:
|
|
|
202
204
|
|
|
203
205
|
Vue, Svelte, and Solid submissions return a promise instead; use `await form.post()` to run work after a submission.
|
|
204
206
|
|
|
207
|
+
### Query parameters after submission
|
|
208
|
+
|
|
209
|
+
An action or form that posts to the current page keeps the page's query parameters. From `/items?page=2&search=foo`, `action('/items?vote')` posts to `/items?vote&page=2&search=foo`, so the action and loader see `page` and `search`. The URL, scroll position, and history entry stay as they are. A parameter written in the action URL takes precedence over the page's: `action('/items?vote&page=1')` posts with `page=1`.
|
|
210
|
+
|
|
211
|
+
A redirect from the action does not receive the page's query parameters. To clear them after an action, return `c.redirect('/items')`.
|
|
212
|
+
|
|
205
213
|
### Scroll after submission
|
|
206
214
|
|
|
207
215
|
Actions and forms keep the current scroll position when updating the page in place. Redirects and submissions that open another page scroll to the top, or to the destination's hash target.
|
|
@@ -209,7 +217,7 @@ Actions and forms keep the current scroll position when updating the page in pla
|
|
|
209
217
|
Pass `preserveScroll: false` to reset scroll after an in-place update, or `true` to keep it even after a redirect:
|
|
210
218
|
|
|
211
219
|
```ts
|
|
212
|
-
await action('/users
|
|
220
|
+
await action('/users/[id]?update', {
|
|
213
221
|
params: { id: '42' },
|
|
214
222
|
data: { name: 'Alice' },
|
|
215
223
|
preserveScroll: false,
|
|
@@ -227,24 +235,27 @@ When a page needs multiple mutations, such as updating and deleting a user on th
|
|
|
227
235
|
import { users, updateUserSchema } from '@schema';
|
|
228
236
|
import { defineHandler } from 'void';
|
|
229
237
|
import { db, eq } from 'void/db';
|
|
238
|
+
import type { PageParams } from 'void/routes';
|
|
230
239
|
|
|
231
240
|
export const actions = {
|
|
232
241
|
update: defineHandler.withValidator({
|
|
233
242
|
body: updateUserSchema,
|
|
234
243
|
})(async (c, { body }) => {
|
|
244
|
+
const { id } = c.req.param() as PageParams<'/users/[id]'>;
|
|
235
245
|
await db
|
|
236
246
|
.update(users)
|
|
237
247
|
.set(body)
|
|
238
|
-
.where(eq(users.id, Number(
|
|
248
|
+
.where(eq(users.id, Number(id)));
|
|
239
249
|
}),
|
|
240
250
|
|
|
241
251
|
delete: defineHandler(async (c) => {
|
|
242
|
-
|
|
252
|
+
const { id } = c.req.param() as PageParams<'/users/[id]'>;
|
|
253
|
+
await db.delete(users).where(eq(users.id, Number(id)));
|
|
243
254
|
}),
|
|
244
255
|
};
|
|
245
256
|
```
|
|
246
257
|
|
|
247
|
-
Named actions use a `?actionName` suffix, such as `/users/42?update`. `useForm` and `action()` handle this automatically. After a POST action renders the page or uses a default `c.redirect()`, the page URL keeps ordinary query parameters: `/users/42?update&tab=profile` becomes `/users/42?tab=profile`. See [redirect query parameters](../../reference/api/rewrites.md#c-rewrite-destination) for redirects that preserve the request method.
|
|
258
|
+
Named actions use a `?actionName` suffix, such as `/users/42?update`. `useForm` and `action()` handle this automatically. After a POST action renders the page or uses a default `c.redirect()`, the page URL keeps the action URL's ordinary query parameters: `/users/42?update&tab=profile` becomes `/users/42?tab=profile`. See [redirect query parameters](../../reference/api/rewrites.md#c-rewrite-destination) for redirects that preserve the request method.
|
|
248
259
|
|
|
249
260
|
Use `action` or `actions` in a file, not both.
|
|
250
261
|
|
|
@@ -266,7 +277,7 @@ export const actions = {
|
|
|
266
277
|
When a page exports named actions, append `?actionName` to the URL:
|
|
267
278
|
|
|
268
279
|
```ts
|
|
269
|
-
const form = useForm('/users
|
|
280
|
+
const form = useForm('/users/[id]?update', { name: '' }, { params: { id } });
|
|
270
281
|
<Form form={form} method="put">{/* submits to /users/42?update */}</Form>
|
|
271
282
|
```
|
|
272
283
|
|
|
@@ -279,7 +290,7 @@ Use `action()` for a button or other mutation that does not need form state. It
|
|
|
279
290
|
```ts
|
|
280
291
|
import { action } from '@void/react'; // or "@void/vue", "@void/svelte", "@void/solid"
|
|
281
292
|
|
|
282
|
-
const result = await action('/users
|
|
293
|
+
const result = await action('/users/[id]?delete', {
|
|
283
294
|
params: { id: '42' },
|
|
284
295
|
method: 'DELETE',
|
|
285
296
|
});
|
|
@@ -298,7 +309,17 @@ A successful call returns `{ ok: true, pageData }`. Expected errors, such as val
|
|
|
298
309
|
|
|
299
310
|
Expected errors such as `400`, `404`, `409`, `422`, and `429` stay with the form or action call. `useForm` stores them in `form.errors` or `form.error`; `action()` returns `{ ok: false, error }`.
|
|
300
311
|
|
|
301
|
-
|
|
312
|
+
By default, authentication errors (`401`, `403`) and server errors (`500`, `502`) are thrown. Handle them with your framework's error boundary or error handling.
|
|
313
|
+
|
|
314
|
+
To handle all HTTP failures inline, pass `throwOnError: false` to `useForm()`. Validation errors still populate `form.errors`; other HTTP failures populate `form.error`, keeping the form and its input visible. The `Form` component displays the error automatically. In React, `onError` also receives these failures.
|
|
315
|
+
|
|
316
|
+
```ts
|
|
317
|
+
import { useForm } from '@void/react'; // or "@void/vue", "@void/svelte", "@void/solid"
|
|
318
|
+
|
|
319
|
+
const form = useForm('/users', { name: '', email: '' }, { throwOnError: false });
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Unexpected failures, such as network errors, still throw. Cancelled submissions do not set a form error.
|
|
302
323
|
|
|
303
324
|
Use `isVoidActionError()` to tell a failed action apart from other errors. It's `true` for a `VoidActionError` at any status, and narrows the error so you can read `status` and `message`. `isCallSiteActionError()` is `true` only for the expected errors that `action()` returns.
|
|
304
325
|
|
|
@@ -360,8 +381,8 @@ export default function Upload() {
|
|
|
360
381
|
|
|
361
382
|
```vue [Vue]
|
|
362
383
|
<script setup lang="ts">
|
|
363
|
-
import { ref } from 'vue';
|
|
364
384
|
import { Form, useForm } from '@void/vue';
|
|
385
|
+
import { ref } from 'vue';
|
|
365
386
|
|
|
366
387
|
const form = useForm('/photos', { title: '', photo: null as File | null });
|
|
367
388
|
const fileInput = ref<HTMLInputElement>();
|
|
@@ -440,6 +461,8 @@ export const action = defineHandler(async (c) => {
|
|
|
440
461
|
});
|
|
441
462
|
```
|
|
442
463
|
|
|
464
|
+
`withValidator({ body })` accepts the same upload. Nested names such as `profile[name]`, `tags[0]`, and `tags[]` are objects and arrays again. A multipart schema has to coerce the rest: booleans arrive as `'1'` or `'0'`, numbers and dates as strings, and `null` as `''`.
|
|
465
|
+
|
|
443
466
|
Pick the storage key on the server and allow only the file types you expect. See [Serving Files](../storage.md#serving-files) to send them back safely.
|
|
444
467
|
|
|
445
468
|
## Choosing a Primitive
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Show not-found and error states inside your layouts with _not-found and _error components.'
|
|
3
|
+
outline: deep
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Not Found & Errors
|
|
7
|
+
|
|
8
|
+
Add `_not-found` and `_error` components to `pages/` to show errors inside your app's layouts. Both receive an `error` prop with `status` and `message`.
|
|
9
|
+
|
|
10
|
+
::: code-group
|
|
11
|
+
|
|
12
|
+
```tsx [React]
|
|
13
|
+
// pages/_error.tsx (or pages/_not-found.tsx)
|
|
14
|
+
import type { ErrorPageProps } from '@void/react';
|
|
15
|
+
|
|
16
|
+
export default function ErrorPage({ error }: ErrorPageProps) {
|
|
17
|
+
return (
|
|
18
|
+
<main>
|
|
19
|
+
<h1>{error.status}</h1>
|
|
20
|
+
<p>{error.message}</p>
|
|
21
|
+
<a href="/">Go home</a>
|
|
22
|
+
</main>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```vue [Vue]
|
|
28
|
+
<!-- pages/_error.vue (or pages/_not-found.vue) -->
|
|
29
|
+
<script setup lang="ts">
|
|
30
|
+
import type { ErrorPageProps } from '@void/vue';
|
|
31
|
+
|
|
32
|
+
defineProps<ErrorPageProps>();
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<main>
|
|
37
|
+
<h1>{{ error.status }}</h1>
|
|
38
|
+
<p>{{ error.message }}</p>
|
|
39
|
+
<a href="/">Go home</a>
|
|
40
|
+
</main>
|
|
41
|
+
</template>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```svelte [Svelte]
|
|
45
|
+
<!-- pages/_error.svelte (or pages/_not-found.svelte) -->
|
|
46
|
+
<script lang="ts">
|
|
47
|
+
import type { ErrorPageProps } from '@void/svelte';
|
|
48
|
+
|
|
49
|
+
let { error }: ErrorPageProps = $props();
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<main><h1>{error.status}</h1><p>{error.message}</p><a href="/">Go home</a></main>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```tsx [Solid]
|
|
56
|
+
// pages/_error.tsx (or pages/_not-found.tsx)
|
|
57
|
+
import type { ErrorPageProps } from '@void/solid';
|
|
58
|
+
|
|
59
|
+
export default function ErrorPage(props: ErrorPageProps) {
|
|
60
|
+
return (
|
|
61
|
+
<main>
|
|
62
|
+
<h1>{props.error.status}</h1>
|
|
63
|
+
<p>{props.error.message}</p>
|
|
64
|
+
<a href="/">Go home</a>
|
|
65
|
+
</main>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
:::
|
|
71
|
+
|
|
72
|
+
`_not-found` handles a page loader returning a 404 or throwing `HTTPException(404)`. A root `pages/_not-found` also handles URLs that don't match a page or API route. Returning a 404 is the same in all four adapters:
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
// pages/products/[id].server.ts
|
|
76
|
+
import { defineHandler } from 'void/handler';
|
|
77
|
+
|
|
78
|
+
export const loader = defineHandler((c) => c.notFound());
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`_error` handles unexpected loader and rendering failures. Unexpected errors use generic production messages; server details stay in your logs. Development shows the error message. Action errors that reach a client boundary retain their HTTP status and public message. Explicit responses such as redirects, authentication failures, and API errors keep their existing behavior.
|
|
82
|
+
|
|
83
|
+
Calling `c.notFound()` in middleware invokes the app's not-found handler, which uses the root `pages/_not-found`. It doesn't select a nested boundary or run the page loader. To send your own 404 response from middleware, return a response such as `c.text('Not Found', 404)`; Void leaves it unchanged.
|
|
84
|
+
|
|
85
|
+
## Nested errors
|
|
86
|
+
|
|
87
|
+
Put a boundary in a subdirectory to customize that section. The closest boundary wins, keeping its layout and outer layouts. A layout's own rendering failure goes to a boundary outside that layout. If an error component fails, Void tries an outer boundary, then its built-in error page.
|
|
88
|
+
|
|
89
|
+
Boundary components don't have `.server` companions, actions, or their own `layout` export. They aren't routes: `/error` and `/not-found` remain available for ordinary pages. `.dev` and `.prod` variants work like other Pages components.
|
|
90
|
+
|
|
91
|
+
## Recovery
|
|
92
|
+
|
|
93
|
+
Client rendering errors use the framework's error boundaries. Event handlers, detached async tasks, and independent islands keep the framework's normal error handling. Deferred props retain each adapter's usual behavior: React can throw a rejected deferred promise during rendering; Vue, Svelte, and Solid expose its error state for your component to display.
|
|
94
|
+
|
|
95
|
+
Use `useRouter().refresh()` in an interactive error component to retry the current page's GET loader. It bypasses Void's client page cache and never repeats a form submission. A regular link or document reload also works. Error responses aren't stored in the client page cache.
|
|
96
|
+
|
|
97
|
+
## Rendering modes
|
|
98
|
+
|
|
99
|
+
`ssr = false` pages show their error component in the browser. Island pages render error documents on the server; they don't gain a client router. Boundary components should work with the same shared context as the page they replace.
|
|
100
|
+
|
|
101
|
+
With `output: 'static'`, a root `_not-found` produces `404.html` unless an explicit 404 document already exists. It renders with empty shared data and parameters, without request middleware or client hydration. Keep that component and its layouts usable without a signed-in user or other request data. Your static host controls the response status for unknown URLs.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Set a page title and metadata with head(), middleware, or site-wide defaults.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -13,13 +14,15 @@ Export a `head()` function from your `.server.ts` file. It receives the Hono con
|
|
|
13
14
|
```ts
|
|
14
15
|
// pages/posts/[slug].server.ts
|
|
15
16
|
import { defineHandler, defineHead } from 'void';
|
|
17
|
+
import type { PageParams } from 'void/routes';
|
|
16
18
|
|
|
17
19
|
export interface Props {
|
|
18
20
|
post: { title: string; excerpt: string; slug: string };
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
export const loader = defineHandler<Props>(async (c) => {
|
|
22
|
-
const
|
|
24
|
+
const { slug } = c.req.param() as PageParams<'/posts/[slug]'>;
|
|
25
|
+
const post = await getPost(slug);
|
|
23
26
|
return { post };
|
|
24
27
|
});
|
|
25
28
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Add interactive components to a server-rendered page. Only those islands send JavaScript to the browser.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -344,7 +345,7 @@ export default function PostForm() {
|
|
|
344
345
|
|
|
345
346
|
:::
|
|
346
347
|
|
|
347
|
-
`useIslandForm` provides the same form state as [`useForm`](./actions-and-forms#useform). Pass the action URL to `post`, `put`, `patch`, or `delete` to submit.
|
|
348
|
+
`useIslandForm` provides the same form state as [`useForm`](./actions-and-forms#useform). Pass the action URL to `post`, `put`, `patch`, or `delete` to submit. With [`routing.typedRoutes`](../type-safety.md#checked-url-strings), that URL is a [`RouteUrl`](../../reference/api/types.md#route-types). Cast a path built at runtime with `as RouteUrl`.
|
|
348
349
|
|
|
349
350
|
Successful submissions reload the page; redirects navigate to their destination. A `422` response populates `errors` from `{ errors: { field: "message" } }`. Submit helpers return `Promise<void>`.
|
|
350
351
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Share navigation and other UI across pages. Layouts nest with your directories and keep their state during navigation.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -216,6 +217,8 @@ A named layout replaces the deepest default layout: in `[root, docs/layout]`, it
|
|
|
216
217
|
|
|
217
218
|
Void uses the closest matching `_layouts/` file in the page's directory or an ancestor. A missing named layout fails the build.
|
|
218
219
|
|
|
220
|
+
Declare `layout` in the page file itself with a string literal or `false`. Void reads it without running the page, so it ignores a computed or re-exported value and prints a warning.
|
|
221
|
+
|
|
219
222
|
## Shared Data
|
|
220
223
|
|
|
221
224
|
Middleware can inject data available on every page via `c.set("shared", {...})`. Augment `CloudContextVariables` to type the shared data, and `useShared()` will infer the type automatically:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: "Load a page's data in a companion .server.ts file. The component receives that data as typed props."
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -26,6 +27,8 @@ export const loader = defineHandler(async (c) => {
|
|
|
26
27
|
|
|
27
28
|
`InferProps` infers the loader’s return type, so page props stay in sync with the data it returns.
|
|
28
29
|
|
|
30
|
+
Void preserves `Date`, `Map`, `Set`, `bigint`, `RegExp`, `URL`, `undefined`, and repeated or cyclic references in page props and shared data. These values keep their types during server rendering, hydration, navigation, and deferred loading. Return data directly from your loader; explicitly returning `Response.json()` uses ordinary JSON conversion instead. Functions and custom class instances cannot be sent as page data.
|
|
31
|
+
|
|
29
32
|
## Using the Data in Page Components
|
|
30
33
|
|
|
31
34
|
The page component receives the loader's result as props. Export the inferred type from the server file so the component stays in sync:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: 'Add Markdown files in pages/ as routes. They inherit layouts and ship JavaScript only for islands and client scripts.'
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -136,13 +137,13 @@ Welcome to Void. Here's an interactive demo:
|
|
|
136
137
|
<Counter />
|
|
137
138
|
```
|
|
138
139
|
|
|
139
|
-
- **`<script>` block:** extracted before markdown compilation. Island imports use `with { island: "..." }` syntax (see [islands](./islands)). Any other code in the block becomes a [client script](#client-scripts) that runs in the browser.
|
|
140
|
+
- **`<script>` block:** extracted before markdown compilation. Island imports use `with { island: "..." }` syntax (see [islands](./islands)). The component file uses your framework's extension (`.vue`, `.tsx`, or `.svelte`). Any other code in the block becomes a [client script](#client-scripts) that runs in the browser.
|
|
140
141
|
- **Frontmatter:** YAML metadata between `---` fences. Layouts and islands can read it through [`useFrontmatter()`](#frontmatter-access).
|
|
141
142
|
- **Body:** standard markdown plus GFM. Uppercase tags such as `<Counter />` reference imported components and render as islands.
|
|
142
143
|
|
|
143
144
|
## Client Scripts
|
|
144
145
|
|
|
145
|
-
Use the `<script>` block for island imports and JavaScript that runs when the page loads:
|
|
146
|
+
Use the `<script>` block for island imports and JavaScript that runs when the page loads. Import the component with your framework's extension (`.vue`, `.tsx`, or `.svelte`):
|
|
146
147
|
|
|
147
148
|
```md
|
|
148
149
|
<script>
|
|
@@ -194,7 +195,6 @@ export default function DocsLayout({ children }) {
|
|
|
194
195
|
import { useFrontmatter } from '@void/md';
|
|
195
196
|
|
|
196
197
|
const fm = useFrontmatter();
|
|
197
|
-
// fm.title, fm.description, etc.
|
|
198
198
|
</script>
|
|
199
199
|
|
|
200
200
|
<template>
|