Skip to content

Conversation

@juliusmarminge
Copy link
Member

@juliusmarminge juliusmarminge commented Nov 23, 2025

Summary by CodeRabbit

  • New Features

    • Added a TanStack React Start example demonstrating Router + tRPC integration, real-time subscriptions, error boundary and 404 UI, plus devtools.
  • Documentation

    • Added a comprehensive README with local development and docs-preview instructions.
  • Chores

    • Added example project config (package, tsconfig, Vite, Tailwind) and base styles.
    • Expanded repository ignore rules to exclude generated route files and example build dirs.

✏️ Tip: You can customize this high-level summary in your review settings.

@juliusmarminge juliusmarminge requested a review from a team as a code owner November 23, 2025 00:30
@railway-app
Copy link

railway-app bot commented Nov 23, 2025

🚅 Deployed to the trpc-pr-7024 environment in trpc-sse-and-websockets

Service Status Web Updated (UTC)
next-sse-chat 😴 Sleeping (View Logs) Web Dec 20, 2025 at 9:48 am
next-prisma-websockets-starter 😴 Sleeping (View Logs) Nov 23, 2025 at 3:24 am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 23, 2025

Walkthrough

Adds a new TanStack Router + tRPC example project under examples/tanstack-react-start and updates .gitignore to ignore .nitro/, .tanstack/, and any routeTree.gen.ts files.

Changes

Cohort / File(s) Summary
Repository Configuration
\.gitignore
Adds ignore patterns for .nitro/, .tanstack/, and all routeTree.gen.ts files.
Example Project Manifest & Docs
examples/tanstack-react-start/package.json, examples/tanstack-react-start/README.md, examples/tanstack-react-start/tsconfig.json, examples/tanstack-react-start/vite.config.ts
Adds project manifest, README, TypeScript config with path alias, and Vite config with plugins for Tailwind, Nitro, and TanStack tooling.
Application Styles
examples/tanstack-react-start/src/styles/app.css
Adds Tailwind imports and base styles with light/dark theme handling and .using-mouse rule.
Components
examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx, examples/tanstack-react-start/src/components/NotFound.tsx
Adds DefaultCatchBoundary (error UI with retry/back/home) and NotFound component (back/start over UI).
Router bootstrap
examples/tanstack-react-start/src/router.tsx
Adds exported getRouter() to build TanStack Router wired with QueryClient, tRPC client/proxy, default error/not-found components, TRPCProvider wrapping, and SSR query integration.
Root route & pages
examples/tanstack-react-start/src/routes/__root.tsx, examples/tanstack-react-start/src/routes/index.tsx
Adds root route with typed context, RootDocument layout (nav, devtools) and Home route using tRPC Suspense query and a SubscriptionExample.
Server route for TRPC
examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts
Adds file route forwarding GET/POST to a TRPC fetchRequestHandler at /api/trpc.
tRPC infra — init & transformer
examples/tanstack-react-start/src/trpc/init.ts, examples/tanstack-react-start/src/trpc/transformer.ts
Adds tRPC initialization with createTRPCContextInner, exports publicProcedure and createTRPCRouter; re-exports superjson as transformer.
tRPC client & types
examples/tanstack-react-start/src/trpc/client.ts
Adds isomorphic TRPC client factory (makeTRPCClient), TRPCProvider/hooks (useTRPC, useTRPCClient), and RouterOutputs helper; uses in-process local link on server and split/http batch+subscription links on client.
tRPC router (server procedures)
examples/tanstack-react-start/src/trpc/router/_app.ts
Adds appRouter with greeting query and loopData subscription; exports AppRouter type.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Browser as Client
    participant Router as TanStack Router
    participant TRPC as TRPC Client
    participant API as /api/trpc
    participant Handler as fetchRequestHandler
    participant ServerRouter as appRouter

    Browser->>Router: Navigate to "/"
    Router->>TRPC: useSuspenseQuery('greeting',{name})
    TRPC->>API: POST /api/trpc (greeting)
    API->>Handler: forward request
    Handler->>ServerRouter: call greeting
    ServerRouter-->>Handler: { text: "Hello world" }
    Handler-->>API: response
    API-->>TRPC: { text: "Hello world" }
    TRPC-->>Browser: render greeting
Loading
sequenceDiagram
    autonumber
    participant Browser as Client
    participant Router as TanStack Router
    participant TRPC as TRPC Client
    participant API as /api/trpc
    participant ServerRouter as appRouter

    Browser->>Router: Mount SubscriptionExample
    Router->>TRPC: subscribe loopData({lastEventId})
    TRPC->>API: open subscription (SSE/WebSocket)
    API->>ServerRouter: start loopData subscription
    loop every 1s
        ServerRouter->>TRPC: yield data(eventId, payload)
        TRPC-->>Browser: deliver event
    end
    Browser->>TRPC: subscription.reset()
    TRPC->>ServerRouter: unsubscribe
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay extra attention to:
    • examples/tanstack-react-start/src/router.tsx — QueryClient/TRPC wiring and SSR integration.
    • examples/tanstack-react-start/src/trpc/router/_app.ts — subscription lifecycle and async iterator handling.
    • examples/tanstack-react-start/src/trpc/client.ts — isomorphic link selection and subscription/http link composition.
    • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts — request forwarding and method handlers.

Suggested reviewers

  • KATT

Poem

