feat(create-cloudflare): new design for the react template#13513
feat(create-cloudflare): new design for the react template#13513edmundhung wants to merge 1 commit intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 241aa3f 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 |
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
|
✅ All changesets look good Review Summary
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
There was a problem hiding this comment.
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, replacing the old custom layout with the upstream hero/documentation/social sections and swapping in a smaller Cloudflare SVG logo.
Issues found (1):
- TypeScript type safety regression in
App.tsx— The old TypeScript template hadres.json() as Promise<{ name: string }>which properly typed the API response. The new version uses bareres.json(), makingdataimplicitlyany. For a TypeScript template that's supposed to show best practices, this should retain the type annotation. (The JS template is fine as-is.)
|
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:
The review has been submitted to PR #13513. |
jamesopstad
left a comment
There was a problem hiding this comment.
This looks really great. Thanks @edmundhung! We also need to update the variants as these are no longer up to date:
workers-sdk/packages/create-cloudflare/templates/react/workers/c3.ts
Lines 119 to 140 in 8ca78bb
The available variants in create-vite are these:
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.
Fixes n/a.
We updated
create-vitefrom v8 to v9 in #12906. This updates our template to follows the latest Vite React starter more closely.A picture of a cute animal (not mandatory, but encouraged)