Skip to content

Conversation

jamesopstad
Copy link
Contributor

@jamesopstad jamesopstad commented Sep 26, 2025

Adds e2e/react-start/basic-cloudflare with tests.

Summary by CodeRabbit

  • New Features

    • Added a Cloudflare-targeted React starter with SSR-ready routing, data-loaded home page, friendly error and 404 screens, SEO meta helper, Tailwind styling, PWA manifest/icons, and scroll restoration.
  • Tests

    • Added Playwright end-to-end tests plus automated global setup/teardown validating user agent and Cloudflare binding output.
  • Chores

    • Added project configs for build/dev tooling, TypeScript, PostCSS/Tailwind, Vite, and Cloudflare deployment; updated ignore rules to exclude artifacts and caches.

Copy link
Contributor

coderabbitai bot commented Sep 26, 2025

Walkthrough

Adds a new e2e React Start example for Cloudflare Workers: project scaffolding, Vite/Cloudflare/Tailwind/PostCSS configs, TanStack Router setup and generated route tree, UI components and utilities, Playwright E2E tests with global setup/teardown, and Cloudflare Wrangler config with a MY_VAR binding.

Changes

Cohort / File(s) Summary of changes
Project scaffolding & config
e2e/react-start/basic-cloudflare/.gitignore, e2e/react-start/basic-cloudflare/.prettierignore, e2e/react-start/basic-cloudflare/package.json, e2e/react-start/basic-cloudflare/postcss.config.mjs, e2e/react-start/basic-cloudflare/tailwind.config.mjs, e2e/react-start/basic-cloudflare/tsconfig.json, e2e/react-start/basic-cloudflare/vite.config.ts, e2e/react-start/basic-cloudflare/wrangler.jsonc
Adds Node/Cloudflare project metadata, scripts, tooling configs (Vite with Cloudflare plugin and TanStack Start plugin), TypeScript settings, Tailwind/PostCSS config, and Wrangler with MY_VAR.
Public assets & styles
e2e/react-start/basic-cloudflare/public/site.webmanifest, e2e/react-start/basic-cloudflare/src/styles/app.css
Adds PWA manifest and Tailwind-based global stylesheet.
Router, routes & generated types
e2e/react-start/basic-cloudflare/src/router.tsx, e2e/react-start/basic-cloudflare/src/routeTree.gen.ts, e2e/react-start/basic-cloudflare/src/routes/__root.tsx, e2e/react-start/basic-cloudflare/src/routes/index.tsx, e2e/react-start/basic-cloudflare/src/utils/seo.ts
Introduces getRouter factory, generated route tree with type augmentations, root layout and index file route with server loader, and an SEO meta helper.
UI components
e2e/react-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx, e2e/react-start/basic-cloudflare/src/components/NotFound.tsx
Adds default error/catch boundary and NotFound component with retry/back/start-over actions.
E2E testing & Playwright
e2e/react-start/basic-cloudflare/playwright.config.ts, e2e/react-start/basic-cloudflare/tests/app.spec.ts, e2e/react-start/basic-cloudflare/tests/setup/global.setup.ts, e2e/react-start/basic-cloudflare/tests/setup/global.teardown.ts
Adds Playwright config that builds/previews the app, dynamic baseURL, global dummy server setup/teardown, and tests asserting UA and Cloudflare binding output.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Browser
  participant App as React App
  participant Router as TanStack Router
  participant IndexRoute as "/"
  participant ServerFn as createServerFn().handler
  participant CFEnv as Cloudflare Env (MY_VAR)

  User->>Browser: Navigate to "/"
  Browser->>App: Load app
  App->>Router: Resolve route
  Router->>IndexRoute: Run loader
  IndexRoute->>ServerFn: invoke server handler
  ServerFn->>CFEnv: read MY_VAR
  CFEnv-->>ServerFn: "Hello from Cloudflare"
  ServerFn-->>IndexRoute: return { message, myVar }
  IndexRoute-->>App: render Home with data
  App-->>Browser: display UA and MY_VAR