🐰 I hopped a repo branch with cheer,
Router, tRPC, and styles appear.
Subscriptions hum, devtools glow,
A tiny example — ready to show.
Hop in and run — the demo’s here! ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is entirely missing. The template requires sections for 'Changes' and a 'Checklist', but the author provided no description content whatsoever. Add a comprehensive description explaining what the example demonstrates, why it was added, and confirm completion of the contributing checklist items.
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 (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a new example project that uses TanStack Start, which is confirmed by the creation of a complete examples/tanstack-react-start directory with router, components, TRPC integration, and configuration files.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch examples-tanstack-start

📜 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 d7da041 and 0c41ebb.

📒 Files selected for processing (4)
  • examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx (1 hunks)
  • examples/tanstack-react-start/src/components/NotFound.tsx (1 hunks)
  • examples/tanstack-react-start/src/routes/__root.tsx (1 hunks)
  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts
  • examples/tanstack-react-start/src/components/NotFound.tsx
  • examples/tanstack-react-start/src/routes/__root.tsx
  • examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx
⏰ 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). (19)
  • GitHub Check: E2E-tests (soa)
  • GitHub Check: E2E-tests (express-server)
  • GitHub Check: e2e-legacy-node (next-prisma-todomvc, 18.x)
  • GitHub Check: E2E-tests (cloudflare-workers)
  • GitHub Check: E2E-tests (.experimental/next-app-dir)
  • GitHub Check: E2E-tests (.test/diagnostics-big-router)
  • GitHub Check: e2e-legacy-node (next-prisma-websockets-starter, 20.x)
  • GitHub Check: E2E-tests (.test/ssg)
  • GitHub Check: e2e-legacy-node (next-prisma-starter, 18.x)
  • GitHub Check: e2e-legacy-node (next-prisma-websockets-starter, 18.x)
  • GitHub Check: e2e-legacy-node (next-prisma-todomvc, 20.x)
  • GitHub Check: e2e-legacy-node (next-prisma-starter, 20.x)
  • GitHub Check: Test a monorepo using built declaration files
  • GitHub Check: Release using pkg.pr.new
  • GitHub Check: E2E-tests (Deno) (deno-deploy)
  • GitHub Check: E2E-tests (Bun) (bun, ubuntu-latest)
  • GitHub Check: typecheck-www
  • GitHub Check: Lint and auto-fix
  • GitHub Check: test

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

@railway-app railway-app bot temporarily deployed to next-prisma-websockets-starter (trpc-sse-and-websockets / trpc-pr-7024) November 23, 2025 00:30 Destroyed
@railway-app railway-app bot temporarily deployed to next-sse-chat (trpc-sse-and-websockets / trpc-pr-7024) November 23, 2025 00:30 Destroyed
@vercel
Copy link

vercel bot commented Nov 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
next-prisma-starter Ready Ready Preview Nov 23, 2025 3:10am
og-image Ready Ready Preview Comment Nov 23, 2025 3:10am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
www Ignored Ignored Preview Nov 23, 2025 3:10am

@railway-app railway-app bot temporarily deployed to next-sse-chat (trpc-sse-and-websockets / trpc-pr-7024) November 23, 2025 00:34 Destroyed
@railway-app railway-app bot temporarily deployed to next-prisma-websockets-starter (trpc-sse-and-websockets / trpc-pr-7024) November 23, 2025 00:34 Destroyed
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 23, 2025

Open in StackBlitz

@trpc/client

npm i https://pkg.pr.new/trpc/trpc/@trpc/client@7024

@trpc/next

npm i https://pkg.pr.new/trpc/trpc/@trpc/next@7024

@trpc/react-query

npm i https://pkg.pr.new/trpc/trpc/@trpc/react-query@7024

@trpc/server

npm i https://pkg.pr.new/trpc/trpc/@trpc/server@7024

@trpc/tanstack-react-query

npm i https://pkg.pr.new/trpc/trpc/@trpc/tanstack-react-query@7024

@trpc/upgrade

npm i https://pkg.pr.new/trpc/trpc/@trpc/upgrade@7024

commit: 0c41ebb

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: 2

🧹 Nitpick comments (11)
examples/tanstack-react-start/README.md (1)

25-25: Consider markdown formatting improvements.

