Skip to content

feat(create-cloudflare): new design for the react template#13513

Merged
edmundhung merged 2 commits intomainfrom
edmundhung/update-templates
Apr 21, 2026
Merged

feat(create-cloudflare): new design for the react template#13513
edmundhung merged 2 commits intomainfrom
edmundhung/update-templates

Conversation

@edmundhung
Copy link
Copy Markdown
Member

@edmundhung edmundhung commented Apr 15, 2026

Fixes n/a.

We updated create-vite from v8 to v9 in #12906. This updates our template to follows the latest Vite React starter more closely.

Screenshot 2026-04-15 at 13 24 39
  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: covered by existing tests
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: no feature change

A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 15, 2026

🦋 Changeset detected

Latest commit: 5b38223

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Apr 15, 2026
@workers-devprod workers-devprod requested review from a team and penalosa and removed request for a team April 15, 2026 12:48
@workers-devprod
Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • packages/create-cloudflare/templates/react/workers/js/src/App.css: [@cloudflare/wrangler]
  • packages/create-cloudflare/templates/react/workers/js/src/App.jsx: [@cloudflare/wrangler]
  • packages/create-cloudflare/templates/react/workers/js/src/assets/Cloudflare_Logo.svg: [@cloudflare/wrangler]
  • packages/create-cloudflare/templates/react/workers/js/src/assets/cloudflare.svg: [@cloudflare/wrangler]
  • packages/create-cloudflare/templates/react/workers/ts/src/App.css: [@cloudflare/wrangler]
  • packages/create-cloudflare/templates/react/workers/ts/src/App.tsx: [@cloudflare/wrangler]
  • packages/create-cloudflare/templates/react/workers/ts/src/assets/Cloudflare_Logo.svg: [@cloudflare/wrangler]
  • packages/create-cloudflare/templates/react/workers/ts/src/assets/cloudflare.svg: [@cloudflare/wrangler]

@github-actions
Copy link
Copy Markdown
Contributor

✅ All changesets look good

Review Summary

.changeset/nasty-years-taste.md

  • Package: wrangler
  • Version Type: patch (appropriate for validation/error messaging improvement)
  • Description: Clear and meaningful - explains the improvement to R2 CORS configuration validation and mentions the specific AWS S3-style formatting mistake it catches
  • Headers: No h1/h2/h3 headers ✅

.changeset/refresh-react-workers-template.md

  • Package: create-cloudflare
  • Version Type: patch (appropriate for template design update)
  • Description: Clear and meaningful - explains the design update to the React Workers starter and provides context about following the latest Vite React starter
  • Headers: No h1/h2/h3 headers ✅

Both changesets follow the guidelines from .changeset/README.md with appropriate version types and meaningful descriptions.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 15, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13513

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13513

miniflare

npm i https://pkg.pr.new/miniflare@13513

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13513

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13513

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13513

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13513

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13513

wrangler

npm i https://pkg.pr.new/wrangler@13513

commit: 5b38223

ask-bonk[bot]

This comment was marked as resolved.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Apr 15, 2026

I'm Bonk, and I've done a quick review of your PR.

This PR updates the React Workers template to follow the new Vite v9 React starter design. I found one actionable issue:

  1. TypeScript type safety regression in App.tsx — The old TS template properly typed the API response with res.json() as Promise<{ name: string }>. The new version drops this, making data implicitly any. I posted a suggestion comment on line 40 of the TS template with the fix.

The review has been submitted to PR #13513.

github run

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Contributor

@jamesopstad jamesopstad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really great. Thanks @edmundhung! We also need to update the variants as these are no longer up to date:

const variantsOptions = [
{
value: "react-ts",
lang: "ts",
label: "TypeScript",
},
{
value: "react-swc-ts",
lang: "ts",
label: "TypeScript + SWC",
},
{
value: "react",
lang: "js",
label: "JavaScript",
},
{
value: "react-swc",
lang: "js",
label: "JavaScript + SWC",
},
];

The available variants in create-vite are these:

Image

We should probably include the first four i.e. TypeScript/JavaScript with and without the compiler. Or maybe don't bother with the compiler and just have TypeScript and JavaScript? Up to you.

@penalosa penalosa removed their request for review April 17, 2026 10:46
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Apr 20, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@edmundhung
Copy link
Copy Markdown
Member Author

@jamesopstad I dropped the swc variants as they are no longer supported with create-vite. I don't think it's worth including the react compiler variants so I leave it with just a js and ts variants for now.

Copy link
Copy Markdown
Contributor

@workers-devprod workers-devprod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Apr 21, 2026
@edmundhung edmundhung merged commit f822594 into main Apr 21, 2026
55 of 57 checks passed
@edmundhung edmundhung deleted the edmundhung/update-templates branch April 21, 2026 11:04
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants