Skip to content

Commit 07dc11d

Browse files
dario-piotrowiczjamesopstadmaxvp
authored
Update tanstack guide to use C3 (#25583)
--------- Co-authored-by: James Opstad <[email protected]> Co-authored-by: Max Phillips <[email protected]>
1 parent 841bada commit 07dc11d

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed

public/__redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,6 +1969,7 @@
19691969
/workers/frameworks/framework-guides/nuxt/ /workers/framework-guides/web-apps/more-web-frameworks/nuxt/ 301
19701970
/workers/frameworks/framework-guides/qwik/ /workers/framework-guides/web-apps/more-web-frameworks/qwik/ 301
19711971
/workers/frameworks/framework-guides/solid/ /workers/framework-guides/web-apps/more-web-frameworks/solid/ 301
1972+
/workers/framework-guides/web-apps/tanstack/ /workers/framework-guides/web-apps/tanstack-start/ 301
19721973

19731974
/workers/testing/unit-testing/ /workers/testing/vitest-integration/write-your-first-test/ 301
19741975
/workers/testing/integration-testing/ /workers/testing/ 301

src/content/docs/workers/framework-guides/web-apps/tanstack.mdx renamed to src/content/docs/workers/framework-guides/web-apps/tanstack-start.mdx

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
pcx_content_type: how-to
3-
title: TanStack
3+
title: TanStack Start
44
sidebar:
55
order: 7
66
head: []
77
tags: ["full-stack"]
8-
description: Create a TanStack Start application and deploy it to Cloudflare Workers with Workers Assets.
8+
description: Create a TanStack Start application and deploy it to Cloudflare Workers.
99
---
1010

1111
import {
@@ -16,28 +16,26 @@ import {
1616
PackageManagers,
1717
} from "~/components";
1818

19-
In this guide, you will create a new [TanStack Start](https://tanstack.com/start) application and deploy it to Cloudflare Workers (with the new [Workers Assets](/workers/static-assets/)).
19+
In this guide, you will create a new [TanStack Start](https://tanstack.com/start) application and deploy it to Cloudflare Workers.
2020

2121
## 1. Set up a new project
2222

23-
Start by cloning the Cloudflare example from the official TanStack repository.
23+
Use the [`create-cloudflare`](https://www.npmjs.com/package/create-cloudflare) CLI (C3) to set up a new project. C3 will create a new project directory, initiate TanStack Start's official setup tool, and provide the option to deploy instantly.
24+
25+
To use `create-cloudflare` to create a new TanStack Start project with Workers Assets, run the following command:
2426

2527
<PackageManagers
26-
type="dlx"
27-
pkg="gitpick"
28-
args="TanStack/router/tree/main/examples/react/start-basic-cloudflare my-tanstack-app"
28+
type="create"
29+
pkg="cloudflare@latest"
30+
args="my-tanstack-start-app --framework=tanstack-start"
2931
/>
3032

3133
After setting up your project, change your directory by running the following command:
3234

3335
```sh
34-
cd my-tanstack-app
36+
cd my-tanstack-start-app
3537
```
3638

37-
And install the project's dependencies with:
38-
39-
<PackageManagers type="install" />
40-
4139
## 2. Develop locally
4240

4341
After you have created your project, run the following command in the project directory to start a local development server. This will allow you to preview your project locally during development.
@@ -46,21 +44,15 @@ After you have created your project, run the following command in the project di
4644

4745
## 3. Deploy your Project
4846

49-
Your project can be deployed to a `*.workers.dev` subdomain or a [Custom Domain](/workers/configuration/routing/custom-domains/), from your own machine or from any CI/CD system, including [Cloudflare's own](/workers/ci-cd/builds/).
50-
51-
To deploy your application you will first need to build it:
47+
You can deploy your project to a `*.workers.dev` subdomain or a [Custom Domain](/workers/configuration/routing/custom-domains/) from your own machine or from any CI/CD system, including Cloudflare's own [Workers Builds](/workers/ci-cd/builds/).
5248

53-
<PackageManagers type="run" args="build" />
49+
The following command will build and deploy your project. If you are using CI, ensure you update your [**Deploy command**](/workers/ci-cd/builds/configuration/#build-settings) configuration appropriately.
5450

55-
Once it's been built you can deploy it via:
56-
57-
<PackageManagers type="run" args="deploy" />
58-
59-
If you're using CI, ensure you update your ["deploy command"](/workers/ci-cd/builds/configuration/#build-settings) configuration appropriately.
51+
<PackageManagers type="run" args={"deploy"} />
6052

6153
:::note
6254

63-
After having built the application you can run the `preview` script to preview the built output locally before deploying it.
55+
Before deploying your application, you can also run the `preview` script to preview the built output locally before deploying it.
6456
This can help you making sure that your application will work as intended once it's been deployed to the Cloudflare network:
6557

6658
<PackageManagers type="run" args="preview" />
@@ -97,8 +89,6 @@ function RouteComponent() {
9789
}
9890
```
9991

100-
See `src/routes/index.tsx` for an example.
101-
10292
:::note
10393

10494
Running the `cf-typegen` script:

0 commit comments

Comments
 (0)