[Workers] Add existing project deployment guide for React + Vite#31275
[Workers] Add existing project deployment guide for React + Vite#31275thomasgauvin wants to merge 1 commit into
Conversation
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
Review
Warnings (59)
Suggestions (3)
CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
|
This first PR is focused on extracting the Vite Plugin tutorial into partials that can be reused in the Framework Guides 'deploy your project' sections |
There was a problem hiding this comment.
6 issues found. 3 inline suggestions posted for the partials; 3 additional issues noted below.
HIGH
src/content/docs/workers/framework-guides/web-apps/react.mdxline 7: Thedescriptionfrontmatter is outdated. It only mentions creating a new project, but the page now covers deploying existing projects too. Update it to reflect both paths.src/content/docs/workers/framework-guides/web-apps/react.mdxlines 13–15:Badge,Description, andInlineBadgeare imported but never used. Remove them from the import block.
MEDIUM
src/content/docs/workers/vite-plugin/tutorial.mdxline 8: Therevieweddate is stale (2025-04-04) after this significant refactor. Consider updating it if the content was verified end-to-end.
Out of scope
src/content/docs/workers/framework-guides/web-apps/react.mdxline 208:./worker/index.tsshould be in backticks per the style guide, but this is a pre-existing issue.
| --- | ||
| {} | ||
| --- | ||
|
|
||
| ### Build your application | ||
|
|
||
| Run `npm run build` to build your application. | ||
|
|
||
| ```sh | ||
| npm run build | ||
| ``` |
There was a problem hiding this comment.
Use PackageManagers for package commands per the style guide:
| --- | |
| {} | |
| --- | |
| ### Build your application | |
| Run `npm run build` to build your application. | |
| ```sh | |
| npm run build | |
| ``` | |
| --- | |
| {} | |
| --- | |
| import { PackageManagers } from "~/components"; | |
| ### Build your application | |
| Run the build command to build your application. | |
| <PackageManagers type="run" args="build" /> |
| --- | ||
| {} | ||
| --- | ||
|
|
||
| ### Preview your application | ||
|
|
||
| Run `npm run preview` to validate that your application runs as expected. | ||
|
|
||
| ```sh | ||
| npm run preview | ||
| ``` |
There was a problem hiding this comment.
Use PackageManagers for package commands per the style guide:
| --- | |
| {} | |
| --- | |
| ### Preview your application | |
| Run `npm run preview` to validate that your application runs as expected. | |
| ```sh | |
| npm run preview | |
| ``` | |
| --- | |
| {} | |
| --- | |
| import { PackageManagers } from "~/components"; | |
| ### Preview your application | |
| Run the preview command to validate that your application runs as expected. | |
| <PackageManagers type="run" args="preview" /> |
| --- | ||
| {} | ||
| --- | ||
|
|
||
| ### Deploy to Cloudflare | ||
|
|
||
| Run `npm exec wrangler deploy` to deploy your application to Cloudflare. | ||
|
|
||
| ```sh | ||
| npm exec wrangler deploy | ||
| ``` |
There was a problem hiding this comment.
Use PackageManagers for package commands per the style guide:
| --- | |
| {} | |
| --- | |
| ### Deploy to Cloudflare | |
| Run `npm exec wrangler deploy` to deploy your application to Cloudflare. | |
| ```sh | |
| npm exec wrangler deploy | |
| ``` | |
| --- | |
| {} | |
| --- | |
| import { PackageManagers } from "~/components"; | |
| ### Deploy to Cloudflare | |
| Run the deploy command to deploy your application to Cloudflare. | |
| <PackageManagers type="exec" pkg="wrangler" args="deploy" /> |
|
Labels applied: Posted a review with 3 inline suggestions and a summary comment covering 6 issues. HIGH
MEDIUM
Out of scope
PR otherwise looks structurally sound: no unescaped MDX characters, links are root-relative with trailing slashes, |
Summary
Updates the React + Vite framework guide to include instructions for deploying an existing React + Vite project to Cloudflare Workers, not just creating a new one from scratch.
The guide now uses tabs to separate the two paths:
Reusable steps from the Vite plugin tutorial have been extracted into shared partials under
src/content/partials/workers/vite-plugin/. Both the tutorial and the React framework guide now consume these partials, eliminating duplication and making the content easier to reuse for other framework guides in the future.Partial files created:
add-dependencies.mdxadd-plugin-to-vite-config.mdxcreate-wrangler-config.mdxupdate-gitignore.mdxrun-dev-server.mdxbuild-app.mdxpreview-app.mdxdeploy.mdxadd-tsconfig-worker.mdxadd-worker-config.mdxadd-api-worker.mdxScreenshots (optional)
Documentation checklist