Skip to content

Commit 122795b

Browse files
authored
feat: add SSR documentation and tanstack start docs (#175)
1 parent a04e235 commit 122795b

File tree

4 files changed

+127
-1
lines changed

4 files changed

+127
-1
lines changed

docs/cloud/cloudflare.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@ In this guide, we'll walk you through configuring Cloudflare as your default clo
2828

2929
:::
3030

31+
## SSR Worker (beta)
32+
33+
:::warning Availability
34+
35+
Zephyr’s **SSR Worker** runtime is currently **beta** and **only available on Cloudflare** using **Zephyr’s default (managed) Cloudflare integration**.
36+
37+
It is **not available** on Bring Your Own Cloud (BYOC) deployments (including custom/non-default integrations).
38+
39+
Learn more: **[SSR Worker (beta)](/reference/ssr-worker)**.
40+
Using TanStack Start? See: **[TanStack Start](/meta-frameworks/tanstack-start)**.
41+
42+
:::
43+
3144
## Configure and Enable Cloudflare
3245

3346
<Steps>
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: TanStack Start
3+
description: Deploy TanStack Start (Cloudflare template) to Zephyr by adding the Zephyr TanStack Start Vite plugin.
4+
head:
5+
- - meta
6+
- property: og:description
7+
content: Deploy TanStack Start (Cloudflare template) to Zephyr by adding the Zephyr TanStack Start Vite plugin.
8+
---
9+
10+
import { PackageManagerTabs } from '@rspress/core/theme';
11+
import BuildAuthInfo from '../../components/build-auth-info.mdx';
12+
13+
# TanStack Start
14+
15+
If you created your app with the **TanStack Start CLI** and selected the **Cloudflare** deployment option, deploying to Zephyr is just adding the Zephyr TanStack Start plugin to your Vite build.
16+
17+
For the upstream CLI flow, see TanStack’s docs: **[TanStack Start (React) Quick Start](https://tanstack.com/start/latest/docs/framework/react/quick-start)**.
18+
19+
For Cloudflare-specific setup details (Wrangler config, Cloudflare Vite plugin, etc.), see: **[Cloudflare Workers: TanStack Start](https://developers.cloudflare.com/workers/framework-guides/web-apps/tanstack-start/)**.
20+
21+
:::info Prerequisites
22+
23+
- Finished our [Prerequisites](/getting-started/installation) setup guide
24+
- Your organization is using **Zephyr’s managed Cloudflare integration** (the default integration)
25+
26+
:::
27+
28+
## Install
29+
30+
Add the plugin to your project:
31+
32+
<PackageManagerTabs command="add -D vite-plugin-tanstack-start-zephyr" />
33+
34+
## Configure Vite
35+
36+
In your `vite.config.ts`, import `withZephyrTanstackStart` and add it to the **end** of your `plugins` array (after TanStack Start):
37+
38+
```ts filename="vite.config.ts"
39+
import { withZephyrTanstackStart } from 'vite-plugin-tanstack-start-zephyr';
40+
41+
export default defineConfig({
42+
plugins: [
43+
// ...your existing plugins (cloudflare(), tanstackStart(), react(), etc.)
44+
withZephyrTanstackStart(),
45+
],
46+
});
47+
```
48+
49+
:::warning Git is required
50+
51+
Zephyr derives your **Application UID** from your `package.json` and git context. Make sure your repo is initialized and has a remote (for example, GitHub).
52+
53+
:::
54+
55+
## Deploy
56+
57+
Run your production build:
58+
59+
```bash filename="Terminal"
60+
npm run build
61+
```
62+
63+
On the first run, you’ll be prompted to authenticate:
64+
65+
<BuildAuthInfo />
66+
67+
## SSR Worker (beta)
68+
69+
TanStack Start deployments on Zephyr use our **SSR Worker** runtime.
70+
71+
- This is currently **beta** and **only available on Cloudflare**
72+
- It is **only available on Zephyr’s default (managed) Cloudflare integration**
73+
- It is **not available on Bring Your Own Cloud (BYOC)** deployments
74+
75+
Learn more: **[SSR Worker (beta)](/reference/ssr-worker)**.

docs/reference/ssr-worker.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: SSR Worker (beta)
3+
description: Zephyr SSR Worker runtime for server-rendered deployments. Currently beta and Cloudflare-only on Zephyr's default integration.
4+
head:
5+
- - meta
6+
- property: og:description
7+
content: Zephyr SSR Worker runtime for server-rendered deployments. Currently beta and Cloudflare-only on Zephyr's default integration.
8+
---
9+
10+
# SSR Worker (beta)
11+
12+
Zephyr’s **SSR Worker** is our runtime for serving **server-rendered** JavaScript applications at the edge. It runs your server entrypoint inside an isolate and serves the correct server/client assets for a deployed snapshot.
13+
14+
## Availability (important)
15+
16+
:::warning Beta + Cloudflare-only
17+
18+
- **Beta**: this feature is in active development and the API/behavior may change
19+
- **Cloudflare-only**: currently available **only** on Cloudflare
20+
- **Default integration only**: available **only** on Zephyr’s default (managed) Cloudflare integration
21+
- **Not on BYOC**: not available on Bring Your Own Cloud deployments (including custom/non-default integrations)
22+
23+
:::
24+
25+
## How it relates to TanStack Start
26+
27+
When you deploy a TanStack Start project using the Zephyr TanStack Start plugin, Zephyr uploads an **SSR snapshot** (server + client bundles) and configures the SSR Worker to execute the server entrypoint.
28+
29+
See: **[TanStack Start](/meta-frameworks/tanstack-start)**.

rspress.config.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ const sidebar: Sidebar = {
9292
{
9393
text: 'Deployment Hooks',
9494
link: '/features/deployment-hooks',
95+
},
96+
{
9597
text: 'Structured File Logs',
9698
link: '/features/file-logging',
9799
},
@@ -210,6 +212,10 @@ const sidebar: Sidebar = {
210212
text: 'Rslib',
211213
link: '/meta-frameworks/rslib',
212214
},
215+
{
216+
text: 'TanStack Start',
217+
link: '/meta-frameworks/tanstack-start',
218+
},
213219
],
214220
},
215221
{
@@ -319,6 +325,10 @@ const sidebar: Sidebar = {
319325
text: 'Architecture',
320326
link: '/reference/architecture',
321327
},
328+
{
329+
text: 'SSR Worker (beta)',
330+
link: '/reference/ssr-worker',
331+
},
322332
{
323333
text: 'IP Allowlists',
324334
link: '/reference/allow-ip-addresses',
@@ -446,7 +456,6 @@ export default defineConfig({
446456
},
447457
],
448458
}),
449-
// @ts-expect-error Rspress plugin only accounts for stable not beta so there is type issues
450459
withZephyr(),
451460
],
452461
});

0 commit comments

Comments
 (0)