diff --git a/src/content/docs/workers/framework-guides/web-apps/tanstack-start.mdx b/src/content/docs/workers/framework-guides/web-apps/tanstack-start.mdx index 16c625e7c51957c..4b5c99dc2415d4d 100644 --- a/src/content/docs/workers/framework-guides/web-apps/tanstack-start.mdx +++ b/src/content/docs/workers/framework-guides/web-apps/tanstack-start.mdx @@ -18,7 +18,7 @@ import { WranglerConfig, } from "~/components"; -[TanStack Start](https://tanstack.com/start) is a full-stack framework for building web applications. It comes with features like server-side rendering, streaming, server functions, bundling, and more. In this guide, you learn to deploy a TanStack Start application to Cloudflare Workers. +[TanStack Start](https://tanstack.com/start) is a full-stack framework for building web applications. It comes with features like server-side rendering, streaming, server functions, bundling, and more. In this guide, you learn to deploy a TanStack (**React**) Start application to Cloudflare Workers. If you would like to deploy a TanStack Start application with **Solid** instead, you can take a look at TanStack's official [example](https://tanstack.com/start/latest/docs/framework/solid/examples/start-basic-cloudflare). ## 1. Set up a TanStack Start project @@ -118,6 +118,25 @@ This can help you making sure that your application will work as intended once i --- +## Custom Worker-Entrypoint + +If you need to export additional declarations from your worker file, for example class definitions for [Durable Objects](https://developers.cloudflare.com/durable-objects/get-started/#2-write-a-durable-object-class-using-sql-api), you can specify a different file for the `main` property inside the `wrangler.jsonc`: + + +```toml +main = "worker-entry.ts" +``` + + +Export `@tanstack/react-start/server-entry` from the specified file manually. This is also the place where you can export anything else you want: +```ts title="worker-entry.ts" +export { default } from '@tanstack/react-start/server-entry' + +export class MyDurableObject extends DurableObject { + // ... +} +``` + ## Bindings Your TanStack Start application can be fully integrated with the Cloudflare Developer Platform, in both local development and in production, by using bindings.