Skip to content

fix(client): transformer error typo, and check docs links in package sources - #7809

Merged
KATT merged 3 commits into
mainfrom
cursor/jsdoc-links-check-d5a5
Nov 2, 2026
Merged

KATT merged 3 commits into
mainfrom
cursor/jsdoc-links-check-d5a5

Conversation

@KATT

@KATT KATT commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Why

  • The missing-transformer type error said "on your your initTRPC-object".
  • Many trpc.io/docs links in packages/*/src used old paths (/docs/v11/..., http://, moved Next.js pages). Nothing caught them.

What

  • Fix the message to match the docs quote: You must define a transformer on your `initTRPC`-object first. A type test in packages/tests/server/transformer.test.ts asserts the exact text.
  • Point every existing docs link in package sources at its current v11 page (16 files).
  • Add www/build/package-links.test.ts. It runs in CI through pnpm --filter www test. It fails when a trpc.io/docs link in packages/*/src:
    • isn't the canonical https://trpc.io/docs/... form,
    • isn't a v11 docs page (slugs come from the site's own docPages()), or
    • has an #anchor that isn't a heading on that page (ids come from the site's own anchorsOf(), so {#id} overrides count).

This is the base of a stack. The JSDoc work is split into one PR per package, each based on this branch:

Links

None. No docs pages change.

Alternatives considered

  • A script in scripts/: it would have to copy the site's slug and heading-id rules. The www test reuses them, so it matches the built routes.

Testing

  • pnpm test -- --watch false, pnpm --filter www test, pnpm typecheck-packages, pnpm lint, pnpm format, pnpm build && pnpm verify-packed all pass.
  • I checked that the link test fails on a bad page and on a bad anchor.
Open in Web Open in Cursor 

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Documentation

    • Updated links across client, React, Next.js, TanStack Query, and server references to current documentation paths and secure HTTPS URLs.
    • Corrected a typo in a transformer-related error message.
  • Tests

    • Added checks for documentation link formats and heading references, and expanded transformer type coverage.

@KATT
KATT requested review from a team as code owners November 2, 2026 12:37
@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
examples-next-minimal-starter Ready Ready Preview Nov 2, 2026 5:11pm UTC
examples-todomvc Ready Ready Preview Nov 2, 2026 5:11pm UTC
next-prisma-starter Ready Ready Preview Nov 2, 2026 5:11pm UTC
next-prisma-websockets-starter Ready Ready Preview Nov 2, 2026 5:11pm UTC
tanstack-start-sse-chat Ready Ready Preview Nov 2, 2026 5:11pm UTC
trpc-next-app-dir Ready Ready Preview Nov 2, 2026 5:11pm UTC
www Ready Ready Preview Nov 2, 2026 5:11pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
trpc-v12 Ignored Ignored Preview Nov 2, 2026 5:11pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between b85d34e and b300129.

Files selected for processing: 1
  • packages/tanstack-react-query/src/internals/handles.ts
Files skipped from review as they are similar to previous changes: 1
  • packages/tanstack-react-query/src/internals/handles.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Walkthrough

Documentation links were updated across package sources. The transformer diagnostic message was corrected. Tests now check package documentation links and transformer typing.

Changes: Package documentation references

Layer / File(s) Summary
Update client and framework references
packages/client/src/..., packages/next/src/..., packages/react-query/src/..., packages/tanstack-react-query/src/...
Client and framework documentation links now use updated paths. The headers links use HTTPS. The transformer error message no longer repeats “your.”
Update server references
packages/server/src/unstable-core-do-not-import/...
Server documentation links now use current paths for transformers, procedures, middleware, routers, context, caching, and server-side calls.
Check documentation links and transformer typing
www/build/package-links.test.ts, packages/tests/server/transformer.test.ts
The package link test checks URL form, documentation pages, and heading fragments. The transformer test checks the missing-backend-transformer diagnostic type.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

  • trpc/trpc#7814: Adds client JSDoc documentation links and uses the package-link validation introduced here.
  • trpc/trpc#7815: Adds TanStack React Query JSDoc links and uses the package-link validation introduced here.
  • trpc/trpc#7813: Adds React Query JSDoc links and names this package-link test in its validation description.

Suggested reviewers: nick-lucas, juliusmarminge

Merge Risk: Moderate · up to b3001

The documentation-link test may fail in Windows or encoded checkout paths. Resolve or explicitly accept that workflow risk before merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately identifies the transformer error typo fix and documentation-link checks, which are the main changes in the pull request.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 20 files.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@pkg-pr-new

pkg-pr-new Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@trpc/client

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

@trpc/next

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

@trpc/openapi

npm i https://pkg.pr.new/@trpc/openapi@7809

@trpc/react-query

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

@trpc/server

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

@trpc/tanstack-react-query

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

@trpc/upgrade

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

commit: b300129

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread www/build/package-links.test.ts Resolved
trpc-bot
trpc-bot previously approved these changes Nov 2, 2026

@trpc-bot trpc-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

CI is green and CodeRabbit has no open findings at this head.

cursoragent and others added 3 commits November 2, 2026 17:02
…kage sources

- Fix 'on your your `initTRPC`-object' in the missing-transformer type error
- Point every trpc.io/docs link in packages/*/src at the current v11 page
- Add a www test that fails on a trpc.io/docs link in packages/*/src that
  isn't a v11 docs page or heading

Co-authored-by: alexander <[email protected]>
…s until the handles page ships

Co-authored-by: alexander <[email protected]>

@trpc-bot trpc-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Rebased onto main after #7822. CI is green and CodeRabbit has no open findings at this head.

