diff --git a/docs/cloud/cloudflare.mdx b/docs/cloud/cloudflare.mdx index 19c4481..75ecffd 100644 --- a/docs/cloud/cloudflare.mdx +++ b/docs/cloud/cloudflare.mdx @@ -28,6 +28,19 @@ In this guide, we'll walk you through configuring Cloudflare as your default clo ::: +## SSR Worker (beta) + +:::warning Availability + +Zephyr’s **SSR Worker** runtime is currently **beta** and **only available on Cloudflare** using **Zephyr’s default (managed) Cloudflare integration**. + +It is **not available** on Bring Your Own Cloud (BYOC) deployments (including custom/non-default integrations). + +Learn more: **[SSR Worker (beta)](/reference/ssr-worker)**. +Using TanStack Start? See: **[TanStack Start](/meta-frameworks/tanstack-start)**. + +::: + ## Configure and Enable Cloudflare diff --git a/docs/meta-frameworks/tanstack-start.mdx b/docs/meta-frameworks/tanstack-start.mdx new file mode 100644 index 0000000..f435819 --- /dev/null +++ b/docs/meta-frameworks/tanstack-start.mdx @@ -0,0 +1,75 @@ +--- +title: TanStack Start +description: Deploy TanStack Start (Cloudflare template) to Zephyr by adding the Zephyr TanStack Start Vite plugin. +head: + - - meta + - property: og:description + content: Deploy TanStack Start (Cloudflare template) to Zephyr by adding the Zephyr TanStack Start Vite plugin. +--- + +import { PackageManagerTabs } from '@rspress/core/theme'; +import BuildAuthInfo from '../../components/build-auth-info.mdx'; + +# TanStack Start + +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. + +For the upstream CLI flow, see TanStack’s docs: **[TanStack Start (React) Quick Start](https://tanstack.com/start/latest/docs/framework/react/quick-start)**. + +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/)**. + +:::info Prerequisites + +- Finished our [Prerequisites](/getting-started/installation) setup guide +- Your organization is using **Zephyr’s managed Cloudflare integration** (the default integration) + +::: + +## Install + +Add the plugin to your project: + + + +## Configure Vite + +In your `vite.config.ts`, import `withZephyrTanstackStart` and add it to the **end** of your `plugins` array (after TanStack Start): + +```ts filename="vite.config.ts" +import { withZephyrTanstackStart } from 'vite-plugin-tanstack-start-zephyr'; + +export default defineConfig({ + plugins: [ + // ...your existing plugins (cloudflare(), tanstackStart(), react(), etc.) + withZephyrTanstackStart(), + ], +}); +``` + +:::warning Git is required + +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). + +::: + +## Deploy + +Run your production build: + +```bash filename="Terminal" +npm run build +``` + +On the first run, you’ll be prompted to authenticate: + + + +## SSR Worker (beta) + +TanStack Start deployments on Zephyr use our **SSR Worker** runtime. + +- This is currently **beta** and **only available on Cloudflare** +- It is **only available on Zephyr’s default (managed) Cloudflare integration** +- It is **not available on Bring Your Own Cloud (BYOC)** deployments + +Learn more: **[SSR Worker (beta)](/reference/ssr-worker)**. diff --git a/docs/reference/ssr-worker.mdx b/docs/reference/ssr-worker.mdx new file mode 100644 index 0000000..e80a2a7 --- /dev/null +++ b/docs/reference/ssr-worker.mdx @@ -0,0 +1,29 @@ +--- +title: SSR Worker (beta) +description: Zephyr SSR Worker runtime for server-rendered deployments. Currently beta and Cloudflare-only on Zephyr's default integration. +head: + - - meta + - property: og:description + content: Zephyr SSR Worker runtime for server-rendered deployments. Currently beta and Cloudflare-only on Zephyr's default integration. +--- + +# SSR Worker (beta) + +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. + +## Availability (important) + +:::warning Beta + Cloudflare-only + +- **Beta**: this feature is in active development and the API/behavior may change +- **Cloudflare-only**: currently available **only** on Cloudflare +- **Default integration only**: available **only** on Zephyr’s default (managed) Cloudflare integration +- **Not on BYOC**: not available on Bring Your Own Cloud deployments (including custom/non-default integrations) + +::: + +## How it relates to TanStack Start + +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. + +See: **[TanStack Start](/meta-frameworks/tanstack-start)**. diff --git a/rspress.config.ts b/rspress.config.ts index f2df79f..3d08d8e 100644 --- a/rspress.config.ts +++ b/rspress.config.ts @@ -92,6 +92,8 @@ const sidebar: Sidebar = { { text: 'Deployment Hooks', link: '/features/deployment-hooks', + }, + { text: 'Structured File Logs', link: '/features/file-logging', }, @@ -210,6 +212,10 @@ const sidebar: Sidebar = { text: 'Rslib', link: '/meta-frameworks/rslib', }, + { + text: 'TanStack Start', + link: '/meta-frameworks/tanstack-start', + }, ], }, { @@ -319,6 +325,10 @@ const sidebar: Sidebar = { text: 'Architecture', link: '/reference/architecture', }, + { + text: 'SSR Worker (beta)', + link: '/reference/ssr-worker', + }, { text: 'IP Allowlists', link: '/reference/allow-ip-addresses', @@ -446,7 +456,6 @@ export default defineConfig({ }, ], }), - // @ts-expect-error Rspress plugin only accounts for stable not beta so there is type issues withZephyr(), ], });