The static analysis tools flagged a few markdown style issues:

  • Line 25: "markdown" should be capitalized as "Markdown" (proper noun)
  • Line 66: Use proper markdown link syntax instead of bare URLs: [http://localhost:3000/form/latest/docs/overview](http://localhost:3000/form/latest/docs/overview)

Also applies to: 66-66

examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx (1)

27-27: Extract duplicated className to a constant.

The same className string is repeated three times (lines 27, 34, 41). Extract it to reduce duplication and improve maintainability.

Apply this diff:

 export function DefaultCatchBoundary({ error }: ErrorComponentProps) {
   const router = useRouter()
   const isRoot = useMatch({
     strict: false,
     select: (state) => state.id === rootRouteId,
   })
 
   console.error(error)
+
+  const buttonClassName = 'px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold'
 
   return (
     <div className="min-w-0 flex-1 p-4 flex flex-col items-center justify-center gap-6">
       <ErrorComponent error={error} />
       <div className="flex gap-2 items-center flex-wrap">
         <button
           onClick={() => {
             router.invalidate()
           }}
-          className={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold`}
+          className={buttonClassName}
         >
           Try Again
         </button>
         {isRoot ? (
           <Link
             to="/"
-            className={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold`}
+            className={buttonClassName}
           >
             Home
           </Link>
         ) : (
           <Link
             to="/"
-            className={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold`}
+            className={buttonClassName}
             onClick={(e) => {
               e.preventDefault()
               window.history.back()
             }}
           >
             Go Back
           </Link>
         )}
       </div>
     </div>
   )
 }

Also applies to: 34-34, 41-41

examples/tanstack-react-start/src/trpc/client.ts (1)

1-52: Split AppRouter into a separate type import

To match the TS guidelines (“always use import type for type‑only imports” and keep type/value imports separate), consider adjusting the AppRouter import like this:

-import { appRouter, type AppRouter } from '~/trpc/router/_app';
+import { appRouter } from '~/trpc/router/_app';
+import type { AppRouter } from '~/trpc/router/_app';

The rest of the isomorphic client setup (localLink on the server and split httpSubscriptionLink/httpBatchStreamLink on the client) looks solid.
As per coding guidelines

examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts (1)

6-21: Avoid parameter destructuring in GET/POST handlers

Repo guidelines forbid destructuring in function parameter declarations. You can keep behavior identical with:

   export const Route = createFileRoute('/api/trpc/$trpc')({
   server: {
     handlers: {
-      GET: ({ request }) => handler(request),
-      POST: ({ request }) => handler(request),
+      GET: (ctx) => handler(ctx.request),
+      POST: (ctx) => handler(ctx.request),
     },
   },
 });

The shared handler around fetchRequestHandler and /api/trpc endpoint otherwise looks good.
As per coding guidelines

examples/tanstack-react-start/src/router.tsx (1)

31-42: Avoid destructuring props in the Wrap component

To align with the “never destructure in function parameter declarations” rule, you can rewrite Wrap without changing behavior:

-    Wrap: ({ children }) => (
-      <TRPCProvider trpcClient={trpcClient} queryClient={queryClient}>
-        {children}
-      </TRPCProvider>
-    ),
+    Wrap: (props) => (
+      <TRPCProvider trpcClient={trpcClient} queryClient={queryClient}>
+        {props.children}
+      </TRPCProvider>
+    ),

The rest of the router + TRPC/QueryClient integration looks correct and idiomatic for TanStack Start.
As per coding guidelines

examples/tanstack-react-start/src/routes/index.tsx (1)

10-72: TRPC query + subscription usage looks correct

The Home and SubscriptionExample components are wired the way the TanStack React Query + tRPC docs recommend (queryOptions + useSuspenseQuery, subscriptionOptions + useSubscription, and wrapping the subscription in ClientOnly), and I don’t see functional issues here.

If you want perfect HTML semantics later, you could wrap the <tr> rows in a <tbody>, but that’s purely optional for this example.

examples/tanstack-react-start/src/trpc/init.ts (1)

13-32: Keep the context doc comment in sync with the actual route path

The tRPC init and context setup look good and match the recommended patterns. Tiny nit: the comment still references /trpc/$trpc, while the actual route is /api/trpc/$trpc. You could update it for clarity:

- * Shared context helper invoked by both `localLink` during SSR as
- * well as the /trpc/$trpc API route handler for HTTP requests.
+ * Shared context helper invoked by both `localLink` during SSR as
+ * well as the /api/trpc/$trpc API route handler for HTTP requests.

Otherwise this file is in good shape.

examples/tanstack-react-start/src/trpc/router/_app.ts (2)

1-3: Align zod import style with project guidelines

Guidelines say to prefer namespace imports for validation libraries; consider switching to import * as z from 'zod' instead of a named import.

As per coding guidelines.


16-22: Avoid parameter destructuring in procedure resolver

The guidelines forbid destructuring in function parameter declarations; you currently have .query(({ input }) => { ... }). Prefer using the options object and accessing input inside the body, e.g.:

.query((opts) => {
  const input = opts.input;
  return {
    text: `hello ${input?.name ?? 'world'}`,
  };
})

This also avoids unnecessary destructuring for a value used only once.

As per coding guidelines.

examples/tanstack-react-start/src/routes/__root.tsx (2)

56-82: Refactor RootDocument to avoid parameter destructuring

Guidelines prohibit destructuring in function parameters; function RootDocument({ children }: { children: React.ReactNode }) violates this. Consider:

function RootDocument(props: { children: React.ReactNode }) {
  return (
    <html>
      <head>
        <HeadContent />
      </head>
      <body>
        {/* ... */}
        {props.children}
        {/* ... */}
      </body>
    </html>
  );
}

This also aligns with the preference for direct property access when a value is used only once.

As per coding guidelines.


58-63: Optional: Add lang attribute for accessibility

For better a11y and semantics, consider specifying a language on the root element, e.g. <html lang="en">.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ffa88b0 and f77f251.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (16)
  • .gitignore (2 hunks)
  • examples/tanstack-react-start/README.md (1 hunks)
  • examples/tanstack-react-start/package.json (1 hunks)
  • examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx (1 hunks)
  • examples/tanstack-react-start/src/components/NotFound.tsx (1 hunks)
  • examples/tanstack-react-start/src/router.tsx (1 hunks)
  • examples/tanstack-react-start/src/routes/__root.tsx (1 hunks)
  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts (1 hunks)
  • examples/tanstack-react-start/src/routes/index.tsx (1 hunks)
  • examples/tanstack-react-start/src/styles/app.css (1 hunks)
  • examples/tanstack-react-start/src/trpc/client.ts (1 hunks)
  • examples/tanstack-react-start/src/trpc/init.ts (1 hunks)
  • examples/tanstack-react-start/src/trpc/router/_app.ts (1 hunks)
  • examples/tanstack-react-start/src/trpc/transformer.ts (1 hunks)
  • examples/tanstack-react-start/tsconfig.json (1 hunks)
  • examples/tanstack-react-start/vite.config.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

**/*.{ts,tsx}: Always use import type for type-only imports
Separate type imports from value imports
Avoid overzealous object destructuring; prefer direct property access
Object destructuring is acceptable when a variable is used 3+ times
Prefer array destructuring
Avoid sparse array destructuring
Never destructure in function parameter declarations
Avoid destructuring potentially nullish nested properties
Maximum 3 parameters per function; use options objects when more
Type parameter names must match /^(T|$)(A-Z)?[0-9]*$/
Prefix unused variables, parameters, and caught errors with _
Prefer namespace imports for validation libraries and large modules (e.g., import * as z from 'zod', import * as React from 'react')
Follow import order: test helpers, tRPC test imports, third-party, then relative
Never import from @trpc/*/src; import from the package root instead
Do not use Symbol.dispose or Symbol.asyncDispose; use makeResource()/makeAsyncResource()
Always use await using for resource cleanup
Prefer makeResource()/makeAsyncResource() over manual disposal logic
Avoid non-null assertions (!)
Use proper type guards and optional chaining instead of non-null assertions
Switch statements must be exhaustive for union types
Rely on TypeScript inference; avoid unnecessary explicit return/output types
Use explicit types at public API boundaries, for complex generic constraints, or when inference is insufficient/ambiguous
Use the satisfies operator to retain inference while enforcing shapes
Use as const for literal type inference when appropriate
Prefer explicit typing over any
Use type assertions sparingly
Leverage TypeScript strict mode features

Files:

  • examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx
  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts
  • examples/tanstack-react-start/src/trpc/init.ts
  • examples/tanstack-react-start/src/components/NotFound.tsx
  • examples/tanstack-react-start/src/router.tsx
  • examples/tanstack-react-start/src/trpc/client.ts
  • examples/tanstack-react-start/src/trpc/router/_app.ts
  • examples/tanstack-react-start/src/routes/__root.tsx
  • examples/tanstack-react-start/src/routes/index.tsx
  • examples/tanstack-react-start/src/trpc/transformer.ts
  • examples/tanstack-react-start/vite.config.ts
**/*.{ts,tsx,md,mdx}

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

Use camelCase for file names (with exceptions like TRPC/RPC/HTTP/JSON acronyms, .config.js, .d.ts, and tests)

Files:

  • examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx
  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts
  • examples/tanstack-react-start/src/trpc/init.ts
  • examples/tanstack-react-start/README.md
  • examples/tanstack-react-start/src/components/NotFound.tsx
  • examples/tanstack-react-start/src/router.tsx
  • examples/tanstack-react-start/src/trpc/client.ts
  • examples/tanstack-react-start/src/trpc/router/_app.ts
  • examples/tanstack-react-start/src/routes/__root.tsx
  • examples/tanstack-react-start/src/routes/index.tsx
  • examples/tanstack-react-start/src/trpc/transformer.ts
  • examples/tanstack-react-start/vite.config.ts
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

**/*.tsx: Follow React Hooks rules (React Compiler compatible patterns)
Use the JSX runtime (no need to import React for JSX)
Prefer function components

Files:

  • examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx
  • examples/tanstack-react-start/src/components/NotFound.tsx
  • examples/tanstack-react-start/src/router.tsx
  • examples/tanstack-react-start/src/routes/__root.tsx
  • examples/tanstack-react-start/src/routes/index.tsx
🧠 Learnings (44)
📓 Common learnings
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:01.878Z
Learning: Applies to packages/react-query/**/*.test.tsx : Create the tRPC React client with createTRPCReact<typeof appRouter>()
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : Use `ctx.useTRPCClient()` for direct (vanilla) tRPC client access in tests
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : Use `ctx.useTRPC()` for TanStack React Query hooks access in components under test
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Share common functionality through `trpc/server` and keep client/server concerns separate
📚 Learning: 2025-09-05T15:16:31.379Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : Do NOT import legacy helpers like `createAppRouter` from `./__testHelpers`

Applied to files:

  • examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx
  • .gitignore
  • examples/tanstack-react-start/README.md
  • examples/tanstack-react-start/src/components/NotFound.tsx
  • examples/tanstack-react-start/src/router.tsx
  • examples/tanstack-react-start/src/trpc/router/_app.ts
  • examples/tanstack-react-start/package.json
  • examples/tanstack-react-start/src/routes/__root.tsx
  • examples/tanstack-react-start/src/routes/index.tsx
📚 Learning: 2025-09-05T15:16:01.878Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:01.878Z
Learning: Applies to packages/react-query/**/*.test.tsx : Create the tRPC React client with createTRPCReact<typeof appRouter>()

Applied to files:

  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts
  • examples/tanstack-react-start/src/trpc/init.ts
  • examples/tanstack-react-start/src/router.tsx
  • examples/tanstack-react-start/src/trpc/client.ts
  • examples/tanstack-react-start/src/trpc/router/_app.ts
  • examples/tanstack-react-start/src/routes/__root.tsx
  • examples/tanstack-react-start/src/routes/index.tsx
📚 Learning: 2025-09-05T15:16:31.379Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : Use `ctx.useTRPCClient()` for direct (vanilla) tRPC client access in tests

Applied to files:

  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts
  • examples/tanstack-react-start/src/trpc/init.ts
  • examples/tanstack-react-start/src/router.tsx
  • examples/tanstack-react-start/src/trpc/client.ts
  • examples/tanstack-react-start/src/trpc/router/_app.ts
  • examples/tanstack-react-start/package.json
  • examples/tanstack-react-start/src/routes/__root.tsx
  • examples/tanstack-react-start/src/routes/index.tsx
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Share common functionality through `trpc/server` and keep client/server concerns separate

Applied to files:

  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts
  • examples/tanstack-react-start/src/trpc/init.ts
  • examples/tanstack-react-start/src/trpc/client.ts
  • examples/tanstack-react-start/src/trpc/router/_app.ts
📚 Learning: 2025-09-05T15:16:31.379Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : Use `ctx.useTRPC()` for TanStack React Query hooks access in components under test

Applied to files:

  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts
  • examples/tanstack-react-start/src/trpc/init.ts
  • examples/tanstack-react-start/src/router.tsx
  • examples/tanstack-react-start/src/trpc/client.ts
  • examples/tanstack-react-start/src/trpc/router/_app.ts
  • examples/tanstack-react-start/package.json
  • examples/tanstack-react-start/src/routes/__root.tsx
  • examples/tanstack-react-start/src/routes/index.tsx
📚 Learning: 2025-09-05T15:17:32.520Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/upgrade-tests.mdc:0-0
Timestamp: 2025-09-05T15:17:32.520Z
Learning: Applies to packages/upgrade/**/*.{test,spec,trpc,snap}.tsx : Import both 'trpc/react-query' as rq (legacy) and 'trpc/tanstack-react-query' as trq (modern) when writing migration tests

Applied to files:

  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts
  • examples/tanstack-react-start/src/trpc/init.ts
  • examples/tanstack-react-start/src/router.tsx
  • examples/tanstack-react-start/src/trpc/client.ts
  • examples/tanstack-react-start/package.json
  • examples/tanstack-react-start/src/trpc/transformer.ts
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.{ts,tsx} : Never import from `trpc/*/src`; import from the package root instead

Applied to files:

  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts
  • examples/tanstack-react-start/src/trpc/init.ts
  • examples/tanstack-react-start/tsconfig.json
📚 Learning: 2025-09-05T15:16:01.878Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:01.878Z
Learning: Applies to packages/react-query/**/*.test.tsx : Import createTRPCReact from 'trpc/react-query' (legacy API)

Applied to files:

  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts
  • examples/tanstack-react-start/src/trpc/init.ts
  • examples/tanstack-react-start/src/router.tsx
  • examples/tanstack-react-start/src/trpc/client.ts
  • examples/tanstack-react-start/src/routes/__root.tsx
  • examples/tanstack-react-start/src/routes/index.tsx
📚 Learning: 2025-09-05T15:16:48.745Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/test-patterns.mdc:0-0
Timestamp: 2025-09-05T15:16:48.745Z
Learning: Applies to **/*.test.ts : Import `testServerAndClientResource` from `trpc/client/__tests__/testClientResource`

Applied to files:

  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts
  • .gitignore
  • examples/tanstack-react-start/src/trpc/client.ts
📚 Learning: 2025-09-05T15:16:48.745Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/test-patterns.mdc:0-0
Timestamp: 2025-09-05T15:16:48.745Z
Learning: Applies to **/*.test.ts : NEVER use the deprecated `routerToServerAndClientNew()` in tests

Applied to files:

  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts
  • .gitignore
  • examples/tanstack-react-start/src/trpc/router/_app.ts
📚 Learning: 2025-09-05T15:17:32.520Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/upgrade-tests.mdc:0-0
Timestamp: 2025-09-05T15:17:32.520Z
Learning: Applies to packages/upgrade/**/*.{test,spec,trpc,snap}.tsx : For migration testing, exercise both legacy and modern patterns via ctx.rq and ctx.trq within the same test when relevant

Applied to files:

  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts
  • .gitignore
📚 Learning: 2025-09-05T15:16:01.878Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:01.878Z
Learning: Applies to packages/react-query/**/*.test.tsx : If not using createAppRouter, you may create an inline router using testServerAndClientResource with appropriate server and client link configuration

Applied to files:

  • examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts
  • .gitignore
  • examples/tanstack-react-start/src/router.tsx
  • examples/tanstack-react-start/src/trpc/client.ts
  • examples/tanstack-react-start/src/routes/__root.tsx
  • examples/tanstack-react-start/src/routes/index.tsx
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.{ts,tsx,md,mdx} : Use camelCase for file names (with exceptions like TRPC/RPC/HTTP/JSON acronyms, .config.js, .d.ts, and tests)

Applied to files:

  • .gitignore
  • examples/tanstack-react-start/tsconfig.json
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.{ts,tsx} : Prefix unused variables, parameters, and caught errors with `_`

Applied to files:

  • .gitignore
📚 Learning: 2025-09-05T15:17:32.520Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/upgrade-tests.mdc:0-0
Timestamp: 2025-09-05T15:17:32.520Z
Learning: Applies to packages/upgrade/**/*.{test,spec,trpc,snap}.tsx : Do NOT import legacy-only helpers like createAppRouter from './__testHelpers' in upgrade-package tests

Applied to files:

  • .gitignore
  • examples/tanstack-react-start/src/trpc/router/_app.ts
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.{ts,tsx} : Follow import order: test helpers, tRPC test imports, third-party, then relative

Applied to files:

  • .gitignore
  • examples/tanstack-react-start/tsconfig.json
📚 Learning: 2025-09-05T15:16:01.878Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:01.878Z
Learning: Applies to packages/react-query/**/*.test.tsx : ALWAYS import createAppRouter from './__testHelpers' (not '__helpers')

Applied to files:

  • .gitignore
  • examples/tanstack-react-start/src/router.tsx
  • examples/tanstack-react-start/src/trpc/router/_app.ts
  • examples/tanstack-react-start/src/routes/__root.tsx
  • examples/tanstack-react-start/src/routes/index.tsx
📚 Learning: 2025-09-05T15:16:48.745Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/test-patterns.mdc:0-0
Timestamp: 2025-09-05T15:16:48.745Z
Learning: Applies to **/*.test.ts : Configure server options via the `server` property in `testServerAndClientResource` options

Applied to files:

  • .gitignore
📚 Learning: 2025-09-05T15:16:01.878Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:01.878Z
Learning: Applies to packages/react-query/**/*.test.tsx : Manage test resources with konn(): call createAppRouter() in beforeEach and ctx?.close?.() in afterEach

Applied to files:

  • .gitignore
  • examples/tanstack-react-start/src/routes/__root.tsx
📚 Learning: 2025-02-19T20:31:52.088Z
Learnt from: barelyhuman
Repo: trpc/trpc PR: 6530
File: packages/upgrade/src/bin/cli.ts:218-222
Timestamp: 2025-02-19T20:31:52.088Z
Learning: The CLI options `trpcFile` and `trpcImportName` in `packages/upgrade/src/bin/cli.ts` are temporary and planned to be removed in favor of using automatically discovered references from the TypeScript program.

Applied to files:

  • examples/tanstack-react-start/src/trpc/init.ts
📚 Learning: 2025-06-09T14:01:20.033Z
Learnt from: juliusmarminge
Repo: trpc/trpc PR: 6789
File: packages/tanstack-react-query/tsdown.config.ts:1-24
Timestamp: 2025-06-09T14:01:20.033Z
Learning: In the tRPC monorepo, packages/tests and packages/upgrade don't need main/module/types fields in their package.json because tests is not distributed and upgrade just exposes a binary.

Applied to files:

  • examples/tanstack-react-start/src/trpc/init.ts
📚 Learning: 2025-09-05T15:16:01.878Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:01.878Z
Learning: Applies to packages/react-query/**/*.test.tsx : Wrap components with a custom App that provides trpc.Provider (legacy) and QueryClientProvider

Applied to files:

  • examples/tanstack-react-start/src/trpc/init.ts
  • examples/tanstack-react-start/src/router.tsx
  • examples/tanstack-react-start/src/trpc/client.ts
  • examples/tanstack-react-start/src/trpc/router/_app.ts
  • examples/tanstack-react-start/src/routes/__root.tsx
  • examples/tanstack-react-start/src/routes/index.tsx
📚 Learning: 2025-09-05T15:16:31.379Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : Import React testing utilities with `import * as React from 'react';`

Applied to files:

  • examples/tanstack-react-start/src/components/NotFound.tsx
  • examples/tanstack-react-start/tsconfig.json
  • examples/tanstack-react-start/package.json
📚 Learning: 2025-09-05T15:16:31.379Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : Render via `ctx.renderApp()` and rerender via `ctx.rerenderApp()` instead of custom providers

Applied to files:

  • examples/tanstack-react-start/src/components/NotFound.tsx
  • examples/tanstack-react-start/package.json
  • examples/tanstack-react-start/src/routes/__root.tsx
  • examples/tanstack-react-start/src/routes/index.tsx
📚 Learning: 2025-09-05T15:16:01.878Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:01.878Z
Learning: Applies to packages/react-query/**/*.test.tsx : Use queryClient, db, and resolvers exposed by createAppRouter instead of redefining them

Applied to files:

  • examples/tanstack-react-start/src/router.tsx
  • examples/tanstack-react-start/src/trpc/client.ts
  • examples/tanstack-react-start/src/trpc/router/_app.ts
  • examples/tanstack-react-start/src/routes/__root.tsx
  • examples/tanstack-react-start/src/routes/index.tsx
📚 Learning: 2025-09-05T15:16:01.878Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:01.878Z
Learning: Applies to packages/react-query/**/*.test.tsx : ALWAYS use createAppRouter() helper for legacy React Query tests

Applied to files:

  • examples/tanstack-react-start/src/router.tsx
  • examples/tanstack-react-start/src/routes/__root.tsx
  • examples/tanstack-react-start/src/routes/index.tsx
📚 Learning: 2025-09-05T15:16:01.878Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:01.878Z
Learning: Applies to packages/react-query/**/*.test.tsx : Import getUntypedClient from 'trpc/client' when an untyped client is needed

Applied to files:

  • examples/tanstack-react-start/src/router.tsx
  • examples/tanstack-react-start/src/trpc/client.ts
📚 Learning: 2025-09-05T15:16:48.745Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/test-patterns.mdc:0-0
Timestamp: 2025-09-05T15:16:48.745Z
Learning: Applies to **/*.test.ts : Use `ctx.client` from the test resource for making tRPC calls

Applied to files:

  • examples/tanstack-react-start/src/trpc/client.ts
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.{ts,tsx} : Leverage TypeScript strict mode features

Applied to files:

  • examples/tanstack-react-start/tsconfig.json
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.{ts,tsx} : Use `as const` for literal type inference when appropriate

Applied to files:

  • examples/tanstack-react-start/tsconfig.json
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.{ts,tsx} : Separate type imports from value imports

Applied to files:

  • examples/tanstack-react-start/tsconfig.json
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.{ts,tsx} : Use explicit types at public API boundaries, for complex generic constraints, or when inference is insufficient/ambiguous

Applied to files:

  • examples/tanstack-react-start/tsconfig.json
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.{ts,tsx} : Prefer namespace imports for validation libraries and large modules (e.g., `import * as z from 'zod'`, `import * as React from 'react'`)

Applied to files:

  • examples/tanstack-react-start/tsconfig.json
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.{ts,tsx} : Always use `import type` for type-only imports

Applied to files:

  • examples/tanstack-react-start/tsconfig.json
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.{ts,tsx} : Avoid sparse array destructuring

Applied to files:

  • examples/tanstack-react-start/tsconfig.json
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.{ts,tsx} : Prefer array destructuring

Applied to files:

  • examples/tanstack-react-start/tsconfig.json
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.tsx : Follow React Hooks rules (React Compiler compatible patterns)

Applied to files:

  • examples/tanstack-react-start/tsconfig.json
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.tsx : Use the JSX runtime (no need to import React for JSX)

Applied to files:

  • examples/tanstack-react-start/tsconfig.json
📚 Learning: 2025-09-05T15:16:31.379Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : Import TanStack React Query utilities from the package source via `../src`

Applied to files:

  • examples/tanstack-react-start/package.json
📚 Learning: 2025-09-05T15:16:31.379Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : Import React Query types from `tanstack/react-query` as needed

Applied to files:

  • examples/tanstack-react-start/package.json
  • examples/tanstack-react-start/src/routes/__root.tsx
📚 Learning: 2025-09-05T15:16:31.379Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : Do NOT import `testReactResource` from `./test/__helpers` (wrong path)

Applied to files:

  • examples/tanstack-react-start/package.json
📚 Learning: 2025-09-05T15:16:31.379Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : ALWAYS use `await using ctx = testReactResource(...)` to set up TanStack React Query tests

Applied to files:

  • examples/tanstack-react-start/package.json
📚 Learning: 2025-09-05T15:16:31.379Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : Import `testReactResource` from the local path `./__helpers`

Applied to files:

  • examples/tanstack-react-start/package.json
🧬 Code graph analysis (6)
examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts (3)
packages/server/src/adapters/fetch/fetchRequestHandler.ts (1)
  • fetchRequestHandler (24-80)
examples/tanstack-react-start/src/trpc/router/_app.ts (1)
  • appRouter (7-58)
examples/tanstack-react-start/src/trpc/init.ts (1)
  • createTRPCContextInner (18-21)
examples/tanstack-react-start/src/router.tsx (6)
examples/tanstack-react-start/src/trpc/transformer.ts (1)
  • transformer (8-8)
examples/tanstack-react-start/src/trpc/client.ts (1)
  • makeTRPCClient (22-50)
examples/tanstack-react-start/src/trpc/router/_app.ts (1)
  • AppRouter (60-60)
examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx (1)
  • DefaultCatchBoundary (10-53)
examples/tanstack-react-start/src/components/NotFound.tsx (1)
  • NotFound (3-25)
packages/react-query/src/shared/hooks/types.ts (1)
  • TRPCProvider (237-239)
examples/tanstack-react-start/src/trpc/client.ts (6)
examples/tanstack-react-start/src/trpc/router/_app.ts (2)
  • AppRouter (60-60)
  • appRouter (7-58)
packages/client/src/links/localLink.ts (1)
  • unstable_localLink (40-277)
examples/tanstack-react-start/src/trpc/init.ts (1)
  • createTRPCContextInner (18-21)
packages/client/src/links/splitLink.ts (1)
  • splitLink (9-30)
packages/client/src/links/httpSubscriptionLink.ts (1)
  • httpSubscriptionLink (65-240)
packages/client/src/links/httpBatchStreamLink.ts (1)
  • httpBatchStreamLink (23-186)
examples/tanstack-react-start/src/trpc/router/_app.ts (1)
examples/tanstack-react-start/src/trpc/init.ts (2)
  • createTRPCRouter (32-32)
  • publicProcedure (30-30)
examples/tanstack-react-start/src/routes/__root.tsx (5)
examples/tanstack-react-start/src/routes/index.tsx (1)
  • Route (6-8)
packages/client/src/createTRPCClient.ts (1)
  • TRPCClient (40-48)
examples/tanstack-react-start/src/trpc/router/_app.ts (1)
  • AppRouter (60-60)
examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx (1)
  • DefaultCatchBoundary (10-53)
examples/tanstack-react-start/src/components/NotFound.tsx (1)
  • NotFound (3-25)
examples/tanstack-react-start/src/routes/index.tsx (2)
examples/tanstack-react-start/src/routes/__root.tsx (1)
  • Route (20-46)
examples/tanstack-react-start/src/routes/api/trpc.$trpc.ts (1)
  • Route (14-21)
🪛 LanguageTool
examples/tanstack-react-start/README.md

[uncategorized] ~25-~25: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ...TanStack Router app. In production, the markdown doc pages are fetched from the GitHub r...

(MARKDOWN_NNP)


[style] ~71-~71: Using many exclamation marks might seem excessive (in this case: 8 exclamation marks for a text that’s 1725 characters long)
Context: ...e manually reloaded in the browser. > [!WARNING] > You will need to update the docs/config.json file (in the project's repo) if you add a new doc page!

(EN_EXCESSIVE_EXCLAMATION)

🪛 markdownlint-cli2 (0.18.1)
examples/tanstack-react-start/README.md

46-46: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


53-53: Blank line inside blockquote

(MD028, no-blanks-blockquote)


66-66: Bare URL used

(MD034, no-bare-urls)


70-70: Blank line inside blockquote

(MD028, no-blanks-blockquote)

⏰ 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). (4)
  • GitHub Check: test
  • GitHub Check: typecheck
  • GitHub Check: build
  • GitHub Check: Lint and auto-fix
🔇 Additional comments (6)
.gitignore (1)

8-8: LGTM!

The additions follow existing naming conventions and are well-organized:

  • .nitro/ and .tanstack/ appropriately ignore build artifacts from the Nitro server and TanStack tooling (consistent with .vinxi/ already present)
  • **/routeTree.gen.ts correctly captures TanStack Router-generated route trees at any nesting level

Also applies to: 10-10, 38-38

examples/tanstack-react-start/src/styles/app.css (1)

27-29: Ensure proper mouse detection for accessibility.

The .using-mouse selector suppresses outlines for all descendants, which is acceptable for mouse users but requires careful implementation. Verify that the JavaScript code properly adds/removes this class based on actual input method detection (mouse vs keyboard) to maintain keyboard accessibility.

examples/tanstack-react-start/src/trpc/transformer.ts (1)

1-8: LGTM!

Clean implementation with helpful documentation. The centralized transformer export allows for easy extension with custom type handlers in the future.

examples/tanstack-react-start/package.json (1)

37-37: Confirm rolldown-vite is intentional for this example.

The rolldown-vite@7.2.5 package is an experimental/beta Vite build that uses Rolldown (a Rust bundler) as a drop-in replacement for testing purposes. While version 7.2.5 is published, rolldown-vite is explicitly experimental and only the most recent minor receives updates; patch releases can contain breaking changes.

For an example project that users may clone, confirm:

  • Is showcasing Rolldown capabilities the intended goal, or should this use standard Vite?
  • Are you prepared for potential breaking changes or ecosystem incompatibilities?
  • Will users expect this example to be production-ready and stable?
examples/tanstack-react-start/src/trpc/router/_app.ts (1)

23-53: Subscription implementation looks solid for the example use case

Input schema, abort handling, and use of tracked yield values form a clear, easy-to-follow example of a streaming procedure. No blocking or correctness issues stand out for an example.

examples/tanstack-react-start/src/routes/__root.tsx (1)

20-46: Root route context and wiring look correct

Typed context for queryClient, trpcClient, and trpc matches the surrounding TRPC setup, and error/not-found/component wiring is consistent with TanStack Router Start patterns.

Comment on lines 39 to 48
<Link
to="/"
className={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold`}
onClick={(e) => {
e.preventDefault()
window.history.back()
}}
>
Go Back
</Link>
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

Remove unnecessary to prop on prevented navigation.

The "Go Back" Link component specifies to="/" but immediately prevents default navigation and calls window.history.back(). This is inconsistent and potentially confusing. Consider either:

  1. Remove the to prop since navigation is prevented, or
  2. Use a <button> element instead since this isn't actually navigating via the router

Option 1: Remove the to prop

         ) : (
-          <Link
-            to="/"
-            className={buttonClassName}
-            onClick={(e) => {
+          <button
+            className={buttonClassName}
+            onClick={() => {
-              e.preventDefault()
               window.history.back()
             }}
           >
             Go Back
-          </Link>
+          </button>
         )}

Option 2: Use proper router navigation
If you want to navigate within the router, consider using router.history.back() instead of window.history.back() without preventDefault.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx around
lines 39 to 48, the Link uses a `to="/"` prop but the click handler prevents
default and calls `window.history.back()`, which is inconsistent; fix by either
removing the `to` prop from the Link when you intend to intercept navigation and
keep the click handler, or replace the Link with a semantic <button> element
styled the same and attach the onClick that calls `window.history.back()`;
alternatively, if you want to perform router-based back navigation, remove
preventDefault and invoke the router's back/history API instead of
window.history.back().

@@ -0,0 +1,25 @@
import { Link } from '@tanstack/react-router'

export function NotFound({ children }: { children?: any }) {
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

Replace any with proper type.

The children prop uses any, which violates the guideline to prefer explicit typing. Use React.ReactNode for children props.

Apply this diff:

+import type * as React from 'react'
 import { Link } from '@tanstack/react-router'

-export function NotFound({ children }: { children?: any }) {
+export function NotFound({ children }: { children?: React.ReactNode }) {

As per coding guidelines.

📝 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
export function NotFound({ children }: { children?: any }) {
import type * as React from 'react'
import { Link } from '@tanstack/react-router'
export function NotFound({ children }: { children?: React.ReactNode }) {
🤖 Prompt for AI Agents
In examples/tanstack-react-start/src/components/NotFound.tsx around line 3, the
NotFound component types its children as any; replace that with the proper React
type by importing React (if not already) and changing the children prop type to
React.ReactNode (or ReactNode) so children are explicitly and accurately typed,
updating the prop signature accordingly.

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

♻️ Duplicate comments (2)
examples/tanstack-react-start/src/components/NotFound.tsx (1)

3-3: Replace any with proper type.

The children prop uses any, which violates the guideline to prefer explicit typing. Use React.ReactNode for children props.

As per coding guidelines.

examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx (1)

39-48: Replace Link with button for prevented navigation.

The Link specifies to="/" but immediately prevents default navigation and calls window.history.back(), which is inconsistent and potentially confusing. Use a <button> element instead since this isn't actually navigating via the router.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f77f251 and d7da041.

📒 Files selected for processing (3)
  • examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx (1 hunks)
  • examples/tanstack-react-start/src/components/NotFound.tsx (1 hunks)
  • examples/tanstack-react-start/src/styles/app.css (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • examples/tanstack-react-start/src/styles/app.css
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

**/*.{ts,tsx}: Always use import type for type-only imports
Separate type imports from value imports
Avoid overzealous object destructuring; prefer direct property access
Object destructuring is acceptable when a variable is used 3+ times
Prefer array destructuring
Avoid sparse array destructuring
Never destructure in function parameter declarations
Avoid destructuring potentially nullish nested properties
Maximum 3 parameters per function; use options objects when more
Type parameter names must match /^(T|$)(A-Z)?[0-9]*$/
Prefix unused variables, parameters, and caught errors with _
Prefer namespace imports for validation libraries and large modules (e.g., import * as z from 'zod', import * as React from 'react')
Follow import order: test helpers, tRPC test imports, third-party, then relative
Never import from @trpc/*/src; import from the package root instead
Do not use Symbol.dispose or Symbol.asyncDispose; use makeResource()/makeAsyncResource()
Always use await using for resource cleanup
Prefer makeResource()/makeAsyncResource() over manual disposal logic
Avoid non-null assertions (!)
Use proper type guards and optional chaining instead of non-null assertions
Switch statements must be exhaustive for union types
Rely on TypeScript inference; avoid unnecessary explicit return/output types
Use explicit types at public API boundaries, for complex generic constraints, or when inference is insufficient/ambiguous
Use the satisfies operator to retain inference while enforcing shapes
Use as const for literal type inference when appropriate
Prefer explicit typing over any
Use type assertions sparingly
Leverage TypeScript strict mode features

Files:

  • examples/tanstack-react-start/src/components/NotFound.tsx
  • examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx
**/*.{ts,tsx,md,mdx}

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

Use camelCase for file names (with exceptions like TRPC/RPC/HTTP/JSON acronyms, .config.js, .d.ts, and tests)

Files:

  • examples/tanstack-react-start/src/components/NotFound.tsx
  • examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

**/*.tsx: Follow React Hooks rules (React Compiler compatible patterns)
Use the JSX runtime (no need to import React for JSX)
Prefer function components

Files:

  • examples/tanstack-react-start/src/components/NotFound.tsx
  • examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : Do NOT import legacy helpers like `createAppRouter` from `./__testHelpers`
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : Use `ctx.useTRPC()` for TanStack React Query hooks access in components under test
📚 Learning: 2025-09-05T15:16:31.379Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : Do NOT import legacy helpers like `createAppRouter` from `./__testHelpers`

Applied to files:

  • examples/tanstack-react-start/src/components/NotFound.tsx
  • examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.{ts,tsx} : Prefer explicit typing over `any`

Applied to files:

  • examples/tanstack-react-start/src/components/NotFound.tsx
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.{ts,tsx} : Use proper type guards and optional chaining instead of non-null assertions

Applied to files:

  • examples/tanstack-react-start/src/components/NotFound.tsx
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.{ts,tsx} : Avoid non-null assertions (`!`)

Applied to files:

  • examples/tanstack-react-start/src/components/NotFound.tsx
📚 Learning: 2025-09-05T16:48:06.982Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-09-05T16:48:06.982Z
Learning: Applies to **/*.tsx : Prefer function components

Applied to files:

  • examples/tanstack-react-start/src/components/NotFound.tsx
📚 Learning: 2025-09-05T15:16:31.379Z
Learnt from: CR
Repo: trpc/trpc PR: 0
File: .cursor/rules/tanstack-react-query-tests.mdc:0-0
Timestamp: 2025-09-05T15:16:31.379Z
Learning: Applies to packages/tanstack-react-query/**/*.test.tsx : Import React testing utilities with `import * as React from 'react';`

Applied to files:

  • examples/tanstack-react-start/src/components/NotFound.tsx
⏰ 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). (7)
  • GitHub Check: E2E-tests (next-prisma-websockets-starter)
  • GitHub Check: E2E-tests (nuxt)
  • GitHub Check: E2E-tests (next-minimal-starter)
  • GitHub Check: E2E-tests (minimal-react)
  • GitHub Check: E2E-tests (express-minimal)
  • GitHub Check: E2E-tests (.test/diagnostics-big-router)
  • GitHub Check: typecheck-www
🔇 Additional comments (1)
examples/tanstack-react-start/src/components/DefaultCatchBoundary.tsx (1)

1-8: LGTM: Import structure follows guidelines.

Type imports are properly separated using import type, and value imports are correctly grouped.

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.

3 participants