@KATT
KATT added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 2, 2026
@KATT
KATT added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 19079d6 Nov 2, 2026
52 checks passed
@KATT
KATT deleted the cursor/jsdoc-links-check-d5a5 branch November 2, 2026 21:21
trpc-bot pushed a commit to trpc/examples-tanstack-start-sse-chat that referenced this pull request Nov 2, 2026
…t example on handles (#7817)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Why

- [#7777](trpc/trpc#7777) renamed
`unstable_localLink` to `localLink`,
[#7759](trpc/trpc#7759) added query handles, and
[#7822](trpc/trpc#7822) made handles carry no
data. All three are code only, and 11.23.0 ships them.
- This PR holds the docs, the live demos and the example changes that
use them, so trpc.io and the examples show the API once a release has
it.
- The JSDoc PRs ([#7809](trpc/trpc#7809) to
[#7815](trpc/trpc#7815)) pointed the handles
`@see` links at other pages until the handles page existed. This PR adds
the page, so it points them back.
- Native stack: `main` → this PR →
[#7773](trpc/trpc#7773) (the announcement post).

## What

### `localLink`

- The Local Link docs use `localLink`, and note that
`unstable_localLink` still works but is deprecated.
- The TanStack Start SSE example's client (`src/lib/trpc.ts`) and README
use `localLink`.

### Handles docs and top bar

- The docs gain a [Request
waterfalls](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#waterfalls)
section: start queries in loaders, start every query before awaiting
any, make the URL the input, reshape dependent queries in the route or a
procedure, and use the two explicit waterfalls only when you can't: in a
loader, or in a component's render for an input that's only known there.
- Both guides gain a "Start every query from the URL" section: a loader
only sees the URL, so path params and search params should carry every
query's input, not component state. If a page can't start a query from
the URL alone, revisit the procedure: take the slug the URL has, or
return the joined data. The handles guide shows a router and loader
before and after (`post.comments` taking the slug instead of the post's
id, `post.bySlug` returning its author), with timelines; the "before"
loader reads the post from the cache. The TanStack Start guide shows
`validateSearch` and `loaderDeps` feeding a sorted, paged list.
- The handles guide also gains recipes for changing part of a handle's
input in the component (behind a "prefer the URL" warning), testing
components that take handles, and reporting `unstable_$prefetch` errors
in one place with `QueryCache`'s `onError`.
- The docs are written for the new website from
[#7771](trpc/trpc#7771):
`www/v11/docs/client/tanstack-react-query/handles.md` and
`tanstack-start.md`, placed in the sidebar under TanStack React Query by
their frontmatter (`parent`, `order`), with `:::` admonitions.
- Every code sample on both pages is Twoslash, checked against real
framework types rather than stubs:
- The samples app (`www/samples/v11`) gains `react-router` 8.5.1,
`@tanstack/react-router`, `@tanstack/react-start` and
`@tanstack/react-router-ssr-query`.
- Shared setup lives in hidden `twoslash include` blocks (the router,
the tRPC client and server modules, the components), so each sample
shows only its own file.
- Route types are written the way the generators write them: React
Router's `+types` from `react-router/internal`, and TanStack Router's
`routeTree.gen.ts` with the router registered. Loader data is therefore
fully typed in every route sample, not `any`.
- Fixed on the way: the TanStack Start guide's routes read `const
loaderData = Route.useLoaderData()` instead of destructuring it, and the
render-time sample's title is `pages/post-page.tsx`, since it imports
`pages/post.tsx`.
- The website's top bar gets a "Using TanStack Start" link after "Using
Next.js" (which goes to the Next.js overview, as
[#7829](trpc/trpc#7829) set it), pointing at the
new TanStack Start guide (`docsLinks` in `www/src/site.ts`). It shows
from 1280px (`xl`) wide; below that, the extra label would push the
header past the window. Phones get the link in the menu; in between, the
guide is in the docs sidebar.
[#7801](trpc/trpc#7801) added a `wide` flag that
shows the Awesome tRPC Collection link from `lg`; both now use one
`from` field naming the breakpoint a link shows from.
- `pnpm-lock.yaml` adds the new dependencies of `www` and the samples
app.

### Handles `@see` links

- In `@trpc/tanstack-react-query`, the `@see` links of the handle
methods and types (`unstable_$prefetch` and the other verbs,
`unstable_$fromHandle`, `unstable_TRPCPrefetchInfiniteOptions`,
`unstable_inferQueryHandle`, `unstable_inferInfiniteQueryHandle`) and of
`unstable_createHydrateClient` point at the handles page again:
`handles`, `#fetch`, `#infinite-queries`, `#reading-a-handle`,
`#typing-props` and `#hydrate-client`.
- `www/build/package-links.test.ts` no longer skips the two
runtime-message URLs (`handles#in-render` and
`handles#where-handles-dont-work`), so it checks them like every other
link.

### Handles carry no data

Follows [#7822](trpc/trpc#7822):

- The handles page's "Handles with data" section, its size table and its
demo are gone. A new [Handles carry no
data](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#no-data)
section says to read handles with `useSuspenseQuery` for data that's
always defined, and that a `queryClient.clear()` doesn't bring back the
data the loader started with.
- [Using the data in a
loader](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#loader-data):
`await queryClient.ensureQueryData(trpc.unstable_$fromHandle(handle))`
reads the data from the cache with no request. The dependent-query
examples (the URL section's "before" loader and the loader waterfall)
and the TanStack Start guide's note on `head` use it.
- The "Which to use" table loses its "Handle carries data" row, and the
TanStack Query equivalent of `unstable_$fromHandle` no longer mentions
`initialData`.
- The usage page says handles carry no data.

### Review fixes

- The URL demo's `parseListUrl` falls back to the defaults for a URL
`new URL()` can't parse, such as `http://`.
- The React Router and App Router whole-file examples show their
imports.
- React Router gets a Data Mode example: the loader as a route object's
`loader`, read with `useLoaderData`.
- The TanStack Start guide installs `zod`, and step 3 adds the
`/api/trpc` server route the browser's link calls.
- `unstable_$fromHandle` gives `infiniteQueryOptions` for an infinite
handle; the handles and usage pages now say so.

### TanStack Start SSE example

- TanStack Start SSE example (`examples/tanstack-start-sse-chat`), on
[#7796](trpc/trpc#7796 UI, now uses handles.
The router and server code are unchanged:
- Loaders return `trpc.channel.list.unstable_$prefetch()` and
`trpc.post.infinite.unstable_$prefetchInfinite({ channelId }, {
getNextPageParam })` as loader data.
- Components read them with `trpc.unstable_$fromHandle(...)`: the
sidebar's channel list, the channel name in the chat header, and the
posts. The posts read passes `getNextPageParam` and the refetch flags.
- Props are typed with `unstable_inferQueryHandle` /
`unstable_inferInfiniteQueryHandle`.
- `Chat` and `useLivePosts` take only the posts handle and read
`channelId` from `posts.input`.
- The `channelListQuery` / `postListQuery` helpers are gone;
`sessionQuery` stays, since it isn't tRPC.
- The "Load more" button switches on the posts query's `fetchStatus`
instead of branching on `isFetchingNextPage`, styled like the rest of
the new UI: a spinner while fetching, and a wifi-off icon with "Waiting
for network..." while the query is paused offline. It stays disabled
during any fetch, not only a next-page fetch; the posts query has its
refetch triggers off, so in practice only "Load more" fetches.
- #7796's typing-indicator fix (`autoFocus` on the message box) is kept.

```tsx
export const Route = createFileRoute('/channels/$channelId')({
  loader: ({ context: { trpc }, params }) => ({
    channels: trpc.channel.list.unstable_$prefetch(),
    posts: trpc.post.infinite.unstable_$prefetchInfinite(
      { channelId: params.channelId },
      { getNextPageParam: (d) => d.nextCursor },
    ),
  }),
  component: ChannelPage,
});

function ChannelList(props: { channels: unstable_inferQueryHandle<TRPC['channel']['list']> }) {
  const trpc = useTRPC();
  const channelsQuery = useSuspenseQuery(trpc.unstable_$fromHandle(props.channels));
  return channelsQuery.data.map((channel) => /* ... */);
}
```

### Live demos in the docs

The handles page and the TanStack Start guide get interactive demos,
built the way [KATT/raf-query](https://github.com/KATT/raf-query)'s docs
build theirs. They run the real handles API against a tRPC router in the
page (`initTRPC.create({ allowOutsideOfServer: true })` behind
`localLink`), with a pretend network you can slow down and a network
panel that draws each request and the moment the page shows.

- **Start queries in a loader** (`starting-queries`): a small blog in an
in-page browser (TanStack Router on memory history). Switch the loaders
between `$prefetch`, `$ensure` and `$fetch`, open a post, go back and
open it again, and watch which ones wait, and what happens to stale
data. On the handles page and, with `$prefetch` and `$ensure` only, in
the TanStack Start guide.
- **Where the queries start** (`waterfalls`): one page with its queries
started in the loader, at the top of the page, or in each component. The
last one shows the two-round-trip waterfall.
- **The URL is the input** (`url-input`) and **the loader diagram**
(`loader-handles`), first built for the blog post, now also in the docs.

How they're embedded:

- A `demo` code fence names the demo: ` ```demo starting-queries
variants=prefetch,ensure `. The build rejects unknown names and
malformed options (`build/markdown.ts`), and the fence's body is the
static stand-in: it shows until the demo loads, if the demo fails, and
in the agent markdown (`/docs/<slug>.md`).
- The demos live in `www/src/demos/`, shared by the docs and the blog.
`PageDemos` mounts them in the browser only, each as its slot nears the
screen, inside an error boundary. Pages without demos load none of their
code; a demo's own chunk is 3–6 KB plus the shared kit.
- Light and dark from the site's theme, `@shared/ui` and Tailwind only,
usable at 390px, and under `prefers-reduced-motion` the bars and pending
states don't animate.
- `www` now depends on `@trpc/client`, `@trpc/server`,
`@trpc/tanstack-react-query` and `@tanstack/react-query` at runtime.
- The docs' note on `unstable_$fetch` now says that TanStack Router, by
default, shows a visited page from its last loader data and reruns the
loader in the background, so `$ensure` and `$fetch` only differ there
with `staleReloadMode: 'blocking'` (which the demo sets).
- The prose around the demos, and the paragraphs this PR touches in both
guides, got a plain-English pass.

| Start queries in a loader | Where the queries start (dark) |
| --- | --- |
| ![Start queries demo: a post rendered with $prefetch, network panel
showing one round
trip](https://cursor.com/artifacts/c/art-3eb34a28-b238-400a-b27a-1f59faa780b7)
| ![Waterfalls demo, each component variant: two round trips, dark
mode](https://cursor.com/artifacts/c/art-34613930-e796-4529-bf95-3478004e2bcc)
|
| ![Start queries demo at 390px with
$ensure](https://cursor.com/artifacts/c/art-da1b0455-4cfc-471a-a869-88e50087db35)
| ![TanStack Start guide: the loader and handles
diagram](https://cursor.com/artifacts/c/art-dacd1891-cd2e-4698-9dd4-818f9b2aecfa)
|
| ![Start queries demo under reduced motion,
mid-load](https://cursor.com/artifacts/c/art-3821ce1a-10a1-4b04-a46e-eaf16982afc3)
| |

<a
href="https://cursor.com/agents/bc-0240dc70-9b6f-556c-b489-959eff930ee9/artifacts?path=%2Fopt%2Fcursor%2Fartifacts%2Fdocs-demos-walkthrough.mp4"><img
src="https://cursor.com/artifacts/c/art-0c7d1949-7ae7-4670-a5da-95d0e6d1d277"
alt="docs-demos-walkthrough.mp4" /></a>

The walkthrough was recorded before the handle-data demo was removed.

### Framework tabs as links, kept in the URL

- Built for the blog post's "In your framework" tabs in
[#7773](trpc/trpc#7773). No docs page has a
`framework` tab group yet, so nothing on the docs pages changes until
the post lands.
- `www/src/tabs.ts` lists the tab groups kept in the URL: only
`framework` for now. Their tabs render as links to `?framework=<tab>`
(`nextjs`, `tanstack-start`, `react-router`) instead of buttons
(`rehypeCodeTabs` in `build/markdown.ts`).
- A click switches the tabs and rewrites the URL in place, through the
router (`replace`, no scroll reset, the hash kept), so the page doesn't
move and the back button doesn't step through tabs. The clicked tab
stays where it is on screen, even when groups above it change height. A
click with a modifier key, or a middle click, opens the link in a new
tab like any other link. On hover and focus, a tab's href is rebuilt
from the current URL with only `framework` changed, so the new tab keeps
`?flags=` and the hash.
- Space on a focused tab selects it, as on a button, instead of
scrolling the page. Enter follows the link natively.
- On load, `?framework=` wins over the stored choice, so a shared link
opens on its tab. A URL's choice isn't stored: visiting someone's link
doesn't change your default. The click still stores it, as before.
- The root route's `validateSearch` keeps `?framework=` next to
`?flags=`, so the router doesn't drop it. Links to other pages don't
carry it.
- Other tab groups (package managers and the older docs' groups) stay
buttons with `localStorage` only.
- The pages stay prerendered once: `?framework=` gets the same HTML, and
the browser applies the tab after hydration.

## Links

- Docs:
- [Local
Link](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/links/localLink):
uses `localLink`, and notes that `unstable_localLink` still works but is
deprecated.
- New page: [Prefetching with
handles](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles):
[waiting versus not
waiting](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#starting-a-query)
(when you need `Suspense`, [waiting for fresh data with
`unstable_$fetch`](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#fetch),
a comparison table, [TanStack Query
equivalents](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#tanstack-equivalents),
combining both),
[reading](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#reading-a-handle)
(including `handle.input`), typing props, [handles carry no
data](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#no-data)
(with [using the data in a
loader](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#loader-data)),
infinite queries, [changing the input when you
read](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#changing-the-input),
[request
waterfalls](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#waterfalls)
(dependent queries, in a loader or a component), Next.js App Router with
separate streaming and waiting examples,
[errors](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#errors),
invalidation, guarantees,
[testing](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#testing),
where handles don't work, and an [FAQ on the
`$`](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#why-the-dollar).
- New page: [Set up with TanStack
Start](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start):
setup with an isomorphic client and [the `/api/trpc` server
route](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start#3-create-an-isomorphic-trpc-client),
[loaders that don't
wait](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start#loader-prefetch)
and [loaders that
wait](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start#loader-ensure),
and [handles in
`beforeLoad`](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start#before-load).
- Handles page, [Without a loader: in
render](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#in-render):
the top-of-page pattern, its rules, and server rendering. [Where to
start
queries](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#where-to-start)
is a table per kind of app, and [dependent queries in a
component](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#waterfall-in-a-component)
start the query in render.
- Handles page, [React
Router](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#react-router):
client-only apps with `clientLoader` or a Data Mode `loader` (each with
its own example), and server rendering with a per-request query client
and proxy from root middleware, `dehydrate` in the loader and
`HydrationBoundary` in the route. It also explains keying `Suspense`
boundaries by the route's input, without which a navigation between two
posts waits for the slow query.
- Handles page, App Router:
[`HydrateClient`](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#hydrate-client).
The Server Components guide's `HydrateClient` tip links to it.
- [React Server Components, Using your
API](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/server-components#using-your-api):
tip linking to handles.
- [Next.js App Router setup, Make API
requests](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/nextjs/app-router-setup#7-make-api-requests):
tip linking to handles.
- [TanStack React Query
usage](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/usage#handles):
short `unstable_$prefetch` / `unstable_$ensure` / `unstable_$fetch` /
`unstable_$fromHandle` entry, with the `$` explained.
- [Start every query from the
URL](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#url-as-input)
on the handles page, with [If the URL isn't enough, reshape the
procedure](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#reshape-procedures),
and [the same
section](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start#url-as-input)
in the TanStack Start guide.
- Live demos: [Start queries in a
loader](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#which-to-use)
(below the table), [The URL is the
input](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#url-as-input),
[Where the queries
start](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#waterfalls),
and in the TanStack Start guide
[loaders](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start#loader-prefetch)
and [the
URL](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start#url-as-input).
- Top bar: "Using TanStack Start", after "Using Next.js", on every page
1280px wide or more, for example [the docs
home](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs).
It opens the [TanStack Start
guide](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start).
- SSE chat example:
-
[`/`](https://tanstack-start-sse-chat-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/):
the channel list is server-rendered from an `unstable_$prefetch()`
handle in loader data.
-
[`/channels/<id>`](https://tanstack-start-sse-chat-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/channels/9794ea9f-1412-4d0a-8476-ba137209bc1e):
channels and posts are read from handles; "Load more" paginates the
infinite handle.

## Alternatives considered

- Docs in the same PRs as the code
([#7777](trpc/trpc#7777) and
[#7759](trpc/trpc#7759), before this split):
trpc.io deploys from `main`, so the docs would go live before a release
had the API.
- The tab links in the blog post's PR: they're website code, not the
post, so they sit with the rest of `www`.
- Demo embedding: `<div data-demo>` slots in the markdown (the blog
post's first version) can't be checked at build time and leak into the
agent markdown; the `demo` fence matches the site's `chart` fence and
raf-query. raf-query also prefetches a page's demo chunks in its route
loader; here they load as their slot nears the screen, so a long page
with demos far down doesn't fetch them up front.
- Demo data: recorded timelines instead of the real library. Cheaper,
but they'd drift from what handles do; the live demos run the actual `$`
methods, so they also exercise them.
- A new history entry per tab click (`push`): the back button would step
through tab choices before leaving the page. The site's experiments menu
rewrites its URL in place the same way.
- Keeping every tab group in the URL:
`?tabs-vanilla-zod-yup-valibot=zod` on old docs pages, and a package
manager in every shared docs link, overriding the recipient's own
choice. Adding a group is one line in `src/tabs.ts`.

## Testing

- Rebased onto `main` after #7822, #7829 and the JSDoc PRs. Before
#7822, the docs, demos and example were the same files as before the
split.
- `www/build/package-links.test.ts` passes with the handles links
restored: every handles `@see` link and both runtime-message URLs
resolve to a heading on the handles page.
- Before writing the docs change, confirmed the bug on the old code:
after `queryClient.clear()`, a mounted `useQuery` reader of an
`unstable_$ensure` handle put the handle's old data back in the cache
and made no request. #7822 has the tests.
- `pnpm typecheck-www`, `pnpm --filter www lint`, `pnpm --filter www
test` (274 tests, including the `demo` fence's slot, stand-in and
unknown-name error, `src/tabs.test.ts`, and a `build/markdown.test.ts`
case for framework tabs rendering as links), `pnpm --filter www build`
(all 698 trpc.io URLs resolve) and `pnpm validate-skills` pass, as do
`pnpm typecheck-packages`, `pnpm lint` and the full unit test suite
(1461 tests).
- `pnpm --filter www check-twoslash` passes on the whole site: 460
blocks, including every sample on the handles page and the TanStack
Start guide. To confirm route samples aren't silently `any`, a temporary
`const probe: number = loaderData` in each of the five route components
failed with the real loader data type.
- No hidden setup reaches the rendered pages: checked the HTML of both
pages for `declare module`, `GetAnnotations`, `@filename` and the hidden
`routeTree.gen.ts` (the only `routeTree.gen` left is the visible import
in `router.tsx`), and hovered `loaderData` in the Start guide on a local
build, which shows the handle types.

![TanStack Start guide: hovering loaderData in the /posts route shows
the handle type, with sort and page from
validateSearch](https://cursor.com/artifacts/c/art-d511cfc8-73af-4b08-b683-432c75b2ba62)
- Live demos, on a local production build with headless Chrome
(Playwright), at 1280px light and dark, 390px light and dark, and 1280px
with reduced motion: drove every demo (navigations, variant and latency
switches), with no console errors and no demo wider than the page. Found
and fixed on the way: the demo router scrolled the real page to the top
on each navigation (now `scrollRestoration: () => false`), and a variant
switch overflowed at 390px.
- The top-bar link, on a local production build with headless Chrome
after rebasing onto #7801: measured `/docs` at 768, 820, 900, 1024,
1100, 1279, 1280 and 1440px. The link is hidden below 1280px, so each of
those widths matches `main`: no overflow, except 74px at 1024px, which
`main` already has with the Awesome link shown from `lg`. From 1280px
both links show and the header fits.
- TanStack Start SSE example:
- `typecheck`, `lint` and the production `build` pass on this PR. The
example has no test suite of its own, and its CI E2E entry is disabled
on `main`.
- CI's standalone build of the example ("Check standalone
tanstack-start-sse-chat package") installs `@trpc/*@canary`. Until a
canary with `localLink` is a day old (pnpm's `minimumReleaseAge`), it
gets an older canary without `localLink` and fails. That's around 18:27
UTC+1 on Nov 3. It isn't a required check.
- Scratch routes (not committed) returning `unstable_$ensure` handles
from `beforeLoad` and `loader` type-checked against TanStack Router's
serializability check. That was before #7822, which only removed fields
from handles.
- Ran the production build on #7796's UI against a local Postgres with
25 seeded posts and drove it with Playwright:
- Loading `/` directly renders the channel list on the server and makes
no tRPC query requests on hydration.
- Navigating to a channel on the client fetches `post.infinite` once
through the loader, then opens the two subscriptions.
- "Load more" fetches the next page with the cursor (20, then 25
messages), then is disabled.
- Offline, "Load more" shows "Waiting for network..." and stays
disabled; the next page loads once the browser is back online.
- Loading a channel directly renders 20 posts on the server; hydration
only opens the subscriptions.
- After signing in with the mocked provider, the message box is focused
on load, and typing shows "is typing..." in a second browser. A posted
message arrives there through the subscription.
- After loading both pages, going home and coming back once the posts
are stale (30 s), the loader refetches page 1 and then page 2 with its
cursor, with no console errors.
  - The server logged no handle warnings.

![SSE chat example, offline: Load more shows a wifi-off icon and Waiting
for
network...](https://cursor.com/artifacts/c/art-b3032f71-3d46-46e9-8471-42bfac213396)
- The tab links were checked in a browser on the blog post in
[#7773](trpc/trpc#7773), the first page with a
`framework` tab group. Its description lists those checks.
<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-0240dc70-9b6f-556c-b489-959eff930ee9?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-0240dc70-9b6f-556c-b489-959eff930ee9&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

<!-- codesmith:footer -->
---
<a
href="https://app.blacksmith.sh/trpc/codesmith/trpc/pr/7817?autoLogin=true&ref=codesmith_pr_footer"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v3.svg"><img
alt="View with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png"
width="162" height="28"></picture></a> <a
href="https://backend.blacksmith.sh/track/enable-autofix?expires=1796218334&installation_model_id=443568&pr_number=7817&ref=codesmith_pr_footer&repository=trpc%2Ftrpc&return_to=https%3A%2F%2Fgithub.com%2Ftrpc%2Ftrpc%2Fpull%2F7817&signature=9d4d55d5465a9090f113c89919373e56eeed9937798de711561dcf9da85b4fee"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img
alt="Autofix with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png"
width="190" height="28"></picture></a>
<sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you
need.</sup>

<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Added interactive documentation demos covering query loading
strategies, request timing, URL-driven state, and blog data.
* Framework tabs can now be selected through the URL, with selections
preserved when sharing or reloading a page.
* Added a TanStack Start navigation link and improved responsive
visibility of header links.
* Updated the chat example to load data through route-provided query
handles and show loading or offline status.
* **Documentation**
* Added guides for query handles and TanStack Start, including
prefetching and server rendering, and updated examples to use the
current `localLink` name.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cursor Agent <[email protected]>
meefs pushed a commit to meefs/trpc that referenced this pull request Nov 2, 2026
…#7810)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Why

Many public `@trpc/server` APIs had no summary, or no link to their docs
page.

## What

- Short summaries for the exports of `@trpc/server` and its subpaths:
adapters, `http`, `observable`, `rpc`, `shared`, and the `ws` adapter.
`@param`, `@example` and `@see https://trpc.io/docs/...` are added where
they help.
- `@deprecated` names the replacement: `inferAsyncReturnType`,
`experimental_standaloneMiddleware` (use `.concat()`), `sse`.
- No runtime or type changes. `@internal`/`@public` are kept as they
were.
- `@trpc/openapi` copies tRPC's JSDoc into generated specs, so the
OpenAPI test fixtures in `packages/openapi/test/routers/` are
regenerated with the new text.

This is stacked on trpc#7809, which adds the link check. It's one of
one-PR-per-package.

APIs with no docs page (not invented):

- `@trpc/server/adapters/node-http`: `nodeHTTPRequestHandler`,
`incomingMessageToRequest`, `createURL`
- `@trpc/server/adapters/next-app-dir`: `experimental_notFound`,
`experimental_redirect`, `rethrowNextErrors`
- `@trpc/server/observable`: `map`, `share`, `tap`,
`distinctUntilChanged`, `distinctUntilDeepChanged`, `behaviorSubject`,
`isObservable`

## Links

None. No docs pages change.

## Alternatives considered

None.

## Testing

- `www/build/package-links.test.ts` checks every new link against the
v11 pages and headings.
- `pnpm test -- --watch false`, `pnpm typecheck-packages`, `pnpm lint`,
`pnpm format`, `pnpm build && pnpm verify-packed` pass.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-582c9e70-feeb-562d-989d-e010a7eed5a5?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-582c9e70-feeb-562d-989d-e010a7eed5a5&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

<!-- codesmith:footer -->
---
<a
href="https://app.blacksmith.sh/trpc/codesmith/trpc/pr/7810?autoLogin=true&ref=codesmith_pr_footer"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v3.svg"><img
alt="View with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png"
width="162" height="28"></picture></a> <a
href="https://backend.blacksmith.sh/track/enable-autofix?expires=1796215038&installation_model_id=443568&pr_number=7810&ref=codesmith_pr_footer&repository=trpc%2Ftrpc&return_to=https%3A%2F%2Fgithub.com%2Ftrpc%2Ftrpc%2Fpull%2F7810&signature=d968a2a987fe51ab34080b19a339a294207124f98843fce4c2e00ca47fcf16b4"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img
alt="Autofix with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png"
width="190" height="28"></picture></a>
<sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you
need.</sup>

<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Documentation**
* Clarified guidance for server adapters, procedures, middleware,
errors, observables, streaming, and other tRPC features.
* Improved descriptions of JSON-RPC error codes, procedure paths,
request handling, context options, and when stack traces are included in
generated API schemas.
* Added usage examples and links to relevant documentation, including
guidance for streaming and adapter configuration.
* **Tests**
* Updated expected documentation output to reflect revised descriptions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cursor Agent <[email protected]>
meefs pushed a commit to meefs/trpc that referenced this pull request Nov 2, 2026
…inks (trpc#7811)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Why

Some `@trpc/openapi` exports had no summary or docs link. The
`@trpc/upgrade` codemods had no docs at all.

## What

- `@trpc/openapi`:
- `generateOpenAPIDocument` gets an example and links to
`/docs/openapi#programmatic`.
  - `GenerateOptions` and the `OpenAPIV3_1` namespace get summaries.
- The `/heyapi` types and `configureTRPCHeyApiClient` /
`createTRPCHeyApiTypeResolvers` get summaries and links to their
headings.
- `@trpc/upgrade`: the `hooksToOptions` and `provider` transforms get
summaries and link to
`/docs/client/tanstack-react-query/migrating#codemod-migration`.
- No runtime or type changes.

This is stacked on trpc#7809, which adds the link check. It's one of
one-PR-per-package. `@trpc/upgrade` is two small comments, so it shares
this PR.

## Links

None. No docs pages change.

## Alternatives considered

None.

## Testing

- `www/build/package-links.test.ts` checks every new link against the
v11 pages and headings.
- `pnpm test -- --watch false`, `pnpm typecheck-packages`, `pnpm lint`,
`pnpm format`, `pnpm build && pnpm verify-packed` pass.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-582c9e70-feeb-562d-989d-e010a7eed5a5?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-582c9e70-feeb-562d-989d-e010a7eed5a5&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

<!-- codesmith:footer -->
---
<a
href="https://app.blacksmith.sh/trpc/codesmith/trpc/pr/7811?autoLogin=true&ref=codesmith_pr_footer"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v3.svg"><img
alt="View with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png"
width="162" height="28"></picture></a> <a
href="https://backend.blacksmith.sh/track/enable-autofix?expires=1796215066&installation_model_id=443568&pr_number=7811&ref=codesmith_pr_footer&repository=trpc%2Ftrpc&return_to=https%3A%2F%2Fgithub.com%2Ftrpc%2Ftrpc%2Fpull%2F7811&signature=fe67e63bd0538d01ec0f505b06896f30833ada20661072120a282d19f8aa47d9"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img
alt="Autofix with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png"
width="190" height="28"></picture></a>
<sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you
need.</sup>

<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Documentation**
* Expanded guidance for generating OpenAPI documents, including a usage
example and links to related documentation.
* Added documentation for OpenAPI types, client configuration options,
and migration transforms.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cursor Agent <[email protected]>
meefs pushed a commit to meefs/trpc that referenced this pull request Nov 2, 2026
…c/tanstack-react-query (trpc#7812)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Why

`@trpc/next` is deprecated in favor of `@trpc/tanstack-react-query`. Its
JSDoc didn't say so, and most exports had no summary.

## What

- Mark every public export `@deprecated`: `createTRPCNext`, `withTRPC`
and its option types, `ssrPrepass`, and the `app-dir/*` exports. Each
tag reads:
  ```ts
  /**
   * @deprecated Deprecated in favor of `@trpc/tanstack-react-query`.
   * @see https://trpc.io/docs/client/nextjs/app-router-setup
   */
  ```
  That page sets up Next.js with `@trpc/tanstack-react-query`.
- Short summaries, plus `@see` links to the Pages Router setup and SSR
pages where they exist.
- No runtime changes and no warnings. No bug-fix-only or next-major
claim.

This is stacked on trpc#7809, which adds the link check. It's one of
one-PR-per-package.

APIs with no docs page (not invented):
`experimental_createTRPCNextAppDirClient`,
`experimental_createTRPCNextAppDirServer`,
`experimental_createActionHook`, `experimental_serverActionLink`,
`experimental_createServerActionHandler`,
`experimental_revalidateEndpoint`, `experimental_nextCacheLink`,
`experimental_nextHttpLink`.

## Links

None. No docs pages change.

## Alternatives considered

None.

## Testing

- `www/build/package-links.test.ts` checks every new link against the
v11 pages and headings.
- `pnpm test -- --watch false`, `pnpm typecheck-packages`, `pnpm lint`,
`pnpm format`, `pnpm build && pnpm verify-packed` pass.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-582c9e70-feeb-562d-989d-e010a7eed5a5?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-582c9e70-feeb-562d-989d-e010a7eed5a5&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

<!-- codesmith:footer -->
---
<a
href="https://app.blacksmith.sh/trpc/codesmith/trpc/pr/7812?autoLogin=true&ref=codesmith_pr_footer"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v3.svg"><img
alt="View with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png"
width="162" height="28"></picture></a> <a
href="https://backend.blacksmith.sh/track/enable-autofix?expires=1796215069&installation_model_id=443568&pr_number=7812&ref=codesmith_pr_footer&repository=trpc%2Ftrpc&return_to=https%3A%2F%2Fgithub.com%2Ftrpc%2Ftrpc%2Fpull%2F7812&signature=6cc32a3334e3c88d0b38ecd71645d8951540b8658a66b543118c5bdce558f49a"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img
alt="Autofix with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png"
width="190" height="28"></picture></a>
<sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you
need.</sup>

<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Documentation**
* Expanded Next.js integration guidance with setup examples and details
on client and server usage, query behavior, caching, per-call overrides,
and configuration options.
* Marked existing Next.js integration APIs as deprecated, pointing to
`@trpc/tanstack-react-query` and relevant setup documentation.
* Clarified server-side query fetching, including that dependent queries
may require multiple renders.
  * No runtime behavior or public signatures changed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cursor Agent <[email protected]>
meefs pushed a commit to meefs/trpc that referenced this pull request Nov 2, 2026
…of @trpc/tanstack-react-query (trpc#7813)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Why

`@trpc/react-query` only gets bug fixes and will be removed in the next
major version. Its JSDoc didn't say so, and many exports had no summary.

## What

- Mark the main exports `@deprecated`:
  - `createTRPCReact`, `CreateTRPCReact`
  - `createTRPCQueryUtils`
  - `getQueryKey`, `getMutationKey`
  - `inferReactQueryProcedureOptions`
  - `createServerSideHelpers` (`/server`)
  - `createHydrationHelpers` (`/rsc`)
- Each tag reads:
  ```ts
  /**
* @deprecated `@trpc/react-query` only gets bug fixes and will be
removed in
   * the next major version. Use `@trpc/tanstack-react-query` instead.
   * @see https://trpc.io/docs/client/tanstack-react-query/migrating
   */
  ```
- Short summaries and `@see` links for the other `/shared` exports.
These are mostly types that `@trpc/next` also uses, so they aren't
marked deprecated.
- No runtime changes, no console warnings, no removal date.

This is stacked on trpc#7809, which adds the link check. It's one of
one-PR-per-package.

## Links

None. No docs pages change.

## Alternatives considered

- Deprecating every `/shared` type too. That would strike through types
inside `@trpc/next`, and users reach them through the deprecated entry
points anyway.

## Testing

- `www/build/package-links.test.ts` checks every new link against the
v11 pages and headings.
- `pnpm test -- --watch false`, `pnpm typecheck-packages`, `pnpm lint`,
`pnpm format`, `pnpm build && pnpm verify-packed` pass.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-582c9e70-feeb-562d-989d-e010a7eed5a5?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-582c9e70-feeb-562d-989d-e010a7eed5a5&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

<!-- codesmith:footer -->
---
<a
href="https://app.blacksmith.sh/trpc/codesmith/trpc/pr/7813?autoLogin=true&ref=codesmith_pr_footer"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v3.svg"><img
alt="View with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png"
width="162" height="28"></picture></a> <a
href="https://backend.blacksmith.sh/track/enable-autofix?expires=1796215070&installation_model_id=443568&pr_number=7813&ref=codesmith_pr_footer&repository=trpc%2Ftrpc&return_to=https%3A%2F%2Fgithub.com%2Ftrpc%2Ftrpc%2Fpull%2F7813&signature=32ffa5ecaef8dbb5cf89cf007f436b765bc1adb3c70cea86a30c4ce70333d4aa"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img
alt="Autofix with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png"
width="190" height="28"></picture></a>
<sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you
need.</sup>

<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Documentation**
* Expanded API documentation for React Query utilities, hooks, options,
context, and server-side helpers, clarifying their behavior and type
semantics.
* Added deprecation notices and migration guidance pointing to the
TanStack React Query integration for relevant APIs.
* Added links to migration, setup, server components, and type-inference
documentation.
* Clarified how server-side helpers support router- and client-based
calls, and how utility names map to query types.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cursor Agent <[email protected]>
meefs pushed a commit to meefs/trpc that referenced this pull request Nov 2, 2026
…#7814)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Why

Many public `@trpc/client` APIs had no summary, or no link to their docs
page.

## What

- Short summaries for `createTRPCClient`, `TRPCClient`,
`TRPCClientError`, `safe`, the link types and every built-in link and
its options, with `@see https://trpc.io/docs/...` to the exact page and
heading.
- `@deprecated` names the replacement: `inferRouterClient` and
`CreateTRPCClient` (use `TRPCClient`), `unstable_httpBatchStreamLink`,
`unstable_httpSubscriptionLink`, `experimental_localLink`.
- No runtime or type changes.

This is stacked on trpc#7809, which adds the link check. It's one of
one-PR-per-package.

APIs with no docs page (not invented): `createTRPCUntypedClient`,
`TRPCUntypedClient`, `getUntypedClient`, `getFetch`.

## Links

None. No docs pages change.

## Alternatives considered

None.

## Testing

- `www/build/package-links.test.ts` checks every new link against the
v11 pages and headings.
- `pnpm test -- --watch false`, `pnpm typecheck-packages`, `pnpm lint`,
`pnpm format`, `pnpm build && pnpm verify-packed` pass.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-582c9e70-feeb-562d-989d-e010a7eed5a5?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-582c9e70-feeb-562d-989d-e010a7eed5a5&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

<!-- codesmith:footer -->
---
<a
href="https://app.blacksmith.sh/trpc/codesmith/trpc/pr/7814?autoLogin=true&ref=codesmith_pr_footer"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v3.svg"><img
alt="View with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png"
width="162" height="28"></picture></a> <a
href="https://backend.blacksmith.sh/track/enable-autofix?expires=1796215073&installation_model_id=443568&pr_number=7814&ref=codesmith_pr_footer&repository=trpc%2Ftrpc&return_to=https%3A%2F%2Fgithub.com%2Ftrpc%2Ftrpc%2Fpull%2F7814&signature=042ee46268512bb0c747e297844bbdcbcdaf66e90ce0eb01768e578584d2ee4e"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img
alt="Autofix with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png"
width="190" height="28"></picture></a>
<sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you
need.</sup>

<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Documentation**
* Expanded client and link documentation, clarifying request options,
batching, subscriptions, WebSocket configuration, retries, logging, and
error handling.
* Added guidance on call context and abort behavior, binary and
form-data inputs, local and untyped clients, and handling safe results.
* Clarified how links route calls and whether they send requests
individually or in batches.
  * No runtime behavior or public API signatures changed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cursor Agent <[email protected]>
meefs pushed a commit to meefs/trpc that referenced this pull request Nov 2, 2026
…cs links (trpc#7815)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Why

Many public `@trpc/tanstack-react-query` exports had no summary, or no
link to their docs page.

## What

- Short summaries for `createTRPCContext`, `createTRPCOptionsProxy` and
its options, `TRPCOptionsProxy`, the `Decorate*` helper types,
`inferInput`/`inferOutput`, the query and mutation key types,
`useSubscription` and its result types.
- Small examples for `createTRPCContext`, `createTRPCOptionsProxy` and
`useSubscription`.
- `@see` links to the exact heading on the usage and setup pages.
- No runtime or type changes.

This is stacked on trpc#7809, which adds the link check. It's one of
one-PR-per-package.

## Links

None. No docs pages change.

## Alternatives considered

None.

## Testing

- `www/build/package-links.test.ts` checks every new link against the
v11 pages and headings.
- `pnpm test -- --watch false`, `pnpm typecheck-packages`, `pnpm lint`,
`pnpm format`, `pnpm build && pnpm verify-packed` pass.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-582c9e70-feeb-562d-989d-e010a7eed5a5?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-582c9e70-feeb-562d-989d-e010a7eed5a5&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

<!-- codesmith:footer -->
---
<a
href="https://app.blacksmith.sh/trpc/codesmith/trpc/pr/7815?autoLogin=true&ref=codesmith_pr_footer"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v3.svg"><img
alt="View with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png"
width="162" height="28"></picture></a> <a
href="https://backend.blacksmith.sh/track/enable-autofix?expires=1796215074&installation_model_id=443568&pr_number=7815&ref=codesmith_pr_footer&repository=trpc%2Ftrpc&return_to=https%3A%2F%2Fgithub.com%2Ftrpc%2Ftrpc%2Fpull%2F7815&signature=a3fe7028b523f628441d9f68814ee4c5d1177fe92606dd2ac341cb5c2de7435b"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img
alt="Autofix with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png"
width="190" height="28"></picture></a>
<sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you
need.</sup>

<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Documentation**
* Expanded guidance for React Query integration, including context
setup, query and mutation options, infinite queries, subscriptions, and
request options.
* Added examples and usage guidance for configuring queries with either
a tRPC client or router context, including server-side use without React
context.
* Clarified subscription lifecycle results, query and mutation keys,
cursor inputs, feature flags, and prefetch handles.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cursor Agent <[email protected]>
meefs pushed a commit to meefs/trpc that referenced this pull request Nov 2, 2026
…t example on handles (trpc#7817)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Why

- [trpc#7777](trpc#7777) renamed
`unstable_localLink` to `localLink`,
[trpc#7759](trpc#7759) added query handles, and
[trpc#7822](trpc#7822) made handles carry no
data. All three are code only, and 11.23.0 ships them.
- This PR holds the docs, the live demos and the example changes that
use them, so trpc.io and the examples show the API once a release has
it.
- The JSDoc PRs ([trpc#7809](trpc#7809) to
[trpc#7815](trpc#7815)) pointed the handles
`@see` links at other pages until the handles page existed. This PR adds
the page, so it points them back.
- Native stack: `main` → this PR →
[trpc#7773](trpc#7773) (the announcement post).

## What

### `localLink`

- The Local Link docs use `localLink`, and note that
`unstable_localLink` still works but is deprecated.
- The TanStack Start SSE example's client (`src/lib/trpc.ts`) and README
use `localLink`.

### Handles docs and top bar

- The docs gain a [Request
waterfalls](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#waterfalls)
section: start queries in loaders, start every query before awaiting
any, make the URL the input, reshape dependent queries in the route or a
procedure, and use the two explicit waterfalls only when you can't: in a
loader, or in a component's render for an input that's only known there.
- Both guides gain a "Start every query from the URL" section: a loader
only sees the URL, so path params and search params should carry every
query's input, not component state. If a page can't start a query from
the URL alone, revisit the procedure: take the slug the URL has, or
return the joined data. The handles guide shows a router and loader
before and after (`post.comments` taking the slug instead of the post's
id, `post.bySlug` returning its author), with timelines; the "before"
loader reads the post from the cache. The TanStack Start guide shows
`validateSearch` and `loaderDeps` feeding a sorted, paged list.
- The handles guide also gains recipes for changing part of a handle's
input in the component (behind a "prefer the URL" warning), testing
components that take handles, and reporting `unstable_$prefetch` errors
in one place with `QueryCache`'s `onError`.
- The docs are written for the new website from
[trpc#7771](trpc#7771):
`www/v11/docs/client/tanstack-react-query/handles.md` and
`tanstack-start.md`, placed in the sidebar under TanStack React Query by
their frontmatter (`parent`, `order`), with `:::` admonitions.
- Every code sample on both pages is Twoslash, checked against real
framework types rather than stubs:
- The samples app (`www/samples/v11`) gains `react-router` 8.5.1,
`@tanstack/react-router`, `@tanstack/react-start` and
`@tanstack/react-router-ssr-query`.
- Shared setup lives in hidden `twoslash include` blocks (the router,
the tRPC client and server modules, the components), so each sample
shows only its own file.
- Route types are written the way the generators write them: React
Router's `+types` from `react-router/internal`, and TanStack Router's
`routeTree.gen.ts` with the router registered. Loader data is therefore
fully typed in every route sample, not `any`.
- Fixed on the way: the TanStack Start guide's routes read `const
loaderData = Route.useLoaderData()` instead of destructuring it, and the
render-time sample's title is `pages/post-page.tsx`, since it imports
`pages/post.tsx`.
- The website's top bar gets a "Using TanStack Start" link after "Using
Next.js" (which goes to the Next.js overview, as
[trpc#7829](trpc#7829) set it), pointing at the
new TanStack Start guide (`docsLinks` in `www/src/site.ts`). It shows
from 1280px (`xl`) wide; below that, the extra label would push the
header past the window. Phones get the link in the menu; in between, the
guide is in the docs sidebar.
[trpc#7801](trpc#7801) added a `wide` flag that
shows the Awesome tRPC Collection link from `lg`; both now use one
`from` field naming the breakpoint a link shows from.
- `pnpm-lock.yaml` adds the new dependencies of `www` and the samples
app.

### Handles `@see` links

- In `@trpc/tanstack-react-query`, the `@see` links of the handle
methods and types (`unstable_$prefetch` and the other verbs,
`unstable_$fromHandle`, `unstable_TRPCPrefetchInfiniteOptions`,
`unstable_inferQueryHandle`, `unstable_inferInfiniteQueryHandle`) and of
`unstable_createHydrateClient` point at the handles page again:
`handles`, `#fetch`, `#infinite-queries`, `#reading-a-handle`,
`#typing-props` and `#hydrate-client`.
- `www/build/package-links.test.ts` no longer skips the two
runtime-message URLs (`handles#in-render` and
`handles#where-handles-dont-work`), so it checks them like every other
link.

### Handles carry no data

Follows [trpc#7822](trpc#7822):

- The handles page's "Handles with data" section, its size table and its
demo are gone. A new [Handles carry no
data](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#no-data)
section says to read handles with `useSuspenseQuery` for data that's
always defined, and that a `queryClient.clear()` doesn't bring back the
data the loader started with.
- [Using the data in a
loader](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#loader-data):
`await queryClient.ensureQueryData(trpc.unstable_$fromHandle(handle))`
reads the data from the cache with no request. The dependent-query
examples (the URL section's "before" loader and the loader waterfall)
and the TanStack Start guide's note on `head` use it.
- The "Which to use" table loses its "Handle carries data" row, and the
TanStack Query equivalent of `unstable_$fromHandle` no longer mentions
`initialData`.
- The usage page says handles carry no data.

### Review fixes

- The URL demo's `parseListUrl` falls back to the defaults for a URL
`new URL()` can't parse, such as `http://`.
- The React Router and App Router whole-file examples show their
imports.
- React Router gets a Data Mode example: the loader as a route object's
`loader`, read with `useLoaderData`.
- The TanStack Start guide installs `zod`, and step 3 adds the
`/api/trpc` server route the browser's link calls.
- `unstable_$fromHandle` gives `infiniteQueryOptions` for an infinite
handle; the handles and usage pages now say so.

### TanStack Start SSE example

- TanStack Start SSE example (`examples/tanstack-start-sse-chat`), on
[trpc#7796](trpc#7796 UI, now uses handles.
The router and server code are unchanged:
- Loaders return `trpc.channel.list.unstable_$prefetch()` and
`trpc.post.infinite.unstable_$prefetchInfinite({ channelId }, {
getNextPageParam })` as loader data.
- Components read them with `trpc.unstable_$fromHandle(...)`: the
sidebar's channel list, the channel name in the chat header, and the
posts. The posts read passes `getNextPageParam` and the refetch flags.
- Props are typed with `unstable_inferQueryHandle` /
`unstable_inferInfiniteQueryHandle`.
- `Chat` and `useLivePosts` take only the posts handle and read
`channelId` from `posts.input`.
- The `channelListQuery` / `postListQuery` helpers are gone;
`sessionQuery` stays, since it isn't tRPC.
- The "Load more" button switches on the posts query's `fetchStatus`
instead of branching on `isFetchingNextPage`, styled like the rest of
the new UI: a spinner while fetching, and a wifi-off icon with "Waiting
for network..." while the query is paused offline. It stays disabled
during any fetch, not only a next-page fetch; the posts query has its
refetch triggers off, so in practice only "Load more" fetches.
- trpc#7796's typing-indicator fix (`autoFocus` on the message box) is kept.

```tsx
export const Route = createFileRoute('/channels/$channelId')({
  loader: ({ context: { trpc }, params }) => ({
    channels: trpc.channel.list.unstable_$prefetch(),
    posts: trpc.post.infinite.unstable_$prefetchInfinite(
      { channelId: params.channelId },
      { getNextPageParam: (d) => d.nextCursor },
    ),
  }),
  component: ChannelPage,
});

function ChannelList(props: { channels: unstable_inferQueryHandle<TRPC['channel']['list']> }) {
  const trpc = useTRPC();
  const channelsQuery = useSuspenseQuery(trpc.unstable_$fromHandle(props.channels));
  return channelsQuery.data.map((channel) => /* ... */);
}
```

### Live demos in the docs

The handles page and the TanStack Start guide get interactive demos,
built the way [KATT/raf-query](https://github.com/KATT/raf-query)'s docs
build theirs. They run the real handles API against a tRPC router in the
page (`initTRPC.create({ allowOutsideOfServer: true })` behind
`localLink`), with a pretend network you can slow down and a network
panel that draws each request and the moment the page shows.

- **Start queries in a loader** (`starting-queries`): a small blog in an
in-page browser (TanStack Router on memory history). Switch the loaders
between `$prefetch`, `$ensure` and `$fetch`, open a post, go back and
open it again, and watch which ones wait, and what happens to stale
data. On the handles page and, with `$prefetch` and `$ensure` only, in
the TanStack Start guide.
- **Where the queries start** (`waterfalls`): one page with its queries
started in the loader, at the top of the page, or in each component. The
last one shows the two-round-trip waterfall.
- **The URL is the input** (`url-input`) and **the loader diagram**
(`loader-handles`), first built for the blog post, now also in the docs.

How they're embedded:

- A `demo` code fence names the demo: ` ```demo starting-queries
variants=prefetch,ensure `. The build rejects unknown names and
malformed options (`build/markdown.ts`), and the fence's body is the
static stand-in: it shows until the demo loads, if the demo fails, and
in the agent markdown (`/docs/<slug>.md`).
- The demos live in `www/src/demos/`, shared by the docs and the blog.
`PageDemos` mounts them in the browser only, each as its slot nears the
screen, inside an error boundary. Pages without demos load none of their
code; a demo's own chunk is 3–6 KB plus the shared kit.
- Light and dark from the site's theme, `@shared/ui` and Tailwind only,
usable at 390px, and under `prefers-reduced-motion` the bars and pending
states don't animate.
- `www` now depends on `@trpc/client`, `@trpc/server`,
`@trpc/tanstack-react-query` and `@tanstack/react-query` at runtime.
- The docs' note on `unstable_$fetch` now says that TanStack Router, by
default, shows a visited page from its last loader data and reruns the
loader in the background, so `$ensure` and `$fetch` only differ there
with `staleReloadMode: 'blocking'` (which the demo sets).
- The prose around the demos, and the paragraphs this PR touches in both
guides, got a plain-English pass.

| Start queries in a loader | Where the queries start (dark) |
| --- | --- |
| ![Start queries demo: a post rendered with $prefetch, network panel
showing one round
trip](https://cursor.com/artifacts/c/art-3eb34a28-b238-400a-b27a-1f59faa780b7)
| ![Waterfalls demo, each component variant: two round trips, dark
mode](https://cursor.com/artifacts/c/art-34613930-e796-4529-bf95-3478004e2bcc)
|
| ![Start queries demo at 390px with
$ensure](https://cursor.com/artifacts/c/art-da1b0455-4cfc-471a-a869-88e50087db35)
| ![TanStack Start guide: the loader and handles
diagram](https://cursor.com/artifacts/c/art-dacd1891-cd2e-4698-9dd4-818f9b2aecfa)
|
| ![Start queries demo under reduced motion,
mid-load](https://cursor.com/artifacts/c/art-3821ce1a-10a1-4b04-a46e-eaf16982afc3)
| |

<a
href="https://cursor.com/agents/bc-0240dc70-9b6f-556c-b489-959eff930ee9/artifacts?path=%2Fopt%2Fcursor%2Fartifacts%2Fdocs-demos-walkthrough.mp4"><img
src="https://cursor.com/artifacts/c/art-0c7d1949-7ae7-4670-a5da-95d0e6d1d277"
alt="docs-demos-walkthrough.mp4" /></a>

The walkthrough was recorded before the handle-data demo was removed.

### Framework tabs as links, kept in the URL

- Built for the blog post's "In your framework" tabs in
[trpc#7773](trpc#7773). No docs page has a
`framework` tab group yet, so nothing on the docs pages changes until
the post lands.
- `www/src/tabs.ts` lists the tab groups kept in the URL: only
`framework` for now. Their tabs render as links to `?framework=<tab>`
(`nextjs`, `tanstack-start`, `react-router`) instead of buttons
(`rehypeCodeTabs` in `build/markdown.ts`).
- A click switches the tabs and rewrites the URL in place, through the
router (`replace`, no scroll reset, the hash kept), so the page doesn't
move and the back button doesn't step through tabs. The clicked tab
stays where it is on screen, even when groups above it change height. A
click with a modifier key, or a middle click, opens the link in a new
tab like any other link. On hover and focus, a tab's href is rebuilt
from the current URL with only `framework` changed, so the new tab keeps
`?flags=` and the hash.
- Space on a focused tab selects it, as on a button, instead of
scrolling the page. Enter follows the link natively.
- On load, `?framework=` wins over the stored choice, so a shared link
opens on its tab. A URL's choice isn't stored: visiting someone's link
doesn't change your default. The click still stores it, as before.
- The root route's `validateSearch` keeps `?framework=` next to
`?flags=`, so the router doesn't drop it. Links to other pages don't
carry it.
- Other tab groups (package managers and the older docs' groups) stay
buttons with `localStorage` only.
- The pages stay prerendered once: `?framework=` gets the same HTML, and
the browser applies the tab after hydration.

## Links

- Docs:
- [Local
Link](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/links/localLink):
uses `localLink`, and notes that `unstable_localLink` still works but is
deprecated.
- New page: [Prefetching with
handles](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles):
[waiting versus not
waiting](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#starting-a-query)
(when you need `Suspense`, [waiting for fresh data with
`unstable_$fetch`](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#fetch),
a comparison table, [TanStack Query
equivalents](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#tanstack-equivalents),
combining both),
[reading](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#reading-a-handle)
(including `handle.input`), typing props, [handles carry no
data](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#no-data)
(with [using the data in a
loader](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#loader-data)),
infinite queries, [changing the input when you
read](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#changing-the-input),
[request
waterfalls](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#waterfalls)
(dependent queries, in a loader or a component), Next.js App Router with
separate streaming and waiting examples,
[errors](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#errors),
invalidation, guarantees,
[testing](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#testing),
where handles don't work, and an [FAQ on the
`$`](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#why-the-dollar).
- New page: [Set up with TanStack
Start](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start):
setup with an isomorphic client and [the `/api/trpc` server
route](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start#3-create-an-isomorphic-trpc-client),
[loaders that don't
wait](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start#loader-prefetch)
and [loaders that
wait](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start#loader-ensure),
and [handles in
`beforeLoad`](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start#before-load).
- Handles page, [Without a loader: in
render](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#in-render):
the top-of-page pattern, its rules, and server rendering. [Where to
start
queries](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#where-to-start)
is a table per kind of app, and [dependent queries in a
component](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#waterfall-in-a-component)
start the query in render.
- Handles page, [React
Router](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#react-router):
client-only apps with `clientLoader` or a Data Mode `loader` (each with
its own example), and server rendering with a per-request query client
and proxy from root middleware, `dehydrate` in the loader and
`HydrationBoundary` in the route. It also explains keying `Suspense`
boundaries by the route's input, without which a navigation between two
posts waits for the slow query.
- Handles page, App Router:
[`HydrateClient`](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#hydrate-client).
The Server Components guide's `HydrateClient` tip links to it.
- [React Server Components, Using your
API](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/server-components#using-your-api):
tip linking to handles.
- [Next.js App Router setup, Make API
requests](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/nextjs/app-router-setup#7-make-api-requests):
tip linking to handles.
- [TanStack React Query
usage](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/usage#handles):
short `unstable_$prefetch` / `unstable_$ensure` / `unstable_$fetch` /
`unstable_$fromHandle` entry, with the `$` explained.
- [Start every query from the
URL](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#url-as-input)
on the handles page, with [If the URL isn't enough, reshape the
procedure](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#reshape-procedures),
and [the same
section](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start#url-as-input)
in the TanStack Start guide.
- Live demos: [Start queries in a
loader](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#which-to-use)
(below the table), [The URL is the
input](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#url-as-input),
[Where the queries
start](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/handles#waterfalls),
and in the TanStack Start guide
[loaders](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start#loader-prefetch)
and [the
URL](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start#url-as-input).
- Top bar: "Using TanStack Start", after "Using Next.js", on every page
1280px wide or more, for example [the docs
home](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs).
It opens the [TanStack Start
guide](https://www-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/docs/client/tanstack-react-query/tanstack-start).
- SSE chat example:
-
[`/`](https://tanstack-start-sse-chat-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/):
the channel list is server-rendered from an `unstable_$prefetch()`
handle in loader data.
-
[`/channels/<id>`](https://tanstack-start-sse-chat-git-cursor-query-handles-docs-0ee9-trpc.vercel.app/channels/9794ea9f-1412-4d0a-8476-ba137209bc1e):
channels and posts are read from handles; "Load more" paginates the
infinite handle.

## Alternatives considered

- Docs in the same PRs as the code
([trpc#7777](trpc#7777) and
[trpc#7759](trpc#7759), before this split):
trpc.io deploys from `main`, so the docs would go live before a release
had the API.
- The tab links in the blog post's PR: they're website code, not the
post, so they sit with the rest of `www`.
- Demo embedding: `<div data-demo>` slots in the markdown (the blog
post's first version) can't be checked at build time and leak into the
agent markdown; the `demo` fence matches the site's `chart` fence and
raf-query. raf-query also prefetches a page's demo chunks in its route
loader; here they load as their slot nears the screen, so a long page
with demos far down doesn't fetch them up front.
- Demo data: recorded timelines instead of the real library. Cheaper,
but they'd drift from what handles do; the live demos run the actual `$`
methods, so they also exercise them.
- A new history entry per tab click (`push`): the back button would step
through tab choices before leaving the page. The site's experiments menu
rewrites its URL in place the same way.
- Keeping every tab group in the URL:
`?tabs-vanilla-zod-yup-valibot=zod` on old docs pages, and a package
manager in every shared docs link, overriding the recipient's own
choice. Adding a group is one line in `src/tabs.ts`.

## Testing

- Rebased onto `main` after trpc#7822, trpc#7829 and the JSDoc PRs. Before
trpc#7822, the docs, demos and example were the same files as before the
split.
- `www/build/package-links.test.ts` passes with the handles links
restored: every handles `@see` link and both runtime-message URLs
resolve to a heading on the handles page.
- Before writing the docs change, confirmed the bug on the old code:
after `queryClient.clear()`, a mounted `useQuery` reader of an
`unstable_$ensure` handle put the handle's old data back in the cache
and made no request. trpc#7822 has the tests.
- `pnpm typecheck-www`, `pnpm --filter www lint`, `pnpm --filter www
test` (274 tests, including the `demo` fence's slot, stand-in and
unknown-name error, `src/tabs.test.ts`, and a `build/markdown.test.ts`
case for framework tabs rendering as links), `pnpm --filter www build`
(all 698 trpc.io URLs resolve) and `pnpm validate-skills` pass, as do
`pnpm typecheck-packages`, `pnpm lint` and the full unit test suite
(1461 tests).
- `pnpm --filter www check-twoslash` passes on the whole site: 460
blocks, including every sample on the handles page and the TanStack
Start guide. To confirm route samples aren't silently `any`, a temporary
`const probe: number = loaderData` in each of the five route components
failed with the real loader data type.
- No hidden setup reaches the rendered pages: checked the HTML of both
pages for `declare module`, `GetAnnotations`, `@filename` and the hidden
`routeTree.gen.ts` (the only `routeTree.gen` left is the visible import
in `router.tsx`), and hovered `loaderData` in the Start guide on a local
build, which shows the handle types.

![TanStack Start guide: hovering loaderData in the /posts route shows
the handle type, with sort and page from
validateSearch](https://cursor.com/artifacts/c/art-d511cfc8-73af-4b08-b683-432c75b2ba62)
- Live demos, on a local production build with headless Chrome
(Playwright), at 1280px light and dark, 390px light and dark, and 1280px
with reduced motion: drove every demo (navigations, variant and latency
switches), with no console errors and no demo wider than the page. Found
and fixed on the way: the demo router scrolled the real page to the top
on each navigation (now `scrollRestoration: () => false`), and a variant
switch overflowed at 390px.
- The top-bar link, on a local production build with headless Chrome
after rebasing onto trpc#7801: measured `/docs` at 768, 820, 900, 1024,
1100, 1279, 1280 and 1440px. The link is hidden below 1280px, so each of
those widths matches `main`: no overflow, except 74px at 1024px, which
`main` already has with the Awesome link shown from `lg`. From 1280px
both links show and the header fits.
- TanStack Start SSE example:
- `typecheck`, `lint` and the production `build` pass on this PR. The
example has no test suite of its own, and its CI E2E entry is disabled
on `main`.
- CI's standalone build of the example ("Check standalone
tanstack-start-sse-chat package") installs `@trpc/*@canary`. Until a
canary with `localLink` is a day old (pnpm's `minimumReleaseAge`), it
gets an older canary without `localLink` and fails. That's around 18:27
UTC+1 on Nov 3. It isn't a required check.
- Scratch routes (not committed) returning `unstable_$ensure` handles
from `beforeLoad` and `loader` type-checked against TanStack Router's
serializability check. That was before trpc#7822, which only removed fields
from handles.
- Ran the production build on trpc#7796's UI against a local Postgres with
25 seeded posts and drove it with Playwright:
- Loading `/` directly renders the channel list on the server and makes
no tRPC query requests on hydration.
- Navigating to a channel on the client fetches `post.infinite` once
through the loader, then opens the two subscriptions.
- "Load more" fetches the next page with the cursor (20, then 25
messages), then is disabled.
- Offline, "Load more" shows "Waiting for network..." and stays
disabled; the next page loads once the browser is back online.
- Loading a channel directly renders 20 posts on the server; hydration
only opens the subscriptions.
- After signing in with the mocked provider, the message box is focused
on load, and typing shows "is typing..." in a second browser. A posted
message arrives there through the subscription.
- After loading both pages, going home and coming back once the posts
are stale (30 s), the loader refetches page 1 and then page 2 with its
cursor, with no console errors.
  - The server logged no handle warnings.

![SSE chat example, offline: Load more shows a wifi-off icon and Waiting
for
network...](https://cursor.com/artifacts/c/art-b3032f71-3d46-46e9-8471-42bfac213396)
- The tab links were checked in a browser on the blog post in
[trpc#7773](trpc#7773), the first page with a
`framework` tab group. Its description lists those checks.
<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-0240dc70-9b6f-556c-b489-959eff930ee9?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-0240dc70-9b6f-556c-b489-959eff930ee9&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

<!-- codesmith:footer -->
---
<a
href="https://app.blacksmith.sh/trpc/codesmith/trpc/pr/7817?autoLogin=true&ref=codesmith_pr_footer"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v3.svg"><img
alt="View with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png"
width="162" height="28"></picture></a> <a
href="https://backend.blacksmith.sh/track/enable-autofix?expires=1796218334&installation_model_id=443568&pr_number=7817&ref=codesmith_pr_footer&repository=trpc%2Ftrpc&return_to=https%3A%2F%2Fgithub.com%2Ftrpc%2Ftrpc%2Fpull%2F7817&signature=9d4d55d5465a9090f113c89919373e56eeed9937798de711561dcf9da85b4fee"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img
alt="Autofix with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png"
width="190" height="28"></picture></a>
<sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you
need.</sup>

<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Added interactive documentation demos covering query loading
strategies, request timing, URL-driven state, and blog data.
* Framework tabs can now be selected through the URL, with selections
preserved when sharing or reloading a page.
* Added a TanStack Start navigation link and improved responsive
visibility of header links.
* Updated the chat example to load data through route-provided query
handles and show loading or offline status.
* **Documentation**
* Added guides for query handles and TanStack Start, including
prefetching and server rendering, and updated examples to use the
current `localLink` name.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cursor Agent <[email protected]>
cursor Bot pushed a commit that referenced this pull request Nov 3, 2026
Brings main up to db643ba: query handles and the live docs demos
(#7759, #7817), the release commit check (#7834), the Prisma starter's
generate step (#7806), the package links test (#7809), the sponsor cards
(#7821, #7835), the PR template's AI model section (#7836) and v11.23.0.

- v11/scripts/check-release-commit.ts names v11/lerna.json and
  v11/packages/* (git gives repo-root paths) and undoes from the repo
  root; v11/package.json takes its preversion and postversion scripts
  and its effect dependencies.
- tanstack-react-query combines main's handles with #7767's feature
  flags: handles.ts reads keyPrefix through inferFeatureFlags, and
  Context.tsx passes the internal renderHandleVerbs flag through a
  variable.
- main's live demos took the ```demo fence and the demo-slot class, so
  the kitchen sink's fence is ```kitchen-sink and its slot is
  kitchen-sink-slot.
- www type-checks against v11's and v12's TanStack Query integrations,
  so v12's TanStack Query family moves to 5.105.0 with main. The
  react-spa cache test now persists through the transformer like the
  app, since 5.105.0 only falls back to initialPageParam for an
  undefined first cursor.
- www/build/package-links.test.ts reads v11/packages.
- turbo.json drops the Prisma starter's generate and lint entries.
- The PR template keeps v12's and adds main's AI model section.
- The lockfile is rebuilt from v12's, adding only the new dependencies.

Co-authored-by: Alex / KATT <[email protected]>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 4, 2026

This branch was successfully deployed

5 active deployments
Preview – www — b3001293 Deployed Nov 2, 2026 by vercel[bot]
Preview – trpc-next-app-dir — b3001293 Deployed Nov 2, 2026 by vercel[bot]
Preview – examples-todomvc — b3001293 Deployed Nov 2, 2026 by vercel[bot]
Preview – next-prisma-starter — b3001293 Deployed Nov 2, 2026 by vercel[bot]
Preview – examples-next-minimal-starter — b3001293 Deployed Nov 2, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants