Skip to content
Source
Sign inSign up
TanStack/router

Add basic Cloudflare E2E tests #5260

Mergedjamesopstad(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/5260/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

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.
    1. 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
      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

      Estimated code review effort

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

      • TanStack/router#5208 — Files add Cloudflare Vite plugin config and use a Cloudflare env binding (MY_VAR), which relates to resolving "cloudflare:workers" module resolution problems referenced in the issue.
      • TanStack/router#5225 — Adjusts Cloudflare Vite plugin usage and ordering similar to this PR's vite.config.ts.
      • TanStack/router#5254 — Adds a Cloudflare example with overlapping files (routes, router, components, tests) similar to this PR.
      • TanStack/router#5215 — Relates to standardizing the router factory entrypoint (getRouter) used here.

      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 nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring 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 nameStatusExplanation
      Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title Check✅ PassedThe 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 b1ce9f8cb8b67af251361315a962e4b695ea9e9e and 1af5aefa58bdec79579804c21abe242ca442d606.

      📒 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.
    2. View your CI Pipeline Execution ↗ for commit 1af5aefa58bdec79579804c21abe242ca442d606

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded1m 5sView ↗
      nx run-many --target=build --exclude=examples/*...✅ Succeeded3sView ↗

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

    3. 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

    4. 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 e55b43696911d3b78aa0a47e6bc0209315a30222 and b1ce9f8cb8b67af251361315a962e4b695ea9e9e.

      ⛔ 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.

      e2e/react-start/basic-cloudflare/package.json lines 16 to 37
      @@ -0,0 +17,21 @@
      17+ "@tanstack/react-router-devtools": "workspace:^",
      18+ "@tanstack/react-start": "workspace:^",
      19+ "react": "^19.0.0",
      20+ "react-dom": "^19.0.0"
      21+ },
      22+ "devDependencies": {
      23+ "@cloudflare/vite-plugin": "^1.13.7",
      24+ "@playwright/test": "^1.50.1",
      25+ "@tanstack/router-e2e-utils": "workspace:^",
      26+ "@types/node": "^22.10.2",
      27+ "@types/react": "^19.0.8",
      28+ "@types/react-dom": "^19.0.3",
      29+ "@vitejs/plugin-react": "^4.3.4",
      30+ "autoprefixer": "^10.4.20",
      31+ "postcss": "^8.5.1",
      32+ "tailwindcss": "^3.4.17",
      33+ "typescript": "^5.7.2",
      34+ "vite": "^7.1.1",
      35+ "vite-tsconfig-paths": "^5.1.4",
      36+ "wrangler": "^4.40.2"
      37+ }

      🛠️ 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.

          "@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).
      e2e/react-start/basic-cloudflare/src/routes/__root.tsx lines 61 to 82
      @@ -0,0 +62,21 @@
      62+ <head>
      63+ <HeadContent />
      64+ </head>
      65+ <body>
      66+ <div className="p-2 flex gap-2 text-lg">
      67+ <Link
      68+ to="/"
      69+ activeProps={{
      70+ className: 'font-bold',
      71+ }}
      72+ activeOptions={{ exact: true }}
      73+ >
      74+ Home
      75+ </Link>
      76+ </div>
      77+ <hr />
      78+ {children}
      79+ <TanStackRouterDevtools position="bottom-right" />
      80+ <Scripts />
      81+ </body>
      82+ </html>

      ⚠️ 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.

          <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.
      e2e/react-start/basic-cloudflare/src/routes/index.tsx line 3
      @@ -0,0 +1,3 @@
      1+import { createFileRoute } from '@tanstack/react-router'
      2+import { createServerFn } from '@tanstack/react-start'
      3+import { env } from 'cloudflare:workers'

      ⚠️ 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.
      e2e/react-start/basic-cloudflare/src/utils/seo.ts lines 20 to 28
      @@ -0,0 +8,21 @@
      8+ description?: string
      9+ image?: string
      10+ keywords?: string
      11+}) => {
      12+ const tags = [
      13+ { title },
      14+ { name: 'description', content: description },
      15+ { name: 'keywords', content: keywords },
      16+ { name: 'twitter:title', content: title },
      17+ { name: 'twitter:description', content: description },
      18+ { name: 'twitter:creator', content: '@tannerlinsley' },
      19+ { name: 'twitter:site', content: '@tannerlinsley' },
      20+ { name: 'og:type', content: 'website' },
      21+ { name: 'og:title', content: title },
      22+ { name: 'og:description', content: description },
      23+ ...(image
      24+ ? [
      25+ { name: 'twitter:image', content: image },
      26+ { name: 'twitter:card', content: 'summary_large_image' },
      27+ { name: 'og:image', content: image },
      28+ ]

      ⚠️ 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.

          { 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.
    5. e2e/react-start/basic-cloudflare/tests/app.spec.ts line 7Outdated
      @@ -0,0 +1,7 @@
      1+import { expect } from '@playwright/test'
      2+import { test } from '@tanstack/router-e2e-utils'
      3+
      4+test('returns the correct user agent', async ({ page }) => {
      5+ await page.goto('/')
      6+
      7+ await expect(page.locator('p').nth(0)).toHaveText(

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

    6. e2e/react-start/basic-cloudflare/tests/app.spec.ts line 17Outdated
      @@ -0,0 +1,17 @@
      1+import { expect } from '@playwright/test'
      2+import { test } from '@tanstack/router-e2e-utils'
      3+
      4+test('returns the correct user agent', async ({ page }) => {
      5+ await page.goto('/')
      6+
      7+ await expect(page.locator('p').nth(0)).toHaveText(
      8+ 'Running in Cloudflare-Workers',
      9+ )
      10+})
      11+
      12+test('returns the correct value from a Cloudflare binding', async ({
      13+ page,
      14+}) => {
      15+ await page.goto('/')
      16+
      17+ await expect(page.locator('p').nth(1)).toHaveText('Hello from Cloudflare')

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

Sign in to join this conversation.