Loading
sequenceDiagram
  autonumber
  participant CI as Playwright
  participant Setup as Global Setup
  participant Preview as build+preview server
  participant App as Preview App
  participant Tests as app.spec.ts
  participant Teardown as Global Teardown

  CI->>Setup: e2eStartDummyServer(pkgName)
  Setup-->>CI: dummy server started
  CI->>Preview: run build + preview
  Preview-->>App: app started (baseURL)
  CI->>Tests: execute specs
  Tests->>App: GET "/"
  App-->>Tests: HTML with UA + MY_VAR
  CI->>Teardown: e2eStopDummyServer(pkgName)
  Teardown-->>CI: cleanup done
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25–30 minutes

Possibly related issues

Possibly related PRs

Suggested labels

package: react-start

Suggested reviewers

  • schiller-manuel
  • Sheraff

Poem

A rabbit scurries, configs in paw,
Builds routes and tests with careful awe.
Tailwind breezes, Cloudflare hums,
Playwright checks where data comes.
Hop, retry, and start anew — rabbit-approved build through and through. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title “Add basic Cloudflare E2E tests” refers to a genuine aspect of the changeset but omits the extensive scaffolding and configuration added for the e2e React Cloudflare project, making it only partially representative of the main content.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b1ce9f8 and 1af5aef.

📒 Files selected for processing (2)
  • e2e/react-start/basic-cloudflare/src/routes/index.tsx (1 hunks)
  • e2e/react-start/basic-cloudflare/tests/app.spec.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • e2e/react-start/basic-cloudflare/tests/app.spec.ts
  • e2e/react-start/basic-cloudflare/src/routes/index.tsx

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

nx-cloud bot commented Sep 26, 2025

View your CI Pipeline Execution ↗ for commit 1af5aef

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 1m 5s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-26 21:03:20 UTC

Copy link

pkg-pr-new bot commented Sep 26, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5260

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5260

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5260

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5260

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5260

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5260

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5260

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5260

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5260

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5260

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5260

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5260

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5260

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5260

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5260

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5260

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5260

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5260

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5260

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5260

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5260

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5260

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5260

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5260

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5260

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5260

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5260

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5260

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5260

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5260

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5260

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5260

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5260

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5260

commit: 1af5aef

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (3)
e2e/react-start/basic-cloudflare/tsconfig.json (1)

9-19: Add Cloudflare/Vite ambient types to avoid implicit anys

This project includes a Cloudflare Worker entry point and Vite-driven frontend code. Without explicitly pulling in @cloudflare/workers-types and vite/client, strict mode will flag ExecutionContext, KVNamespace, import.meta.env, etc., as missing and push teams to sprinkle manual globals. Please wire the types in here.

     "resolveJsonModule": true,
     "skipLibCheck": true,
     "target": "ES2022",
     "allowJs": true,
     "forceConsistentCasingInFileNames": true,
     "baseUrl": ".",
+    "types": ["@cloudflare/workers-types", "vite/client"],
     "paths": {
       "~/*": ["./src/*"]
     },
e2e/react-start/basic-cloudflare/src/components/NotFound.tsx (1)

1-25: Narrow the children prop type.

We can keep strict typing by using ReactNode instead of any, which helps downstream consumers and tooling.

-import { Link } from '@tanstack/react-router'
+import type { ReactNode } from 'react'
+import { Link } from '@tanstack/react-router'
 
