void 1.5.0 → 1.6.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-ChVKPZ-w.mjs → account-cmd-DRhmCWcm.mjs} +3 -3
- package/dist/{application-analysis-2vGZrKzg.mjs → application-analysis-HRFsZOv3.mjs} +3 -3
- package/dist/{application-routing-DnUQoOJD.mjs → application-routing-P4TggvWp.mjs} +1 -1
- package/dist/{auth-link-D4uMdOsw.mjs → auth-link-CVXP1G6G.mjs} +3 -3
- package/dist/{auth-router-62dna450.mjs → auth-router-D1pGdbvB.mjs} +2 -2
- package/dist/{better-auth-shared-CiclgPde.mjs → better-auth-shared-C958aM7W.mjs} +28 -3
- package/dist/{build-cmd-D93K_4Sa.mjs → build-cmd-DmjbuT6d.mjs} +1 -1
- package/dist/{cache-CiIzEED4.mjs → cache-2khBO1MR.mjs} +1 -1
- package/dist/{cancel-deploy-BNoGfn2e.mjs → cancel-deploy-_itbbvY3.mjs} +1 -1
- package/dist/cli/cli.mjs +27 -27
- package/dist/client-CEtr5UOR.mjs +1 -0
- package/dist/{client-Qayy9xEh.mjs → client-CoxPEhJq.mjs} +6 -2
- package/dist/{cloudflare-cmd-DiFGaLow.mjs → cloudflare-cmd-fZ6AMSWk.mjs} +1 -1
- package/dist/{cloudflare-config-Chet188_.mjs → cloudflare-config-eQunqX6A.mjs} +1 -1
- package/dist/{cloudflare-connect-BdgAQBc7.mjs → cloudflare-connect-9OZe4XVQ.mjs} +1 -1
- package/dist/{cloudflare-operations-CWA24vCh.mjs → cloudflare-operations-CrskD4_O.mjs} +4 -4
- package/dist/{cloudflare-operations-D8MoezuN.mjs → cloudflare-operations-oLvAd9Nd.mjs} +1 -1
- package/dist/{config-Bt4rw93x.mjs → config-BBlVXZCU.mjs} +1 -1
- package/dist/{config-DkA9jYF2.mjs → config-BITKQ3O6.mjs} +2 -1
- package/dist/{config-BszFVhpk.mjs → config-BgysUhnm.mjs} +1 -1
- package/dist/{config-CzsNzGVH.d.mts → config-CPxJmt4M.d.mts} +2 -0
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-b9mJbb6X.mjs → connect-CKvmkl2R.mjs} +4 -4
- package/dist/{create-project-rnjum4_V.mjs → create-project-BiMmR5wA.mjs} +1 -1
- package/dist/{create-project-eomwm0wa.mjs → create-project-Bq0M8MtO.mjs} +1 -1
- package/dist/{db-UPWmiSk1.mjs → db-cq5RW4Vy.mjs} +17 -17
- package/dist/{delete-BeeYi1WO.mjs → delete-CY4L8fi2.mjs} +1 -1
- package/dist/deploy-B029oHlE.mjs +2 -0
- package/dist/{deploy-CwmCcTlq.mjs → deploy-D_gEojD2.mjs} +79 -42
- package/dist/{deploy-managed-static-gPDxyp3v.mjs → deploy-managed-static-BHVbB_-A.mjs} +11 -11
- package/dist/{deploy-transport-L6zzPE9T.mjs → deploy-transport-DEyOUfac.mjs} +2 -2
- package/dist/deploy.mjs +5 -4
- package/dist/{dev-inbox-CwH5VuZj.mjs → dev-inbox-CUUS6iUg.mjs} +1 -1
- package/dist/{dispatch-CiJ1Xrba.mjs → dispatch-BNLB5_Gm.mjs} +1 -1
- package/dist/{domain-3xdH9p2L.mjs → domain-BlH90Ods.mjs} +2 -2
- package/dist/{email-Du3YRnM5.mjs → email-Bkq8ZL1p.mjs} +6 -6
- package/dist/{email-cloudflare-CtD8qE13.mjs → email-cloudflare-MvJIxrwx.mjs} +5 -107
- package/dist/{env-Cnvp0pGy.mjs → env-AvuCSeCH.mjs} +2 -2
- package/dist/{gen-BvVmpZ5f.mjs → gen-BD-dfjxY.mjs} +3 -3
- package/dist/gen-CIHXh9I8.mjs +1 -0
- package/dist/{github-cmd-X2GKiLi-.mjs → github-cmd-CA-lBdkn.mjs} +1 -1
- package/dist/{handler-Drm_lyrV.d.mts → handler-BR6Tvjkp.d.mts} +8 -3
- package/dist/{handler-xmzz0U38.mjs → handler-CKeTtYID.mjs} +2 -12
- package/dist/headers-CuTEdP9C.mjs +445 -0
- package/dist/{help-EWDNxST-.mjs → help-1OCFDsRr.mjs} +9 -1
- package/dist/help-Ba8Dq5-r.mjs +1 -0
- package/dist/{inbound-DSKSHDUj.d.mts → inbound-BHt4dIlL.d.mts} +16 -5
- package/dist/{inbound-DQfekMtz.mjs → inbound-CdO-qY0w.mjs} +2 -76
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +65 -37
- package/dist/{info-jW8_d3VI.mjs → info-CJxua_db.mjs} +4 -4
- package/dist/{init-jDQ5G9QC.mjs → init-B-4CluYx.mjs} +12 -11
- package/dist/{isr-config-DhBkzCdY.mjs → isr-config-Czzb4mIq.mjs} +1 -47
- package/dist/{link-DOyxX5Xs.mjs → link-DAXOT-G_.mjs} +2 -2
- package/dist/{list-C9pTYDtl.mjs → list-BYSOo9fm.mjs} +2 -2
- package/dist/{live-CDBHyYiR.d.mts → live-0xrcVpyq.d.mts} +1 -1
- package/dist/{local-d1-CKfek6Z4.mjs → local-d1-BLgsNUj9.mjs} +1 -1
- package/dist/login-BpbYeu-n.mjs +1 -0
- package/dist/{login-koQbjzPd.mjs → login-CJopTWX4.mjs} +2 -2
- package/dist/{logs-cTU5TsRW.mjs → logs-DE0weBsR.mjs} +13 -11
- package/dist/{migrate-C62pGTfr.mjs → migrate-ChHHZBTi.mjs} +3 -3
- package/dist/migrate-HdA6Kh2p.mjs +1 -0
- package/dist/{mime-DKkO7ZtA.mjs → mime-CtP6-qAF.mjs} +143 -15
- package/dist/nitro.mjs +3 -3
- package/dist/{node-BfAt2rz8.mjs → node-CZ6lGNLn.mjs} +1 -1
- package/dist/{operator-cmd-CnAvSqJ5.mjs → operator-cmd-BUqsdk2K.mjs} +28 -10
- package/dist/operator-cmd-wBYyp8iQ.mjs +1 -0
- package/dist/pages/client.d.mts +143 -11
- package/dist/pages/client.mjs +173 -12
- package/dist/pages/index.d.mts +22 -3
- package/dist/pages/index.mjs +18 -4
- package/dist/pages/islands-plugin.d.mts +46 -2
- package/dist/pages/islands-plugin.mjs +91 -5
- package/dist/pages/prefetch.d.mts +2 -2
- package/dist/pages/prefetch.mjs +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -2
- package/dist/platform-args-C7XUw9mw.mjs +1 -0
- package/dist/{platform-args-Bv9hoLEL.mjs → platform-args-Cx1M-7bq.mjs} +18 -4
- package/dist/{platform-auth-config-CLj0EvnB.mjs → platform-auth-config-K4m_LE8b.mjs} +4 -4
- package/dist/{platform-auth-protection-DQDSxVhr.mjs → platform-auth-protection-KF5Vo-1I.mjs} +2 -2
- package/dist/{platform-auth-recovery-DD3oLerq.mjs → platform-auth-recovery-BOdFrl7R.mjs} +2 -2
- package/dist/{platform-cmd-WnOmdLzR.mjs → platform-cmd-DpCHawGF.mjs} +1 -1
- package/dist/{platform-cmd-PLNLg-2N.mjs → platform-cmd-Ds3EAV5t.mjs} +5 -4
- package/dist/{platform-domain-Bnq0vg0q.mjs → platform-domain-rWJshybd.mjs} +2 -2
- package/dist/{platform-lifecycle-BQiN9HN5.mjs → platform-lifecycle-BH34I0rh.mjs} +1 -1
- package/dist/{platform-lifecycle-BCsFg1Tl.mjs → platform-lifecycle-D9RdGub1.mjs} +66 -31
- package/dist/{platform-management-nzCDwtiN.mjs → platform-management-BRefdHGD.mjs} +21 -3
- package/dist/{platform-management-CMJR8Zi-.mjs → platform-management-BfLW0Zlo.mjs} +1 -1
- package/dist/{platform-recovery-DBNoME3I.mjs → platform-recovery-DZuZGJtt.mjs} +2 -2
- package/dist/platform-runtime-logs-CdJGnk3f.mjs +68 -0
- package/dist/{platform-setup-VEcHu0Vq.mjs → platform-setup-Vw1AaUN8.mjs} +15 -2
- package/dist/{plugin-inference-DmwjC3y2.mjs → plugin-inference-CdLbxZL_.mjs} +1 -1
- package/dist/{prefetch-L93_1Jk7.mjs → prefetch-Dx2jIbtg.mjs} +19 -1
- package/dist/{prefetch-CG0K6JPd.d.mts → prefetch-NdNeubbH.d.mts} +7 -1
- package/dist/{prepare-pfl2LIMy.mjs → prepare-BJW-f1f1.mjs} +4 -4
- package/dist/{prepare-BPsfLWaW.mjs → prepare-BMGeKL16.mjs} +1 -1
- package/dist/prepare-BdxJJCMv.mjs +1 -0
- package/dist/{project-cmd-5Izu4Pg3.mjs → project-cmd-B_bUyZ3J.mjs} +15 -15
- package/dist/{project-team-DSUyjZFh.mjs → project-team-MjT5K4rQ.mjs} +1 -1
- package/dist/{project-token-wj09YQSB.mjs → project-token-BKHGwY3k.mjs} +1 -1
- package/dist/{project-zero-trust-BMHf2YF0.mjs → project-zero-trust-Bzdd05-h.mjs} +1 -1
- package/dist/{protocol-0-lp9ZYx.mjs → protocol-COyySMki.mjs} +130 -107
- package/dist/{protocol-xdrl-In0.d.mts → protocol-CkwjASep.d.mts} +2 -2
- package/dist/{provision-CRiNnlfE.mjs → provision-BbCzpbXs.mjs} +1 -1
- package/dist/{provision-CxHIGBIZ.mjs → provision-DQF6Kw-6.mjs} +1 -1
- package/dist/{requests-DicgB5jU.mjs → requests-daJmVpjk.mjs} +1 -1
- package/dist/{rollback-DrDZOKNE.mjs → rollback-BgL0wY1J.mjs} +2 -2
- package/dist/{route-types-irZc1txT.mjs → route-types-CZc1YXjF.mjs} +40 -4
- package/dist/route-url-C_YIH_zO.d.mts +37 -0
- package/dist/routes-stub.d.mts +6 -2
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/email/testing.d.mts +1 -1
- package/dist/runtime/email/testing.mjs +3 -3
- package/dist/runtime/email.d.mts +1 -1
- package/dist/runtime/email.mjs +3 -3
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +2 -2
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/route-url.d.mts +2 -2
- package/dist/runtime/routing.d.mts +3 -3
- package/dist/runtime/routing.mjs +37 -16
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +1 -1
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/{scan-DSQtH3oS.mjs → scan-X2rDDRNa.mjs} +18 -10
- package/dist/{secret-C_QtTzJG.mjs → secret-CPq-B_vp.mjs} +2 -2
- package/dist/{static-asset-marker-NR1XS2z5.mjs → static-asset-marker-DsQKz6lt.mjs} +8 -1
- package/dist/validation-error-uAAjlsiW.mjs +82 -0
- package/dist/{version-metadata-Blf5H9BQ.mjs → version-metadata-C8hLzQkv.mjs} +1 -1
- package/dist/{wrangler-p-kLCJqF.mjs → wrangler-DESSbN8L.mjs} +2 -2
- package/dist/wrangler-DUB3MGHV.mjs +1 -0
- package/dist/{wrapper-iejSJDwL.mjs → wrapper-C9SUxoj7.mjs} +2 -2
- package/dist/{ws-DzBD-NUj.d.mts → ws-Dmjg5NH2.d.mts} +1 -1
- package/docs/guide/edge/headers.md +2 -0
- package/docs/guide/edge/rewrites.md +1 -1
- package/docs/guide/email/receiving.md +1 -1
- package/docs/guide/email/sending.md +42 -12
- package/docs/guide/pages-routing/actions-and-forms.md +21 -1
- package/docs/guide/pages-routing/islands.md +3 -3
- package/docs/guide/pages-routing/layouts.md +16 -2
- package/docs/guide/pages-routing/loaders.md +2 -2
- package/docs/guide/pages-routing/markdown.md +1 -1
- package/docs/guide/pages-routing/overview.md +103 -0
- package/docs/guide/platform/administration/connected-apps.md +4 -2
- package/docs/guide/platform/installation/credentials.md +6 -4
- package/docs/guide/platform/installation/maintenance.md +13 -0
- package/docs/guide/platform/installation/setup.md +22 -1
- package/docs/guide/ssg.md +3 -3
- package/docs/guide/type-safety.md +42 -1
- package/docs/integrations/frameworks/astro.md +17 -12
- package/docs/integrations/frameworks/overview.md +2 -2
- package/docs/reference/api/pages.md +101 -50
- package/docs/reference/api/rewrites.md +4 -1
- package/docs/reference/api/types.md +14 -10
- package/docs/reference/api.md +1 -1
- package/docs/reference/cli/platform-installation.md +4 -1
- package/docs/reference/cli/setup.md +1 -1
- package/docs/reference/config.md +10 -0
- package/package.json +8 -7
- package/schema.json +4 -0
- package/skills/void/SKILL.md +5 -0
- package/dist/client-DVtAKeUm.mjs +0 -1
- package/dist/deploy-CfU7CR-b.mjs +0 -2
- package/dist/gen-i61rdQgg.mjs +0 -1
- package/dist/headers-DEUBAM6W.mjs +0 -225
- package/dist/help-BcZDUcTw.mjs +0 -1
- package/dist/login-C0MiQrYs.mjs +0 -1
- package/dist/migrate-BG09-KOv.mjs +0 -1
- package/dist/operator-cmd-BhHXIL2G.mjs +0 -1
- package/dist/platform-args-C1kqYUen.mjs +0 -1
- package/dist/prepare-BJMmfq3W.mjs +0 -1
- package/dist/route-url-BGOiyKNz.d.mts +0 -24
- package/dist/validation-error-rDVbUJet.mjs +0 -47
- package/dist/wrangler-CPRX2d9A.mjs +0 -1
|
@@ -8,12 +8,42 @@ Framework adaptors for [Pages Routing](../../guide/pages-routing/overview). Each
|
|
|
8
8
|
|
|
9
9
|
## Navigation destinations {#navigation-destinations}
|
|
10
10
|
|
|
11
|
-
All four adapters support typed URLs through [`routeUrl()`](./types.md#routeurl-path-options). Pass the returned string to `Link`'s `href
|
|
11
|
+
All four adapters support typed URLs through [`routeUrl()`](./types.md#routeurl-path-options). Pass the returned string to `Link`'s `href`, which has the type [`Href`](./types.md#route-types).
|
|
12
12
|
|
|
13
13
|
The router's `visit(destination, options?)`, `prefetch(destination, options?)`, and `flush(destination, method?)` accept [`RouteUrlInput`](./types.md#route-types): a string, `URL`, or typed destination object.
|
|
14
14
|
|
|
15
|
+
With [`routing.typedRoutes`](../config.md#routing-typedroutes), `href` and router strings must match one of your routes, or be a same-page or external URL. Without it, both accept any string.
|
|
16
|
+
|
|
15
17
|
See [Typed navigation](../../guide/pages-routing/overview.md#typed-navigation) for framework examples.
|
|
16
18
|
|
|
19
|
+
## Prefetching {#prefetching}
|
|
20
|
+
|
|
21
|
+
`Link`'s `prefetch` prop takes `true`, `false`, a strategy, or an array of strategies:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
type LinkPrefetchStrategy = 'hover' | 'click' | 'mount' | 'visible';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Value | Loads the page |
|
|
28
|
+
| ------------------- | --------------------------------------------------------------------------------------------- |
|
|
29
|
+
| `'hover'` or `true` | When the pointer rests on the link for `hoverDelay`, when it gets keyboard focus, or on touch |
|
|
30
|
+
| `'click'` | When the mouse button or finger goes down, just before the click |
|
|
31
|
+
| `'mount'` | As soon as the link renders |
|
|
32
|
+
| `'visible'` | Once the link has stayed in view for 300 ms. Links scrolled quickly past are skipped |
|
|
33
|
+
| `false` | Never |
|
|
34
|
+
|
|
35
|
+
With an array such as `['visible', 'hover']`, the first strategy to happen loads the page, and later ones reuse it. `prefetch` works only on GET links, and links to other sites are never prefetched. No strategy prefetches while the browser reports data saver or a 2G connection, which only Chromium-based browsers report; calling `router.prefetch()` yourself still loads the page.
|
|
36
|
+
|
|
37
|
+
`cacheFor` sets how long a prefetched page is reused, in milliseconds or as a duration such as `'5m'`. A pair such as `['30s', '5m']` treats the page as fresh for 30 seconds, then still shows it for up to 5 minutes while loading a fresh copy in the background.
|
|
38
|
+
|
|
39
|
+
Each adapter plugin's `prefetch` option sets app-wide values:
|
|
40
|
+
|
|
41
|
+
| Option | Default | Description |
|
|
42
|
+
| ----------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `defaultStrategy` | `false` | The `prefetch` value for every `Link` that doesn't set its own. A `Link`'s own `prefetch` replaces it, and `prefetch={false}` turns it off. Links with a non-GET `method` or `reloadDocument` don't use it. |
|
|
44
|
+
| `hoverDelay` | `75` | Milliseconds the pointer rests on a link before `'hover'` prefetches. |
|
|
45
|
+
| `cacheFor` | `'30s'` | The `cacheFor` value for every `Link` that doesn't set its own. |
|
|
46
|
+
|
|
17
47
|
## `@void/vue` {#void-vue}
|
|
18
48
|
|
|
19
49
|
### `voidVue(options?)` {#voidvue-options}
|
|
@@ -41,8 +71,9 @@ interface VoidVueOptions {
|
|
|
41
71
|
vue?: VuePluginOptions; // passed through to @vitejs/plugin-vue
|
|
42
72
|
viewTransitions?: boolean; // enable View Transitions API for navigations
|
|
43
73
|
prefetch?: {
|
|
44
|
-
|
|
45
|
-
|
|
74
|
+
defaultStrategy?: boolean | LinkPrefetchStrategy | LinkPrefetchStrategy[]; // default: false
|
|
75
|
+
hoverDelay?: number; // default: 75 (ms)
|
|
76
|
+
cacheFor?: number | string | [string, string]; // default: '30s'
|
|
46
77
|
};
|
|
47
78
|
}
|
|
48
79
|
```
|
|
@@ -51,16 +82,16 @@ interface VoidVueOptions {
|
|
|
51
82
|
|
|
52
83
|
Imported from `"@void/vue"`.
|
|
53
84
|
|
|
54
|
-
| Export | Description
|
|
55
|
-
| ---------------------------------- |
|
|
56
|
-
| `Link` | Vue component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `onNavigate`. |
|
|
57
|
-
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`.
|
|
58
|
-
| `useParams()` | Returns dynamic route params for the page currently being rendered.
|
|
59
|
-
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination.
|
|
60
|
-
| `useForm(url, defaults, options?)` | Typed reactive form helper bound to a page action URL. Returns `{ data, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, setError, clearErrors, clearError }`.
|
|
61
|
-
| `useIslandForm(defaults)` | Form helper for island components. Same form state as `useForm()`, plus `submit(url, method)`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`.
|
|
62
|
-
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an `ActionResult`.
|
|
63
|
-
| `useShared()` | Returns shared data
|
|
85
|
+
| Export | Description |
|
|
86
|
+
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
87
|
+
| `Link` | Vue component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `activeMatch`, `onNavigate`. Adds `aria-current="page"` and `data-void-active` to the link to the current page ([active links](../../guide/pages-routing/overview.md#active-links)), and `data-void-pending` to links to a page while it loads ([pending links](../../guide/pages-routing/overview.md#pending-links)). |
|
|
88
|
+
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`. |
|
|
89
|
+
| `useParams()` | Returns dynamic route params for the page currently being rendered. |
|
|
90
|
+
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination. |
|
|
91
|
+
| `useForm(url, defaults, options?)` | Typed reactive form helper bound to a page action URL. Returns `{ data, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, setError, clearErrors, clearError }`. |
|
|
92
|
+
| `useIslandForm(defaults)` | Form helper for island components. Same form state as `useForm()`, plus `submit(url, method)`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`. |
|
|
93
|
+
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params, preserveScroll }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an `ActionResult`. |
|
|
94
|
+
| `useShared()` | Returns shared data. Middleware sets it with `c.set("shared", {...})`; a loader or action can update it. See [Shared data](../../guide/pages-routing/layouts.md#shared-data). |
|
|
64
95
|
|
|
65
96
|
Vue `Link` GET `data` is merged into the rendered `href` query string. Primitive values are serialized with `String(value)`, arrays become repeated keys, `null` and `undefined` are omitted, and nested objects throw. `prefetch` and `reloadDocument` are GET-only and throw for mutation links.
|
|
66
97
|
|
|
@@ -93,8 +124,9 @@ interface VoidReactOptions {
|
|
|
93
124
|
react?: ReactPluginOptions; // passed through to @vitejs/plugin-react
|
|
94
125
|
viewTransitions?: boolean; // enable View Transitions API for navigations
|
|
95
126
|
prefetch?: {
|
|
96
|
-
|
|
97
|
-
|
|
127
|
+
defaultStrategy?: boolean | LinkPrefetchStrategy | LinkPrefetchStrategy[]; // default: false
|
|
128
|
+
hoverDelay?: number; // default: 75 (ms)
|
|
129
|
+
cacheFor?: number | string | [string, string]; // default: '30s'
|
|
98
130
|
};
|
|
99
131
|
}
|
|
100
132
|
```
|
|
@@ -103,17 +135,17 @@ interface VoidReactOptions {
|
|
|
103
135
|
|
|
104
136
|
Imported from `"@void/react"`.
|
|
105
137
|
|
|
106
|
-
| Export | Description
|
|
107
|
-
| ---------------------------------- |
|
|
108
|
-
| `Link` | React component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `onNavigate`. |
|
|
109
|
-
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`. React navigations are scheduled as transitions.
|
|
110
|
-
| `useParams()` | Returns dynamic route params for the page currently being rendered.
|
|
111
|
-
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination.
|
|
112
|
-
| `useForm(url, defaults, options?)` | Form helper hook. Returns `{ data, setData, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, setError, clearErrors, clearError }`.
|
|
113
|
-
| `useIslandForm(defaults)` | Form helper hook for island components. Same form state as `useForm()`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`.
|
|
114
|
-
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an `ActionResult`.
|
|
115
|
-
| `useShared()` | Returns shared data
|
|
116
|
-
| `Deferred<T>` | React-only prop type for `defer()` results. It is `Promise<T>` and is consumed with React `use()`.
|
|
138
|
+
| Export | Description |
|
|
139
|
+
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
140
|
+
| `Link` | React component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `activeMatch`, `onNavigate`. Adds `aria-current="page"` and `data-void-active` to the link to the current page ([active links](../../guide/pages-routing/overview.md#active-links)), and `data-void-pending` to links to a page while it loads ([pending links](../../guide/pages-routing/overview.md#pending-links)). |
|
|
141
|
+
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`. React navigations are scheduled as transitions. |
|
|
142
|
+
| `useParams()` | Returns dynamic route params for the page currently being rendered. |
|
|
143
|
+
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination. |
|
|
144
|
+
| `useForm(url, defaults, options?)` | Form helper hook. Returns `{ data, setData, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, setError, clearErrors, clearError }`. |
|
|
145
|
+
| `useIslandForm(defaults)` | Form helper hook for island components. Same form state as `useForm()`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`. |
|
|
146
|
+
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params, preserveScroll }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an `ActionResult`. |
|
|
147
|
+
| `useShared()` | Returns shared data. Middleware sets it with `c.set("shared", {...})`; a loader or action can update it. See [Shared data](../../guide/pages-routing/layouts.md#shared-data). |
|
|
148
|
+
| `Deferred<T>` | React-only prop type for `defer()` results. It is `Promise<T>` and is consumed with React `use()`. |
|
|
117
149
|
|
|
118
150
|
React `Link` GET `data` is merged into the rendered `href` query string. Primitive values are serialized with `String(value)`, arrays become repeated keys, `null` and `undefined` are omitted, and nested objects throw. `prefetch` and `reloadDocument` are GET-only and throw for mutation links.
|
|
119
151
|
|
|
@@ -128,6 +160,23 @@ When explicitly annotating props, import `Deferred` from the framework adapter
|
|
|
128
160
|
package (`@void/react`, `@void/vue`, `@void/svelte`, or `@void/solid`) so the
|
|
129
161
|
type matches that adapter's client runtime shape.
|
|
130
162
|
|
|
163
|
+
### React navigation completion {#react-navigation-completion}
|
|
164
|
+
|
|
165
|
+
By default, `await router.visit()` and `await router.refresh()` wait for React to commit the updated page and URL. You can also request this explicitly with `{ resolveOn: 'commit' }`.
|
|
166
|
+
|
|
167
|
+
When awaiting navigation inside `startTransition`, a `<form action>`, `useActionState`, or an async `useForm()` callback, pass `{ resolveOn: 'data' }`:
|
|
168
|
+
|
|
169
|
+
```tsx
|
|
170
|
+
startTransition(async () => {
|
|
171
|
+
await saveUser();
|
|
172
|
+
await router.refresh({ resolveOn: 'data' });
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
await router.visit('/account', { resolveOn: 'data' });
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
With `'data'`, the promise resolves when the destination's page data is ready, allowing the Action to finish while React renders the update. The transition can remain pending through Suspense. The DOM and URL may still show the previous page after `await`; use an effect or ref callback for work that requires the updated DOM.
|
|
179
|
+
|
|
131
180
|
## `@void/svelte` {#void-svelte}
|
|
132
181
|
|
|
133
182
|
### `voidSvelte(options?)` {#voidsvelte-options}
|
|
@@ -155,8 +204,9 @@ interface VoidSvelteOptions {
|
|
|
155
204
|
svelte?: SveltePluginOptions; // passed through to @sveltejs/vite-plugin-svelte
|
|
156
205
|
viewTransitions?: boolean; // enable View Transitions API
|
|
157
206
|
prefetch?: {
|
|
158
|
-
|
|
159
|
-
|
|
207
|
+
defaultStrategy?: boolean | LinkPrefetchStrategy | LinkPrefetchStrategy[]; // default: false
|
|
208
|
+
hoverDelay?: number; // default: 75 (ms)
|
|
209
|
+
cacheFor?: number | string | [string, string]; // default: '30s'
|
|
160
210
|
};
|
|
161
211
|
}
|
|
162
212
|
```
|
|
@@ -165,16 +215,16 @@ interface VoidSvelteOptions {
|
|
|
165
215
|
|
|
166
216
|
Imported from `"@void/svelte"`.
|
|
167
217
|
|
|
168
|
-
| Export | Description
|
|
169
|
-
| ---------------------------------- |
|
|
170
|
-
| `Link` | Svelte component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `onNavigate`. |
|
|
171
|
-
| `useForm(url, defaults, options?)` | Form helper using Svelte 5 runes. Returns `{ data, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, setError, clearErrors, clearError }`.
|
|
172
|
-
| `useIslandForm(defaults)` | Form helper for island components. Same form state as `useForm()`, plus `submit(url, method)`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`.
|
|
173
|
-
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an `ActionResult`.
|
|
174
|
-
| `useShared()` | Returns shared data
|
|
175
|
-
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`.
|
|
176
|
-
| `useParams()` | Returns dynamic route params for the page currently being rendered.
|
|
177
|
-
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination.
|
|
218
|
+
| Export | Description |
|
|
219
|
+
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
220
|
+
| `Link` | Svelte component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `activeMatch`, `onNavigate`. Adds `aria-current="page"` and `data-void-active` to the link to the current page ([active links](../../guide/pages-routing/overview.md#active-links)), and `data-void-pending` to links to a page while it loads ([pending links](../../guide/pages-routing/overview.md#pending-links)). |
|
|
221
|
+
| `useForm(url, defaults, options?)` | Form helper using Svelte 5 runes. Returns `{ data, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, setError, clearErrors, clearError }`. |
|
|
222
|
+
| `useIslandForm(defaults)` | Form helper for island components. Same form state as `useForm()`, plus `submit(url, method)`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`. |
|
|
223
|
+
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params, preserveScroll }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an `ActionResult`. |
|
|
224
|
+
| `useShared()` | Returns shared data. Middleware sets it with `c.set("shared", {...})`; a loader or action can update it. See [Shared data](../../guide/pages-routing/layouts.md#shared-data). |
|
|
225
|
+
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`. |
|
|
226
|
+
| `useParams()` | Returns dynamic route params for the page currently being rendered. |
|
|
227
|
+
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination. |
|
|
178
228
|
|
|
179
229
|
Svelte `Link` GET `data` is merged into the rendered `href` query string. Primitive values are serialized with `String(value)`, arrays become repeated keys, `null` and `undefined` are omitted, and nested objects throw. `prefetch` and `reloadDocument` are GET-only and throw for mutation links.
|
|
180
230
|
|
|
@@ -205,8 +255,9 @@ interface VoidSolidOptions {
|
|
|
205
255
|
solid?: SolidPluginOptions; // passed through to vite-plugin-solid
|
|
206
256
|
viewTransitions?: boolean; // enable View Transitions API
|
|
207
257
|
prefetch?: {
|
|
208
|
-
|
|
209
|
-
|
|
258
|
+
defaultStrategy?: boolean | LinkPrefetchStrategy | LinkPrefetchStrategy[]; // default: false
|
|
259
|
+
hoverDelay?: number; // default: 75 (ms)
|
|
260
|
+
cacheFor?: number | string | [string, string]; // default: '30s'
|
|
210
261
|
};
|
|
211
262
|
}
|
|
212
263
|
```
|
|
@@ -215,16 +266,16 @@ interface VoidSolidOptions {
|
|
|
215
266
|
|
|
216
267
|
Imported from `"@void/solid"`.
|
|
217
268
|
|
|
218
|
-
| Export | Description
|
|
219
|
-
| ---------------------------------- |
|
|
220
|
-
| `Link` | Solid component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `onNavigate`. |
|
|
221
|
-
| `useForm(url, defaults, options?)` | Form helper using Solid stores. Returns `{ data, setData, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, setError, clearErrors, clearError }`.
|
|
222
|
-
| `useIslandForm(defaults)` | Form helper for island components. Same form state as `useForm()`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`.
|
|
223
|
-
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an `ActionResult`.
|
|
224
|
-
| `useShared()` | Returns shared data
|
|
225
|
-
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`.
|
|
226
|
-
| `useParams()` | Returns dynamic route params for the page currently being rendered.
|
|
227
|
-
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination.
|
|
269
|
+
| Export | Description |
|
|
270
|
+
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
271
|
+
| `Link` | Solid component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `activeMatch`, `onNavigate`. Adds `aria-current="page"` and `data-void-active` to the link to the current page ([active links](../../guide/pages-routing/overview.md#active-links)), and `data-void-pending` to links to a page while it loads ([pending links](../../guide/pages-routing/overview.md#pending-links)). |
|
|
272
|
+
| `useForm(url, defaults, options?)` | Form helper using Solid stores. Returns `{ data, setData, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, setError, clearErrors, clearError }`. |
|
|
273
|
+
| `useIslandForm(defaults)` | Form helper for island components. Same form state as `useForm()`. `post(url)`, `put(url)`, `patch(url)`, and `delete(url)` take the action URL and submit with `fetch()`. |
|
|
274
|
+
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params, preserveScroll }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an `ActionResult`. |
|
|
275
|
+
| `useShared()` | Returns shared data. Middleware sets it with `c.set("shared", {...})`; a loader or action can update it. See [Shared data](../../guide/pages-routing/layouts.md#shared-data). |
|
|
276
|
+
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`. |
|
|
277
|
+
| `useParams()` | Returns dynamic route params for the page currently being rendered. |
|
|
278
|
+
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination. |
|
|
228
279
|
|
|
229
280
|
Solid `Link` GET `data` is merged into the rendered `href` query string. Primitive values are serialized with `String(value)`, arrays become repeated keys, `null` and `undefined` are omitted, and nested objects throw. `prefetch` and `reloadDocument` are GET-only and throw for mutation links.
|
|
230
281
|
|
|
@@ -20,6 +20,8 @@ return c.rewrite({
|
|
|
20
20
|
});
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
With [`routing.typedRoutes`](../config.md#routing-typedroutes), a string destination must be a [`RouteUrl`](./types.md#route-types): a URL that matches one of your routes. Cast a path built at runtime, such as ``c.rewrite(`/${locale}${path}` as RouteUrl)``.
|
|
24
|
+
|
|
23
25
|
For a typed redirect, build the URL with [`routeUrl()`](./types.md#routeurl-path-options):
|
|
24
26
|
|
|
25
27
|
```ts
|
|
@@ -43,6 +45,7 @@ export const GET = defineHandler((c) => {
|
|
|
43
45
|
|
|
44
46
|
```ts
|
|
45
47
|
interface CloudContext {
|
|
48
|
+
// RouteUrl instead of RewriteDestination with routing.typedRoutes
|
|
46
49
|
rewrite(destination: RewriteDestination | RouteDestination): Promise<Response>;
|
|
47
50
|
}
|
|
48
51
|
```
|
|
@@ -88,7 +91,7 @@ import type { RewriteDestination } from 'void/routes';
|
|
|
88
91
|
|
|
89
92
|
Suggests known route patterns in your editor while also accepting dynamic strings. Used as:
|
|
90
93
|
|
|
91
|
-
- The parameter type of [`c.rewrite()`](#c-rewrite-destination).
|
|
94
|
+
- The parameter type of [`c.rewrite()`](#c-rewrite-destination), unless `routing.typedRoutes` is on.
|
|
92
95
|
- The type of `destination` entries in `routing.rewrites` and `routing.fallbacks` in [`void.config.ts`](../config.md#routing).
|
|
93
96
|
|
|
94
97
|
Like [`RouteMap`](./types.md#routemap), `RewriteDestination` lives in the virtual `void/routes` module and is refreshed whenever routes change.
|
|
@@ -117,18 +117,22 @@ routeUrl('/users/:id', {
|
|
|
117
117
|
|
|
118
118
|
Static routes accept optional `query` and `hash` options. Pass raw parameter values for URL encoding. Catch-all parameters preserve `/` separators between segments. Invalid or missing path parameters throw a `TypeError`.
|
|
119
119
|
|
|
120
|
-
Use the returned
|
|
120
|
+
Use the returned [`RouteUrl`](#route-types) with `Link`, `<a>`, and `c.redirect()`. See [Typed URLs and Navigation](../../guide/type-safety.md#typed-urls-and-navigation) for setup and examples.
|
|
121
121
|
|
|
122
122
|
### Route types {#route-types}
|
|
123
123
|
|
|
124
124
|
Import these types from `void/routes`:
|
|
125
125
|
|
|
126
|
-
| Type | Description
|
|
127
|
-
| --------------------- |
|
|
128
|
-
| `RoutePathMap` | Generated map of page, HTTP, and WebSocket route patterns to their parameter names.
|
|
129
|
-
| `RoutePath` | Union of the known route patterns in `RoutePathMap`.
|
|
130
|
-
| `RouteOptions<P>` | Options for a route pattern `P`, including its required `params`, optional `query`, and `hash`.
|
|
131
|
-
| `RouteDestination<P>` | `{ pathname: P }` with `RouteOptions<P>`. Defaults to all known routes when `P` is omitted.
|
|
132
|
-
| `
|
|
133
|
-
| `
|
|
134
|
-
| `
|
|
126
|
+
| Type | Description |
|
|
127
|
+
| --------------------- | ------------------------------------------------------------------------------------------------- |
|
|
128
|
+
| `RoutePathMap` | Generated map of page, HTTP, and WebSocket route patterns to their parameter names. |
|
|
129
|
+
| `RoutePath` | Union of the known route patterns in `RoutePathMap`. |
|
|
130
|
+
| `RouteOptions<P>` | Options for a route pattern `P`, including its required `params`, optional `query`, and `hash`. |
|
|
131
|
+
| `RouteDestination<P>` | `{ pathname: P }` with `RouteOptions<P>`. Defaults to all known routes when `P` is omitted. |
|
|
132
|
+
| `RouteUrl` | The URL of one of your routes, returned by `routeUrl()`. `string` unless `typedRoutes` is on. |
|
|
133
|
+
| `Href` | A `RouteUrl`, a same-page query or hash, or an external URL. `string` unless `typedRoutes` is on. |
|
|
134
|
+
| `RouteUrlInput` | `Href`, `URL`, or `RouteDestination`; accepted by router navigation methods. |
|
|
135
|
+
| `RouteQuery` | Query keys mapped to `RouteQueryValue` or readonly arrays of those values. |
|
|
136
|
+
| `RouteQueryValue` | `string`, `number`, `boolean`, `null`, or `undefined`. |
|
|
137
|
+
|
|
138
|
+
`typedRoutes` is [`routing.typedRoutes`](../config.md#routing-typedroutes). See [Checked URL strings](../../guide/type-safety.md#checked-url-strings).
|
package/docs/reference/api.md
CHANGED
|
@@ -64,7 +64,7 @@ Import Void's app-facing APIs from these paths:
|
|
|
64
64
|
| `void/limits` | `UsageLimit`, `UsageLimitData`, and `readUsageLimit`. AI and Sandbox limits reject with `UsageLimit`; uncaught limits in Void routes and Pages actions return structured HTTP 429 responses. |
|
|
65
65
|
| `void/isr` | `revalidate(options)` for on-demand ISR cache invalidation |
|
|
66
66
|
| `void/log` | `logger` structured logging helper |
|
|
67
|
-
| `void/routes` | [`routeUrl()`](./api/types.md#routeurl-path-options), `RouteDestination`, `RoutePath`, `RouteOptions`, `RouteUrlInput`, and generated route maps
|
|
67
|
+
| `void/routes` | [`routeUrl()`](./api/types.md#routeurl-path-options), `RouteDestination`, `RoutePath`, `RouteOptions`, `RouteUrl`, `Href`, `RouteUrlInput`, and generated route maps |
|
|
68
68
|
| `void/queues` | `queues` proxy for sending messages to typed queues |
|
|
69
69
|
| `void/email` | `sendEmail`, `createEmail`, `defineEmail`, `parseEmail`, `replyEmail`, `MimeError`, `ParseEmailError`, and address, attachment, result, and handler types. See [Email](../guide/email.md). |
|
|
70
70
|
| `void/email/testing` | `createEmailTestHarness` and `createInboundTestHarness` to capture sends and deliver test messages to `email/` handlers. |
|
|
@@ -25,6 +25,7 @@ void platform install [options] [--yes]
|
|
|
25
25
|
| `--dedicated-zone` | Add zone-wide catch-all routes; valid only when the app domain is the whole zone |
|
|
26
26
|
| `--no-dedicated-zone` | Skip zone-wide application catch-all routes |
|
|
27
27
|
| `--custom-domains` | Let projects add their own domains; needs a dedicated zone |
|
|
28
|
+
| `--runtime-logs <full\|minimal>` | `minimal` keeps request URLs and log and exception messages out of runtime logs |
|
|
28
29
|
| `--control-plane-domain <domain>` | Optional API custom hostname; defaults to `workers.dev` |
|
|
29
30
|
| `--no-control-plane-domain` | Use the default `workers.dev` API hostname |
|
|
30
31
|
| `--dashboard-url <origin>` | HTTPS origin of an optional dashboard deployed separately |
|
|
@@ -101,7 +102,7 @@ Use these commands to recover, update, pause, or remove an installation:
|
|
|
101
102
|
|
|
102
103
|
```sh
|
|
103
104
|
void platform discover [--account <id>] [--installation <id-or-name>]
|
|
104
|
-
void platform upgrade [id] [--runtime <path>] [--dashboard-url <origin>] [--custom-domains] [--plan] [--yes]
|
|
105
|
+
void platform upgrade [id] [--runtime <path>] [--dashboard-url <origin>] [--custom-domains] [--runtime-logs <full|minimal>] [--plan] [--yes]
|
|
105
106
|
void platform rollback [id] --runtime <earlier-path> [--from-runtime <current-path>] [--plan] [--yes]
|
|
106
107
|
void platform repair [id] [--runtime <path>] [--dashboard-url <origin>] [--custom-domains] [--auth-config <path>] [--plan] [--yes]
|
|
107
108
|
void platform disable [id] [--plan] [--yes]
|
|
@@ -113,6 +114,8 @@ void platform uninstall [id] [--plan] [--purge-data | --purge-resources] [--yes]
|
|
|
113
114
|
|
|
114
115
|
Use the installation slug shown beside its name in `void platform list`. Installation IDs and saved connection IDs also work. Lifecycle commands require local installation records; use `discover` to restore them on another machine. Omit `id` when only one installation is configured, or choose from the interactive picker. Non-interactive commands need a slug or ID when several installations exist. Commands that make changes also require `--yes`; `--plan` only previews changes.
|
|
115
116
|
|
|
117
|
+
`upgrade --runtime-logs <full|minimal>` changes what runtime logs record; without it, upgrades keep the current setting. See [Choose what runtime logs record](../../guide/platform/installation/setup.md#runtime-logs).
|
|
118
|
+
|
|
116
119
|
To add or explicitly change a separately deployed dashboard after installation,
|
|
117
120
|
use `repair --dashboard-url <origin>` or `upgrade --dashboard-url <origin>`.
|
|
118
121
|
Preview with `--plan` first. Existing Access protection must cover the configured
|
|
@@ -32,7 +32,7 @@ void init [--tsconfig] [--github] [--git | --no-git]
|
|
|
32
32
|
[--toolchain <name>] [--framework <name>] [--starter <name>] [--deploy <target>]
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Set up a new or existing Void project. In an empty directory, choose Vite+ or Vite, a framework, and a D1, PostgreSQL, MySQL, or Static Pages starter.
|
|
35
|
+
Set up a new or existing Void project. In an empty directory, choose Vite+ or Vite, a framework, and a D1, PostgreSQL, MySQL, or Static Pages starter. The new app's `void.config.ts` turns on [`routing.typedRoutes`](../config.md#routing-typedroutes).
|
|
36
36
|
|
|
37
37
|
Pass your choices as flags to scaffold from a script or coding agent:
|
|
38
38
|
|
package/docs/reference/config.md
CHANGED
|
@@ -376,6 +376,16 @@ routing: {
|
|
|
376
376
|
}
|
|
377
377
|
```
|
|
378
378
|
|
|
379
|
+
#### `routing.typedRoutes`
|
|
380
|
+
|
|
381
|
+
Type-check URL strings against your app's routes in `Link`'s `href`, `router.visit()`, `router.prefetch()`, `router.flush()`, and `c.rewrite()`. Omitted or `false` means off; `void init` turns it on for new apps. It changes types only, not navigation at runtime. Strings may also be same-page queries or hashes, or `http://`, `https://`, `mailto:`, and `tel:` URLs. See [Checked URL strings](../guide/type-safety#checked-url-strings).
|
|
382
|
+
|
|
383
|
+
```ts
|
|
384
|
+
routing: {
|
|
385
|
+
typedRoutes: true,
|
|
386
|
+
}
|
|
387
|
+
```
|
|
388
|
+
|
|
379
389
|
#### `routing.headers`
|
|
380
390
|
|
|
381
391
|
Custom response headers. Keys are URL patterns, values are arrays of `"Name: value"` strings. See [Custom Headers](../guide/edge/headers) for details.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "void",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Full-stack framework and deployment CLI for Cloudflare Workers, powered by Vite.",
|
|
5
5
|
"homepage": "https://void.cloud",
|
|
6
6
|
"bugs": {
|
|
@@ -352,11 +352,11 @@
|
|
|
352
352
|
"@cloudflare/workers-types": "^5.20261102.1",
|
|
353
353
|
"@cloudflare/workers-utils": "^0.50.2",
|
|
354
354
|
"@napi-rs/keyring": "^2.1.2",
|
|
355
|
-
"@void/deploy-cloudflare": "1.
|
|
356
|
-
"@void/deploy-core": "1.
|
|
357
|
-
"@void/edge": "1.
|
|
358
|
-
"@void/isr": "1.
|
|
359
|
-
"@void/platform": "1.
|
|
355
|
+
"@void/deploy-cloudflare": "1.6.0",
|
|
356
|
+
"@void/deploy-core": "1.6.0",
|
|
357
|
+
"@void/edge": "1.6.0",
|
|
358
|
+
"@void/isr": "1.6.0",
|
|
359
|
+
"@void/platform": "1.6.0",
|
|
360
360
|
"better-auth": "^1.7.14",
|
|
361
361
|
"better-sqlite3": "^13.0.3",
|
|
362
362
|
"blake3-jit": "^1.1.0",
|
|
@@ -367,6 +367,7 @@
|
|
|
367
367
|
"drizzle-valibot": "^0.4.2",
|
|
368
368
|
"drizzle-zod": "^0.8.3",
|
|
369
369
|
"email-validator": "^2.0.4",
|
|
370
|
+
"gray-matter": "^4.0.3",
|
|
370
371
|
"hono": "^4.13.16",
|
|
371
372
|
"ignore": "^7.0.14",
|
|
372
373
|
"jiti": "^2.7.0",
|
|
@@ -406,7 +407,7 @@
|
|
|
406
407
|
"zod": "^4.6.7"
|
|
407
408
|
},
|
|
408
409
|
"peerDependencies": {
|
|
409
|
-
"@void/md": "1.
|
|
410
|
+
"@void/md": "1.6.0",
|
|
410
411
|
"arktype": ">=2.0.0",
|
|
411
412
|
"valibot": ">=1.0.0-beta.7",
|
|
412
413
|
"vite": "^8.0.0",
|
package/schema.json
CHANGED
|
@@ -152,6 +152,10 @@
|
|
|
152
152
|
"type": "boolean",
|
|
153
153
|
"description": "Enable inferred ISR caching. Set false to disable ISR and edge prerendering, including per-page prerender and revalidate policies. Does not disable output: static build-time prerendering."
|
|
154
154
|
},
|
|
155
|
+
"typedRoutes": {
|
|
156
|
+
"type": "boolean",
|
|
157
|
+
"description": "Type-check URL strings in Link href, router navigation, and c.rewrite() against the app's routes. Omitted or false means off."
|
|
158
|
+
},
|
|
155
159
|
"notFound": {
|
|
156
160
|
"type": "string",
|
|
157
161
|
"enum": ["single-page-application", "404-page", "none"],
|
package/skills/void/SKILL.md
CHANGED
|
@@ -84,6 +84,11 @@ the app's existing saved destination, including when the target project is new.
|
|
|
84
84
|
guides and use `void info` to preserve resource names and instance keys.
|
|
85
85
|
- Declare application environment keys in `env.ts` and access them through
|
|
86
86
|
`void/env`; follow `docs/guide/env-vars.md` for local and production values.
|
|
87
|
+
- In Pages navigation, style the current link with `Link`'s `aria-current` and `data-void-active`
|
|
88
|
+
attributes (`activeMatch="prefix"` for sections) instead of comparing `useRouter().path`; see
|
|
89
|
+
`docs/guide/pages-routing/overview.md#active-links`. Show a loading state on
|
|
90
|
+
the clicked link with `data-void-pending` instead of matching `useNavigation().location`
|
|
91
|
+
yourself; see `docs/guide/pages-routing/overview.md#pending-links`.
|
|
87
92
|
- For platform setup, follow the pages linked from
|
|
88
93
|
`docs/guide/self-hosted-platform.md`. Use `void platform list` to find the
|
|
89
94
|
installation slug for maintenance. For recovery, use its documented resume
|
package/dist/client-DVtAKeUm.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { r as PlatformClient } from "./client-Qayy9xEh.mjs";
|
package/dist/deploy-CfU7CR-b.mjs
DELETED
package/dist/gen-i61rdQgg.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { r as runGenCommand } from "./gen-BvVmpZ5f.mjs";
|