From 41b643e1a7f9616acc2a8d3a6a5611f68463d88e Mon Sep 17 00:00:00 2001 From: Brendan Irvine-Broque Date: Thu, 29 Oct 2026 10:28:10 -0700 Subject: [PATCH 1/4] [cf] Document Vite+ project defaults and supported Node versions --- src/content/docs/cf/ci.mdx | 4 +-- .../docs/cf/get-started/first-worker.mdx | 30 +++++++++++++++++-- src/content/docs/cf/get-started/index.mdx | 2 +- .../docs/workers/vite-plugin/get-started.mdx | 16 ++++++++++ 4 files changed, 47 insertions(+), 5 deletions(-) diff --git a/src/content/docs/cf/ci.mdx b/src/content/docs/cf/ci.mdx index 59b45cd62fa..8bcf636dbc7 100644 --- a/src/content/docs/cf/ci.mdx +++ b/src/content/docs/cf/ci.mdx @@ -58,7 +58,7 @@ pushes to `main`. - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: - node-version: 22 + node-version: "24.22.0" cache: npm - run: npm ci - run: npx cf build @@ -123,7 +123,7 @@ each command to the project's copy. Collaborators, coding agents, and CI then run the same version. One-off runs such as `npx cf@` are not handed off. -Use Node.js 22.18 or later. For details, refer to +Use a supported Node.js release, such as Node.js 24.22 or later in Node.js 24. For details, refer to [Requirements](/cf/get-started/#requirements). ## Understand non-interactive behavior diff --git a/src/content/docs/cf/get-started/first-worker.mdx b/src/content/docs/cf/get-started/first-worker.mdx index 50d2506b363..d28412d3c81 100644 --- a/src/content/docs/cf/get-started/first-worker.mdx +++ b/src/content/docs/cf/get-started/first-worker.mdx @@ -13,6 +13,7 @@ products: import { AnnotatedConfigExplorer, FileTree, + PackageManagers, Steps, TypeScriptExample, } from "~/components"; @@ -48,21 +49,27 @@ these files: - index.d.ts - src/ - index.ts + - test/ + - index.test.ts - .gitignore - cloudflare.config.ts - package.json - tsconfig.json - vite.config.ts + - vitest.config.ts - `src/index.ts` is the Worker. - `cloudflare.config.ts` describes the Worker in TypeScript. -- `vite.config.ts` adds the [Cloudflare Vite plugin](/workers/vite-plugin/), +- `vite.config.ts` configures [Vite+](https://viteplus.dev) checks and adds the [Cloudflare Vite plugin](/workers/vite-plugin/), which runs your code in the Workers runtime during development and builds it for deployment. - `package.json` has `dev`, `build`, and `deploy` scripts that run the matching `cf` commands. It lists `cf` and the Vite plugin 2.0 beta (`@cloudflare/vite-plugin@beta`), which `cf` uses, but not Wrangler. + It also installs Vite+ locally for checks, formatting, and tests. +- `vitest.config.ts` configures tests to run in the Workers runtime. + `test/index.test.ts` checks the Worker response using its `WORLD` binding. - `.cloudflare/types/index.d.ts` holds generated binding and runtime types. The Vite plugin updates it when you run `cf dev` or `cf build`. The generated `.gitignore` excludes `.cloudflare/`. @@ -124,7 +131,26 @@ development server picks up the change without a restart. In this project, `cf dev` does not accept options such as `--port`. To change the port, set `server.port` in `vite.config.ts`. -## 3. Deploy +## 3. Check and test + +Check formatting, lint rules, and TypeScript types: + + + +This command generates Worker types before running `vp check`. To format your +files, run the `format` script. + +Run the generated Workers-runtime test once: + + + +Vite+ is installed with your project dependencies. A global `vp` installation +is optional. Keep the Vite alias and Vitest override aligned when you update +Vite+. Refer to [Vite+ dependency alignment](https://viteplus.dev/guide/local-cli). + +Continue to use `cf dev`, `cf build`, and `cf deploy` for this project. + +## 4. Deploy 1. If you have not signed in yet, sign in: diff --git a/src/content/docs/cf/get-started/index.mdx b/src/content/docs/cf/get-started/index.mdx index 76e81136791..bfda72b51b7 100644 --- a/src/content/docs/cf/get-started/index.mdx +++ b/src/content/docs/cf/get-started/index.mdx @@ -21,7 +21,7 @@ chooses credentials, accounts, and zones. - A Cloudflare account. If you do not have one, [sign up](https://dash.cloudflare.com/sign-up). -- Node.js 22.18 or later. Bun is not supported. When `cf` runs on Bun, commands +- Node.js 22.23+, 24.22+, or 26.12+ within those release lines. Bun is not supported. When `cf` runs on Bun, commands that load `cloudflare.config.ts` fail. ## Install `cf` diff --git a/src/content/docs/workers/vite-plugin/get-started.mdx b/src/content/docs/workers/vite-plugin/get-started.mdx index f4bdc5c7ede..4babc8d7b8a 100644 --- a/src/content/docs/workers/vite-plugin/get-started.mdx +++ b/src/content/docs/workers/vite-plugin/get-started.mdx @@ -97,3 +97,19 @@ A request to this Worker will return **'Running in Cloudflare-Workers!'**, demon ## Dev, build, preview and deploy You can now start the Vite development server (`npm run dev`), build the application (`npm run build`), preview the built application (`npm run preview`), and deploy to Cloudflare (`npm run deploy`). + +## Use Vite+ + +[Vite+](https://viteplus.dev) combines Vite with formatting, linting, type +checking, and testing. The Cloudflare Vite plugin also works with Vite+. + +For an existing project, follow the [Vite+ migration guide](https://viteplus.dev/guide/migrate). +Keep the Vite alias and Vitest override aligned with your Vite+ release. +Use `defineConfig` from `vite-plus` in your Vite configuration. + +Keep your framework's scripts and Cloudflare deployment command. For example, +`vp run build` runs a project's `build` script, while `vp build` runs Vite +without additional steps from that script. Adopting Vite+ does not require +converting a Wrangler configuration to `cloudflare.config.ts`. + +For a new project with `cf`, follow [Deploy your first Worker](/cf/get-started/first-worker/). From a6c45169b2d235c5b452c00be0001735a113f9b7 Mon Sep 17 00:00:00 2001 From: Brendan Irvine-Broque Date: Thu, 29 Oct 2026 15:29:58 -0700 Subject: [PATCH 2/4] [cf] Address review feedback on Vite+ docs --- src/content/docs/cf/ci.mdx | 2 +- .../docs/cf/get-started/first-worker.mdx | 22 +------------------ src/content/docs/cf/get-started/index.mdx | 2 +- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/content/docs/cf/ci.mdx b/src/content/docs/cf/ci.mdx index 8bcf636dbc7..7dafae318a2 100644 --- a/src/content/docs/cf/ci.mdx +++ b/src/content/docs/cf/ci.mdx @@ -58,7 +58,7 @@ pushes to `main`. - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: - node-version: "24.22.0" + node-version: 24 cache: npm - run: npm ci - run: npx cf build diff --git a/src/content/docs/cf/get-started/first-worker.mdx b/src/content/docs/cf/get-started/first-worker.mdx index d28412d3c81..fb4feaa3f04 100644 --- a/src/content/docs/cf/get-started/first-worker.mdx +++ b/src/content/docs/cf/get-started/first-worker.mdx @@ -13,7 +13,6 @@ products: import { AnnotatedConfigExplorer, FileTree, - PackageManagers, Steps, TypeScriptExample, } from "~/components"; @@ -131,26 +130,7 @@ development server picks up the change without a restart. In this project, `cf dev` does not accept options such as `--port`. To change the port, set `server.port` in `vite.config.ts`. -## 3. Check and test - -Check formatting, lint rules, and TypeScript types: - - - -This command generates Worker types before running `vp check`. To format your -files, run the `format` script. - -Run the generated Workers-runtime test once: - - - -Vite+ is installed with your project dependencies. A global `vp` installation -is optional. Keep the Vite alias and Vitest override aligned when you update -Vite+. Refer to [Vite+ dependency alignment](https://viteplus.dev/guide/local-cli). - -Continue to use `cf dev`, `cf build`, and `cf deploy` for this project. - -## 4. Deploy +## 3. Deploy 1. If you have not signed in yet, sign in: diff --git a/src/content/docs/cf/get-started/index.mdx b/src/content/docs/cf/get-started/index.mdx index bfda72b51b7..62793a1ec46 100644 --- a/src/content/docs/cf/get-started/index.mdx +++ b/src/content/docs/cf/get-started/index.mdx @@ -21,7 +21,7 @@ chooses credentials, accounts, and zones. - A Cloudflare account. If you do not have one, [sign up](https://dash.cloudflare.com/sign-up). -- Node.js 22.23+, 24.22+, or 26.12+ within those release lines. Bun is not supported. When `cf` runs on Bun, commands +- Node.js 22.23+, 24.22+, or 26.12+. Bun is not supported. When `cf` runs on Bun, commands that load `cloudflare.config.ts` fail. ## Install `cf` From ef38d91383299172ef34d9af01fdd3d1e6c5c952 Mon Sep 17 00:00:00 2001 From: Brendan Irvine-Broque Date: Thu, 29 Oct 2026 16:06:29 -0700 Subject: [PATCH 3/4] docs: scope Vite+ Node requirements to generated projects --- src/content/docs/cf/ci.mdx | 2 +- src/content/docs/cf/get-started/first-worker.mdx | 3 ++- src/content/docs/cf/get-started/index.mdx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/content/docs/cf/ci.mdx b/src/content/docs/cf/ci.mdx index 7dafae318a2..6f3e2bf42f9 100644 --- a/src/content/docs/cf/ci.mdx +++ b/src/content/docs/cf/ci.mdx @@ -123,7 +123,7 @@ each command to the project's copy. Collaborators, coding agents, and CI then run the same version. One-off runs such as `npx cf@` are not handed off. -Use a supported Node.js release, such as Node.js 24.22 or later in Node.js 24. For details, refer to +Use Node.js 22.18 or later. For details, refer to [Requirements](/cf/get-started/#requirements). ## Understand non-interactive behavior diff --git a/src/content/docs/cf/get-started/first-worker.mdx b/src/content/docs/cf/get-started/first-worker.mdx index fb4feaa3f04..0ff3f1cb33d 100644 --- a/src/content/docs/cf/get-started/first-worker.mdx +++ b/src/content/docs/cf/get-started/first-worker.mdx @@ -24,7 +24,8 @@ machine, and deploys it to your Cloudflare account. [Install `cf`](/cf/get-started/) and check the [requirements](/cf/get-started/#requirements). You do not need to sign in until -you deploy. +you deploy. New projects use Vite+ and require Node.js 22.23 or later +in Node.js 22, 24.22 or later in Node.js 24, or 26.12 or later in Node.js 26. ## 1. Create a project diff --git a/src/content/docs/cf/get-started/index.mdx b/src/content/docs/cf/get-started/index.mdx index 62793a1ec46..76e81136791 100644 --- a/src/content/docs/cf/get-started/index.mdx +++ b/src/content/docs/cf/get-started/index.mdx @@ -21,7 +21,7 @@ chooses credentials, accounts, and zones. - A Cloudflare account. If you do not have one, [sign up](https://dash.cloudflare.com/sign-up). -- Node.js 22.23+, 24.22+, or 26.12+. Bun is not supported. When `cf` runs on Bun, commands +- Node.js 22.18 or later. Bun is not supported. When `cf` runs on Bun, commands that load `cloudflare.config.ts` fail. ## Install `cf` From 436e64e026ff7296afc2b11c28b1c4444809508a Mon Sep 17 00:00:00 2001 From: Brendan Irvine-Broque Date: Thu, 29 Oct 2026 16:06:40 -0700 Subject: [PATCH 4/4] docs: retain Node requirements declared by cf itself --- src/content/docs/cf/ci.mdx | 2 +- src/content/docs/cf/get-started/first-worker.mdx | 3 +-- src/content/docs/cf/get-started/index.mdx | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/content/docs/cf/ci.mdx b/src/content/docs/cf/ci.mdx index 6f3e2bf42f9..7dafae318a2 100644 --- a/src/content/docs/cf/ci.mdx +++ b/src/content/docs/cf/ci.mdx @@ -123,7 +123,7 @@ each command to the project's copy. Collaborators, coding agents, and CI then run the same version. One-off runs such as `npx cf@` are not handed off. -Use Node.js 22.18 or later. For details, refer to +Use a supported Node.js release, such as Node.js 24.22 or later in Node.js 24. For details, refer to [Requirements](/cf/get-started/#requirements). ## Understand non-interactive behavior diff --git a/src/content/docs/cf/get-started/first-worker.mdx b/src/content/docs/cf/get-started/first-worker.mdx index 0ff3f1cb33d..fb4feaa3f04 100644 --- a/src/content/docs/cf/get-started/first-worker.mdx +++ b/src/content/docs/cf/get-started/first-worker.mdx @@ -24,8 +24,7 @@ machine, and deploys it to your Cloudflare account. [Install `cf`](/cf/get-started/) and check the [requirements](/cf/get-started/#requirements). You do not need to sign in until -you deploy. New projects use Vite+ and require Node.js 22.23 or later -in Node.js 22, 24.22 or later in Node.js 24, or 26.12 or later in Node.js 26. +you deploy. ## 1. Create a project diff --git a/src/content/docs/cf/get-started/index.mdx b/src/content/docs/cf/get-started/index.mdx index 76e81136791..62793a1ec46 100644 --- a/src/content/docs/cf/get-started/index.mdx +++ b/src/content/docs/cf/get-started/index.mdx @@ -21,7 +21,7 @@ chooses credentials, accounts, and zones. - A Cloudflare account. If you do not have one, [sign up](https://dash.cloudflare.com/sign-up). -- Node.js 22.18 or later. Bun is not supported. When `cf` runs on Bun, commands +- Node.js 22.23+, 24.22+, or 26.12+. Bun is not supported. When `cf` runs on Bun, commands that load `cloudflare.config.ts` fail. ## Install `cf`