-export function NotFound({ children }: { children?: any }) {
+export function NotFound({ children }: { children?: ReactNode }) {
e2e/react-start/basic-cloudflare/public/site.webmanifest (1)

2-3: Populate PWA manifest names

Leaving name and short_name empty yields blank labels in install prompts. Please fill these fields with a recognizable app name (even a placeholder for the sample) so the manifest produces valid metadata.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e55b436 and b1ce9f8.

⛔ Files ignored due to path filters (8)
  • e2e/react-start/basic-cloudflare/public/android-chrome-192x192.png is excluded by !**/*.png
  • e2e/react-start/basic-cloudflare/public/android-chrome-512x512.png is excluded by !**/*.png
  • e2e/react-start/basic-cloudflare/public/apple-touch-icon.png is excluded by !**/*.png
  • e2e/react-start/basic-cloudflare/public/favicon-16x16.png is excluded by !**/*.png
  • e2e/react-start/basic-cloudflare/public/favicon-32x32.png is excluded by !**/*.png
  • e2e/react-start/basic-cloudflare/public/favicon.ico is excluded by !**/*.ico
  • e2e/react-start/basic-cloudflare/public/favicon.png is excluded by !**/*.png
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • e2e/react-start/basic-cloudflare/.gitignore (1 hunks)
  • e2e/react-start/basic-cloudflare/.prettierignore (1 hunks)
  • e2e/react-start/basic-cloudflare/package.json (1 hunks)
  • e2e/react-start/basic-cloudflare/playwright.config.ts (1 hunks)
  • e2e/react-start/basic-cloudflare/postcss.config.mjs (1 hunks)
  • e2e/react-start/basic-cloudflare/public/site.webmanifest (1 hunks)
  • e2e/react-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx (1 hunks)
  • e2e/react-start/basic-cloudflare/src/components/NotFound.tsx (1 hunks)
  • e2e/react-start/basic-cloudflare/src/routeTree.gen.ts (1 hunks)
  • e2e/react-start/basic-cloudflare/src/router.tsx (1 hunks)
  • e2e/react-start/basic-cloudflare/src/routes/__root.tsx (1 hunks)
  • e2e/react-start/basic-cloudflare/src/routes/index.tsx (1 hunks)
  • e2e/react-start/basic-cloudflare/src/styles/app.css (1 hunks)
  • e2e/react-start/basic-cloudflare/src/utils/seo.ts (1 hunks)
  • e2e/react-start/basic-cloudflare/tailwind.config.mjs (1 hunks)
  • e2e/react-start/basic-cloudflare/tests/app.spec.ts (1 hunks)
  • e2e/react-start/basic-cloudflare/tests/setup/global.setup.ts (1 hunks)
  • e2e/react-start/basic-cloudflare/tests/setup/global.teardown.ts (1 hunks)
  • e2e/react-start/basic-cloudflare/tsconfig.json (1 hunks)
  • e2e/react-start/basic-cloudflare/vite.config.ts (1 hunks)
  • e2e/react-start/basic-cloudflare/wrangler.jsonc (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript in strict mode with extensive type safety across the codebase

Files:

  • e2e/react-start/basic-cloudflare/src/router.tsx
  • e2e/react-start/basic-cloudflare/src/utils/seo.ts
  • e2e/react-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx
  • e2e/react-start/basic-cloudflare/src/components/NotFound.tsx
  • e2e/react-start/basic-cloudflare/tests/app.spec.ts
  • e2e/react-start/basic-cloudflare/tests/setup/global.teardown.ts
  • e2e/react-start/basic-cloudflare/src/routes/__root.tsx
  • e2e/react-start/basic-cloudflare/src/routeTree.gen.ts
  • e2e/react-start/basic-cloudflare/src/routes/index.tsx
  • e2e/react-start/basic-cloudflare/tests/setup/global.setup.ts
  • e2e/react-start/basic-cloudflare/playwright.config.ts
  • e2e/react-start/basic-cloudflare/vite.config.ts
e2e/**

📄 CodeRabbit inference engine (AGENTS.md)

Store end-to-end tests under the e2e/ directory

Files:

  • e2e/react-start/basic-cloudflare/src/router.tsx
  • e2e/react-start/basic-cloudflare/src/styles/app.css
  • e2e/react-start/basic-cloudflare/src/utils/seo.ts
  • e2e/react-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx
  • e2e/react-start/basic-cloudflare/src/components/NotFound.tsx
  • e2e/react-start/basic-cloudflare/tests/app.spec.ts
  • e2e/react-start/basic-cloudflare/wrangler.jsonc
  • e2e/react-start/basic-cloudflare/tests/setup/global.teardown.ts
  • e2e/react-start/basic-cloudflare/src/routes/__root.tsx
  • e2e/react-start/basic-cloudflare/src/routeTree.gen.ts
  • e2e/react-start/basic-cloudflare/public/site.webmanifest
  • e2e/react-start/basic-cloudflare/src/routes/index.tsx
  • e2e/react-start/basic-cloudflare/postcss.config.mjs
  • e2e/react-start/basic-cloudflare/tailwind.config.mjs
  • e2e/react-start/basic-cloudflare/tsconfig.json
  • e2e/react-start/basic-cloudflare/package.json
  • e2e/react-start/basic-cloudflare/tests/setup/global.setup.ts
  • e2e/react-start/basic-cloudflare/playwright.config.ts
  • e2e/react-start/basic-cloudflare/vite.config.ts
**/src/routes/**

📄 CodeRabbit inference engine (AGENTS.md)

Place file-based routes under src/routes/ directories

Files:

  • e2e/react-start/basic-cloudflare/src/routes/__root.tsx
  • e2e/react-start/basic-cloudflare/src/routes/index.tsx
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Use workspace:* protocol for internal dependencies in package.json files

Files:

  • e2e/react-start/basic-cloudflare/package.json
🧠 Learnings (4)
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
PR: TanStack/router#0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{router-cli,router-generator,router-plugin,virtual-file-routes}/** : Keep CLI, generators, bundler plugins, and virtual file routing utilities in their dedicated tooling package directories

Applied to files:

  • e2e/react-start/basic-cloudflare/.prettierignore
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
PR: TanStack/router#0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to e2e/** : Store end-to-end tests under the e2e/ directory

Applied to files:

  • e2e/react-start/basic-cloudflare/tests/app.spec.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
PR: TanStack/router#0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/

Applied to files:

  • e2e/react-start/basic-cloudflare/src/routes/__root.tsx
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
PR: TanStack/router#0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript in strict mode with extensive type safety across the codebase

Applied to files:

  • e2e/react-start/basic-cloudflare/tsconfig.json
🧬 Code graph analysis (10)
e2e/react-start/basic-cloudflare/src/router.tsx (4)
e2e/react-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx (1)
  • DefaultCatchBoundary (10-53)
e2e/react-start/basic-cloudflare/src/components/NotFound.tsx (1)
  • NotFound (3-25)
e2e/react-start/server-routes/src/router.tsx (1)
  • createRouter (6-16)
e2e/react-start/server-functions/src/router.tsx (1)
  • createRouter (6-21)
e2e/react-start/basic-cloudflare/src/utils/seo.ts (1)
scripts/llms-generate.mjs (1)
  • title (96-96)
e2e/react-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx (3)
e2e/react-start/server-routes/src/components/DefaultCatchBoundary.tsx (1)
  • DefaultCatchBoundary (10-53)
e2e/solid-start/server-routes/src/components/DefaultCatchBoundary.tsx (1)
  • DefaultCatchBoundary (10-53)
examples/solid/start-basic/src/components/DefaultCatchBoundary.tsx (1)
  • DefaultCatchBoundary (10-53)
e2e/react-start/basic-cloudflare/src/components/NotFound.tsx (1)
e2e/react-start/server-routes/src/components/NotFound.tsx (1)
  • NotFound (3-25)
e2e/react-start/basic-cloudflare/tests/setup/global.teardown.ts (6)
e2e/react-start/basic/tests/setup/global.teardown.ts (1)
  • teardown (4-6)
e2e/react-router/basic-file-based-code-splitting/tests/setup/global.teardown.ts (1)
  • teardown (4-6)
e2e/react-start/basic-react-query/tests/setup/global.teardown.ts (1)
  • teardown (4-6)
e2e/react-start/scroll-restoration/tests/setup/global.teardown.ts (1)
  • teardown (4-6)
e2e/solid-start/basic/tests/setup/global.teardown.ts (1)
  • teardown (4-6)
e2e/react-router/basic-esbuild-file-based/tests/setup/global.teardown.ts (1)
  • teardown (4-6)
e2e/react-start/basic-cloudflare/src/routes/__root.tsx (4)
e2e/react-start/basic-cloudflare/src/routes/index.tsx (1)
  • Route (5-8)
e2e/react-start/basic-cloudflare/src/utils/seo.ts (1)
  • seo (1-33)
e2e/react-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx (1)
  • DefaultCatchBoundary (10-53)
e2e/react-start/basic-cloudflare/src/components/NotFound.tsx (1)
  • NotFound (3-25)
e2e/react-start/basic-cloudflare/src/routeTree.gen.ts (1)
e2e/react-start/basic-cloudflare/src/router.tsx (1)
  • getRouter (6-16)
e2e/react-start/basic-cloudflare/src/routes/index.tsx (2)
e2e/react-start/basic-cloudflare/src/routes/__root.tsx (1)
  • Route (15-57)
e2e/react-start/basic-cloudflare/worker-configuration.d.ts (1)
  • env (7814-7814)
e2e/react-start/basic-cloudflare/tests/setup/global.setup.ts (7)
e2e/solid-router/basic-file-based/tests/setup/global.setup.ts (1)
  • setup (4-6)
e2e/react-router/basic-file-based-code-splitting/tests/setup/global.setup.ts (1)
  • setup (4-6)
e2e/react-router/rspack-basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts (1)
  • setup (4-6)
e2e/react-router/basic-virtual-file-based/tests/setup/global.setup.ts (1)
  • setup (4-6)
e2e/solid-router/basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts (1)
  • setup (4-6)
e2e/solid-router/basic-file-based-code-splitting/tests/setup/global.setup.ts (1)
  • setup (4-6)
e2e/react-router/basic-file-based/tests/setup/global.setup.ts (1)
  • setup (4-6)
e2e/react-start/basic-cloudflare/playwright.config.ts (1)
scripts/set-ts-version.js (1)
  • packageJson (33-33)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Preview
  • GitHub Check: Test
🔇 Additional comments (12)
e2e/react-start/basic-cloudflare/.gitignore (1)

1-11: Ignore patterns cover the expected Cloudflare + Playwright artifacts

Nothing to change here; the list neatly keeps build outputs and test artifacts out of version control.

e2e/react-start/basic-cloudflare/tests/setup/global.setup.ts (1)

1-6: LGTM – setup hooks into the shared dummy server lifecycle.

This mirrors the existing e2e patterns and ensures the Cloudflare preview spins up before tests run. Nice.

e2e/react-start/basic-cloudflare/postcss.config.mjs (1)

1-6: LGTM – PostCSS stack matches the Tailwind usage.

Straightforward Tailwind + Autoprefixer config, consistent with the rest of our e2e apps.

e2e/react-start/basic-cloudflare/tests/setup/global.teardown.ts (1)

1-6: LGTM – teardown cleanly stops the dummy server.

Complements the global setup and keeps the test harness tidy.

e2e/react-start/basic-cloudflare/src/router.tsx (1)

1-16: LGTM – router factory matches our standard configuration.

Fresh router instance per call with the expected defaults, error boundary, and not-found component.

e2e/react-start/basic-cloudflare/src/styles/app.css (1)

1-22: LGTM – base Tailwind layer aligns with the app shell.

Styles mirror the other React Start examples and keep the dark/light contrast consistent.

e2e/react-start/basic-cloudflare/.prettierignore (1)

1-4: Generated artifacts excluded appropriately

No issues—the ignore patterns cover the generated/public assets we don't want Prettier to touch.

e2e/react-start/basic-cloudflare/wrangler.jsonc (1)

1-9: Wrangler config aligns with worker setup

Settings look consistent: the compatibility flag and entrypoint match the SSR worker expectations.

e2e/react-start/basic-cloudflare/vite.config.ts (1)

1-16: Plugin stack looks correct

tsconfig paths, Cloudflare SSR, TanStack Start, and React plugins are wired in the expected order. All good.

e2e/react-start/basic-cloudflare/playwright.config.ts (1)

5-30: Deterministic preview port setup

Deriving the port via getTestServerPort keeps parallel e2e runs isolated. Nice touch.

e2e/react-start/basic-cloudflare/src/components/DefaultCatchBoundary.tsx (1)

20-49: Error boundary mirrors shared pattern

Matches the existing React Start catch-boundary behavior, including invalidate-and-retry plus conditional back navigation. Looks good.

e2e/react-start/basic-cloudflare/tests/app.spec.ts (1)

4-18: E2E coverage hits the key Cloudflare data paths

Happy-path assertions exercise both the user agent marker and the binding value, so the worker wiring is covered.

Comment on lines +16 to +37
"@tanstack/react-router": "workspace:^",
"@tanstack/react-router-devtools": "workspace:^",
"@tanstack/react-start": "workspace:^",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@cloudflare/vite-plugin": "^1.13.7",
"@playwright/test": "^1.50.1",
"@tanstack/router-e2e-utils": "workspace:^",
"@types/node": "^22.10.2",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.4",
"autoprefixer": "^10.4.20",
"postcss": "^8.5.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.2",
"vite": "^7.1.1",
"vite-tsconfig-paths": "^5.1.4",
"wrangler": "^4.40.2"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Use workspace:* for all internal TanStack dependencies.

Per our workspace convention, internal packages should be referenced with the workspace:* protocol, not workspace:^. Please update both the dependencies and devDependencies entries accordingly.

Apply this diff:

-    "@tanstack/react-router": "workspace:^",
-    "@tanstack/react-router-devtools": "workspace:^",
-    "@tanstack/react-start": "workspace:^",
+    "@tanstack/react-router": "workspace:*",
+    "@tanstack/react-router-devtools": "workspace:*",
+    "@tanstack/react-start": "workspace:*",
@@
-    "@tanstack/router-e2e-utils": "workspace:^",
+    "@tanstack/router-e2e-utils": "workspace:*",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"@tanstack/react-router": "workspace:^",
"@tanstack/react-router-devtools": "workspace:^",
"@tanstack/react-start": "workspace:^",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@cloudflare/vite-plugin": "^1.13.7",
"@playwright/test": "^1.50.1",
"@tanstack/router-e2e-utils": "workspace:^",
"@types/node": "^22.10.2",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.4",
"autoprefixer": "^10.4.20",
"postcss": "^8.5.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.2",
"vite": "^7.1.1",
"vite-tsconfig-paths": "^5.1.4",
"wrangler": "^4.40.2"
}
"@tanstack/react-router": "workspace:*",
"@tanstack/react-router-devtools": "workspace:*",
"@tanstack/react-start": "workspace:*",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@cloudflare/vite-plugin": "^1.13.7",
"@playwright/test": "^1.50.1",
"@tanstack/router-e2e-utils": "workspace:*",
"@types/node": "^22.10.2",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.4",
"autoprefixer": "^10.4.20",
"postcss": "^8.5.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.2",
"vite": "^7.1.1",
"vite-tsconfig-paths": "^5.1.4",
"wrangler": "^4.40.2"
}
🤖 Prompt for AI Agents
In e2e/react-start/basic-cloudflare/package.json around lines 16 to 37, update
internal TanStack package references to use the workspace:* protocol instead of
workspace:^; specifically change "@tanstack/react-router",
"@tanstack/react-router-devtools", and "@tanstack/react-start" in "dependencies"
and "@tanstack/router-e2e-utils" in "devDependencies" to "workspace:*" (and
apply the same change for any other @tanstack/* entries in this range).

Comment on lines +61 to +82
<html>
<head>
<HeadContent />
</head>
<body>
<div className="p-2 flex gap-2 text-lg">
<Link
to="/"
activeProps={{
className: 'font-bold',
}}
activeOptions={{ exact: true }}
>
Home
</Link>
</div>
<hr />
{children}
<TanStackRouterDevtools position="bottom-right" />
<Scripts />
</body>
</html>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add the document language attribute.

<html> without a lang fails WCAG 2.1 level A, so screen readers don’t know what locale to use. Please set the appropriate language (e.g. "en").

-    <html>
+    <html lang="en">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<html>
<head>
<HeadContent />
</head>
<body>
<div className="p-2 flex gap-2 text-lg">
<Link
to="/"
activeProps={{
className: 'font-bold',
}}
activeOptions={{ exact: true }}
>
Home
</Link>
</div>
<hr />
{children}
<TanStackRouterDevtools position="bottom-right" />
<Scripts />
</body>
</html>
<html lang="en">
<head>
<HeadContent />
</head>
<body>
<div className="p-2 flex gap-2 text-lg">
<Link
to="/"
activeProps={{
className: 'font-bold',
}}
activeOptions={{ exact: true }}
>
Home
</Link>
</div>
<hr />
{children}
<TanStackRouterDevtools position="bottom-right" />
<Scripts />
</body>
</html>
🤖 Prompt for AI Agents
In e2e/react-start/basic-cloudflare/src/routes/__root.tsx around lines 61 to 82,
the top-level <html> element is missing a lang attribute which fails WCAG;
update the <html> tag to include an appropriate language attribute (e.g.
lang="en") or derive it from your app/locale config and ensure it is set on the
rendered <html> element so screen readers receive the correct document language.

@@ -0,0 +1,27 @@
import { createFileRoute } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
import { env } from 'cloudflare:workers'
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Avoid importing cloudflare:workers in the shared route module.

This file is bundled for the browser as well as the worker. Pulling in cloudflare:workers at the top level causes the client build to fail because that virtual module only exists in the Cloudflare Worker runtime. Keep the import inside the server-only handler (or use the server context) so the browser bundle never tries to resolve it.

Apply this diff to confine the import to the server handler:

-import { env } from 'cloudflare:workers'
-
 const getData = createServerFn().handler(async () => {
+  const { env } = await import('cloudflare:workers')
   return {
     message: `Running in ${navigator.userAgent}`,
     myVar: env.MY_VAR,
   }
 })
🤖 Prompt for AI Agents
In e2e/react-start/basic-cloudflare/src/routes/index.tsx around line 3,
importing the virtual module 'cloudflare:workers' at the top-level causes the
browser bundle to fail because that module only exists in the Worker runtime;
move the import (or access env via the server-only context) inside the
server-only handler so the client build never tries to resolve it—remove the
top-level import and require or import env within the worker/loader function (or
use the server runtime API) and reference it only inside code guarded for server
execution.

Comment on lines +20 to +28
{ name: 'og:type', content: 'website' },
{ name: 'og:title', content: title },
{ name: 'og:description', content: description },
...(image
? [
{ name: 'twitter:image', content: image },
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'og:image', content: image },
]
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix Open Graph meta attributes

On Line 20 and the surrounding OG entries we’re using name="og:*" instead of property="og:*". Open Graph parsers ignore name, so the tags will not be picked up. Please swap these to property.

-    { name: 'og:type', content: 'website' },
-    { name: 'og:title', content: title },
-    { name: 'og:description', content: description },
+    { property: 'og:type', content: 'website' },
+    { property: 'og:title', content: title },
+    { property: 'og:description', content: description },
@@
-          { name: 'og:image', content: image },
+          { property: 'og:image', content: image },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{ name: 'og:type', content: 'website' },
{ name: 'og:title', content: title },
{ name: 'og:description', content: description },
...(image
? [
{ name: 'twitter:image', content: image },
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'og:image', content: image },
]
{ property: 'og:type', content: 'website' },
{ property: 'og:title', content: title },
{ property: 'og:description', content: description },
...(image
? [
{ name: 'twitter:image', content: image },
{ name: 'twitter:card', content: 'summary_large_image' },
{ property: 'og:image', content: image },
]
🤖 Prompt for AI Agents
e2e/react-start/basic-cloudflare/src/utils/seo.ts around lines 20 to 28: the
Open Graph meta entries currently use name="og:*" which Open Graph parsers
ignore; change those entries to use property="og:type", property="og:title",
property="og:description" and property="og:image" (leave the twitter:* tags
using name as-is) so OG tags are recognized by parsers.

test('returns the correct user agent', async ({ page }) => {
await page.goto('/')

await expect(page.locator('p').nth(0)).toHaveText(
Copy link
Contributor

Choose a reason for hiding this comment

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

please use data-testid instead of locator to make those tests simpler and more robust to changes

}) => {
await page.goto('/')

await expect(page.locator('p').nth(1)).toHaveText('Hello from Cloudflare')
Copy link
Contributor

Choose a reason for hiding this comment

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

please use data-testid instead of locator to make those tests simpler and more robust to changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants