Skip to content

docs: update TanStack Start guide for RC APIs#1275

Open
juliusmarminge wants to merge 3 commits intomainfrom
cursor/update-tanstack-start-doc-4936
Open

docs: update TanStack Start guide for RC APIs#1275
juliusmarminge wants to merge 3 commits intomainfrom
cursor/update-tanstack-start-doc-4936

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented Apr 12, 2026

Summary

  • update the TanStack Start getting-started guide to match the current RC-era TanStack Start APIs
  • replace the stale createAPIFileRoute/app/api.ts guidance with createFileRoute(...){ server: { handlers } }
  • normalize example paths to src/..., refresh the RC note, and fix the homepage snippet export name

Testing

  • pnpm exec prettier --check "docs/src/app/(docs)/getting-started/tanstack-start/page.mdx"
  • pnpm --filter @uploadthing/mime-types build && pnpm --filter @uploadthing/shared build && pnpm --filter uploadthing build && pnpm --filter @uploadthing/react build
  • pnpm --filter docs build
Open in Web Open in Cursor 

Summary by CodeRabbit

  • Documentation
    • Updated getting-started guide to reflect v1 RC server-route conventions.
    • Standardized branding to "TanStack" across the docs.
    • Revised code examples and route naming to match the latest routing conventions and file path patterns.

Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 12, 2026

⚠️ No Changeset found

Latest commit: edea732

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 12, 2026

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

Project Deployment Actions Updated (UTC)
docs-uploadthing Ready Ready Preview, Comment Apr 12, 2026 8:11pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
legacy-docs-uploadthing Ignored Ignored Apr 12, 2026 8:11pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 743f9115-4a83-47cd-b771-bc5053c08202

📥 Commits

Reviewing files that changed from the base of the PR and between 4d858db and edea732.

📒 Files selected for processing (1)
  • docs/src/app/(docs)/getting-started/tanstack-start/page.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/src/app/(docs)/getting-started/tanstack-start/page.mdx

Walkthrough

Updated TanStack Start documentation: standardized "TanStack" casing, changed release-status note to reference "v1 RC server-route conventions," updated example paths from app/... to src/..., and replaced API route snippets to use createFileRoute with server.handlers async handlers and renamed exported route constants to Route.

Changes

Cohort / File(s) Summary
TanStack Start Documentation
docs/src/app/(docs)/getting-started/tanstack-start/page.mdx
Adjusted headings/casing to "TanStack", switched release note from a beta-specific version to an RC statement, updated example paths to src/..., replaced createAPIFileRoute example with createFileRoute using server.handlers.GET/POST async handlers, and renamed exported route constants from APIRoute to Route.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main change: updating TanStack Start guide documentation for RC APIs, which aligns with all modifications in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/update-tanstack-start-doc-4936

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 12, 2026

📦 Bundle size comparison

Bundle Size (gzip) Visualization
Main 31.17KB See Treemap 📊
PR (5a4e545) 31.17KB See Treemap 📊
Diff No change

Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Comment on lines +109 to +114
<Note>
TanStack Start server routes now live directly in your `src/routes` tree, so
`src/routes/api/uploadthing.ts` automatically serves `/api/uploadthing`. For
more information, please refer to the [TanStack Start server-routes
docs](https://tanstack.com/start/latest/docs/framework/react/guide/server-routes).
</Note>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@cursoragent this note can be removed i tihnk

Copy link
Copy Markdown

@cursor cursor bot Apr 12, 2026

Choose a reason for hiding this comment

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

Summary

  • Removed the redundant second note under the TanStack Start API-route section, keeping the path-specific note and the code sample intact. page.mdx:101-132
  • Committed the review follow-up in edea732c and pushed it to cursor/update-tanstack-start-doc-4936.

Testing

  • pnpm exec prettier --check "docs/src/app/(docs)/getting-started/tanstack-start/page.mdx" — enough for this tiny docs-only follow-up because the change only deleted redundant MDX text and did not alter code examples.
Open in Web Open in Cursor 

Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 12, 2026

Greptile Summary

This PR updates the TanStack Start getting-started guide from stale beta/alpha patterns (createAPIFileRoute, app/api.ts) to the current RC API (createFileRoute with server: { handlers }), normalizes all example paths from app/ to src/, fixes the homepage snippet's export name (APIRouteRoute), and refreshes the beta note.

  • Two consecutive <Note> blocks (lines 103-114) say the same thing; one should be dropped or merged.
  • examples/minimal-tanstack-start/src/routes/api.uploadthing.ts still uses createServerFileRoute (old API), creating an inconsistency for users who cross-reference the live example.

Confidence Score: 4/5

Safe to merge after resolving the redundant notes and ideally updating the example file to match.

All findings are P2; the core API changes are correct and verified against the official TanStack Start RC docs. The score is 4 rather than 5 because the example file divergence (old vs. new API in the same repo) is a real developer-experience concern that should be addressed before or alongside this PR.

examples/minimal-tanstack-start/src/routes/api.uploadthing.ts — still uses createServerFileRoute, inconsistent with the new docs

Important Files Changed

Filename Overview
docs/src/app/(docs)/getting-started/tanstack-start/page.mdx Updates TanStack Start guide from beta/alpha APIs to RC conventions (createFileRoute + server.handlers); fixes export name and normalizes paths to src/. Two redundant Note blocks and a divergence with the repo's own example file remain.

Sequence Diagram

sequenceDiagram
    participant Client
    participant TanStackRoute as createFileRoute("/api/uploadthing")
    participant Handler as createRouteHandler
    participant UploadThing as UploadThing Server

    Client->>TanStackRoute: GET /api/uploadthing
    TanStackRoute->>Handler: server.handlers.GET({ request })
    Handler->>UploadThing: Process request via uploadRouter
    UploadThing-->>Handler: Response
    Handler-->>TanStackRoute: Response
    TanStackRoute-->>Client: Response

    Client->>TanStackRoute: POST /api/uploadthing
    TanStackRoute->>Handler: server.handlers.POST({ request })
    Handler->>UploadThing: Handle upload via uploadRouter
    UploadThing-->>Handler: Response
    Handler-->>TanStackRoute: Response
    TanStackRoute-->>Client: Response
Loading

Comments Outside Diff (2)

  1. docs/src/app/(docs)/getting-started/tanstack-start/page.mdx, line 116-137 (link)

    P2 handler wrappers can be simplified

    createRouteHandler in packages/uploadthing/src/server.ts already accepts Request | { request: Request } (it checks "request" in ev), so the TanStack Start handler context object can be passed directly without the intermediate async wrapper:

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

  2. docs/src/app/(docs)/getting-started/tanstack-start/page.mdx, line 116-137 (link)

    P2 Example file not updated alongside docs

    examples/minimal-tanstack-start/src/routes/api.uploadthing.ts still uses the old createServerFileRoute API (imported from @tanstack/react-start/server) with the .methods({ GET: handlers, POST: handlers }) pattern, while this guide now documents createFileRoute from @tanstack/react-router with server: { handlers }. A developer who cross-references the working example against the guide will encounter two different, mutually incompatible code patterns for the same task.

Reviews (1): Last reviewed commit: "docs: remove redundant TanStack Start no..." | Re-trigger Greptile

Comment on lines 103 to 114
<Note>
File path here doesn't matter, you can serve this from any route. We recommend
serving it from `/api/uploadthing`.
TanStack Start server routes can live anywhere under `src/routes`, but this
guide uses `src/routes/api/uploadthing.ts` so the endpoint is served from
`/api/uploadthing`.
</Note>

<Warning>
Make sure to configure API entry handler in `app/api.ts`. For more
information, please refer to the [@tanstack/start
docs](https://tanstack.com/router/latest/docs/framework/react/start/api-routes#setting-up-the-entry-handler).
</Warning>

```ts {{ title: "app/routes/api/uploadthing.ts" }}
import { createAPIFileRoute } from "@tanstack/start/api";
```ts {{ title: "src/routes/api/uploadthing.ts" }}
import { createFileRoute } from "@tanstack/react-router";

import { createRouteHandler } from "uploadthing/server";

import { uploadRouter } from "../../server/uploadthing";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Redundant consecutive <Note> blocks

Both notes explain the same thing: TanStack Start server routes live in src/routes and src/routes/api/uploadthing.ts maps to /api/uploadthing. The first is fully redundant once the second is present (the second adds the external docs link). Consider collapsing them into one:

Suggested change
<Note>
File path here doesn't matter, you can serve this from any route. We recommend
serving it from `/api/uploadthing`.
TanStack Start server routes can live anywhere under `src/routes`, but this
guide uses `src/routes/api/uploadthing.ts` so the endpoint is served from
`/api/uploadthing`.
</Note>
<Warning>
Make sure to configure API entry handler in `app/api.ts`. For more
information, please refer to the [@tanstack/start
docs](https://tanstack.com/router/latest/docs/framework/react/start/api-routes#setting-up-the-entry-handler).
</Warning>
```ts {{ title: "app/routes/api/uploadthing.ts" }}
import { createAPIFileRoute } from "@tanstack/start/api";
```ts {{ title: "src/routes/api/uploadthing.ts" }}
import { createFileRoute } from "@tanstack/react-router";
import { createRouteHandler } from "uploadthing/server";
import { uploadRouter } from "../../server/uploadthing";
<Note>
TanStack Start server routes live directly in your `src/routes` tree, so
`src/routes/api/uploadthing.ts` automatically serves `/api/uploadthing`. For
more information, please refer to the [TanStack Start server-routes
docs](https://tanstack.com/start/latest/docs/framework/react/guide/server-routes).
</Note>

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs/src/app/(docs)/getting-started/tanstack-start/page.mdx (1)

103-114: Consolidate the duplicated server-route notes.

These two adjacent <Note> blocks repeat the same guidance. Merging them will keep the section tighter and easier to maintain.

✂️ Suggested doc cleanup
 <Note>
-  TanStack Start server routes can live anywhere under `src/routes`, but this
-  guide uses `src/routes/api/uploadthing.ts` so the endpoint is served from
-  `/api/uploadthing`.
-</Note>
-
-<Note>
-  TanStack Start server routes now live directly in your `src/routes` tree, so
-  `src/routes/api/uploadthing.ts` automatically serves `/api/uploadthing`. For
-  more information, please refer to the [TanStack Start server-routes
-  docs](https://tanstack.com/start/latest/docs/framework/react/guide/server-routes).
+  TanStack Start server routes live in `src/routes`, and this guide uses
+  `src/routes/api/uploadthing.ts`, which serves `/api/uploadthing`
+  automatically. For more information, refer to the [TanStack Start
+  server-routes docs](https://tanstack.com/start/latest/docs/framework/react/guide/server-routes).
 </Note>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/app/`(docs)/getting-started/tanstack-start/page.mdx around lines 103
- 114, Remove the duplicated adjacent <Note> blocks and merge their content into
a single concise <Note> that states TanStack Start server routes live under
src/routes and that src/routes/api/uploadthing.ts serves /api/uploadthing, and
include the link to the TanStack Start server-routes docs; update the single
<Note> so it contains the combined phrasing from both original blocks and delete
the redundant one to avoid repetition.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/src/app/`(docs)/getting-started/tanstack-start/page.mdx:
- Around line 116-136: The docs example is using the wrong TanStack API pattern;
replace the createFileRoute + server.handlers pattern with the server route
pattern used in the example so it matches the examples/minimal-tanstack-start
code: import and use createServerFileRoute from "@tanstack/react-start/server",
keep the same createRouteHandler(handler) and uploadRouter, and expose Route via
createServerFileRoute("/api/uploadthing").methods({ GET: async ({ request }) =>
handler(request), POST: async ({ request }) => handler(request) }) so the
snippet uses createServerFileRoute, .methods(), Route, createRouteHandler, and
uploadRouter consistently with the example; alternatively add a short note above
the snippet explicitly stating the difference between createFileRoute
(client-side react-router) and createServerFileRoute (server-side react-start)
and when to use each.

---

Nitpick comments:
In `@docs/src/app/`(docs)/getting-started/tanstack-start/page.mdx:
- Around line 103-114: Remove the duplicated adjacent <Note> blocks and merge
their content into a single concise <Note> that states TanStack Start server
routes live under src/routes and that src/routes/api/uploadthing.ts serves
/api/uploadthing, and include the link to the TanStack Start server-routes docs;
update the single <Note> so it contains the combined phrasing from both original
blocks and delete the redundant one to avoid repetition.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2ab5c6a6-3219-4a89-b2e1-d99ad6f8efbe

📥 Commits

Reviewing files that changed from the base of the PR and between d822137 and 4d858db.

📒 Files selected for processing (1)
  • docs/src/app/(docs)/getting-started/tanstack-start/page.mdx

Comment on lines +116 to 136
```ts {{ title: "src/routes/api/uploadthing.ts" }}
import { createFileRoute } from "@tanstack/react-router";

import { createRouteHandler } from "uploadthing/server";

import { uploadRouter } from "../../server/uploadthing";

const handlers = createRouteHandler({ router: uploadRouter });

export const Route = createAPIFileRoute("/api/uploadthing")({
GET: handlers,
POST: handlers,
const handler = createRouteHandler({ router: uploadRouter });

export const Route = createFileRoute("/api/uploadthing")({
server: {
handlers: {
GET: async ({ request }) => {
return handler(request);
},
POST: async ({ request }) => {
return handler(request);
},
},
},
});
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.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== TanStack Start route API usage in docs/examples =="
rg -n -C2 --type=mdx --type=ts --type=tsx \
  'createServerFileRoute|createAPIFileRoute|createFileRoute\(|server:\s*\{|\.methods\(|export const ServerRoute|export const Route' \
  docs examples

echo
echo "== TanStack package references in repository manifests =="
rg -n --glob '**/package.json' \
  '"@tanstack/react-router"|"@tanstack/react-start"'

Repository: pingdotgg/uploadthing

Length of output: 163


🏁 Script executed:

# Search for TanStack route patterns in docs and examples with corrected approach
find docs examples -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.mdx" \) | head -20

Repository: pingdotgg/uploadthing

Length of output: 1024


🏁 Script executed:

# Look at the specific files mentioned in the review
echo "=== Docs file (page.mdx) ===" 
find docs -name "*tanstack*" -o -name "*page.mdx" | grep -i tanstack

echo -e "\n=== Examples file ===" 
find examples -path "*tanstack*" -name "*.ts"

Repository: pingdotgg/uploadthing

Length of output: 504


🏁 Script executed:

# Check TanStack Start package version
rg '"@tanstack/react-start"' --glob='**/package.json' -A 1 -B 1

Repository: pingdotgg/uploadthing

Length of output: 319


🏁 Script executed:

# Read the docs snippet mentioned in the review (lines 116-136)
sed -n '110,145p' docs/src/app/(docs)/getting-started/tanstack-start/page.mdx | cat -n

Repository: pingdotgg/uploadthing

Length of output: 238


🏁 Script executed:

# Read the examples file that's being compared
cat -n examples/minimal-tanstack-start/src/routes/api.uploadthing.ts

Repository: pingdotgg/uploadthing

Length of output: 514


🏁 Script executed:

# Read the docs file with proper escaping
cat -n "docs/src/app/(docs)/getting-started/tanstack-start/page.mdx" | sed -n '110,145p'

Repository: pingdotgg/uploadthing

Length of output: 1283


🏁 Script executed:

# Search for other TanStack Start route patterns in the codebase
rg -n "createServerFileRoute|createFileRoute.*server.*handlers" examples/minimal-tanstack-start/

Repository: pingdotgg/uploadthing

Length of output: 341


🏁 Script executed:

# Check if there's any documentation about the API differences or version requirements
find docs -name "*.mdx" -type f -exec grep -l "tanstack.*start\|react-start" {} \;

Repository: pingdotgg/uploadthing

Length of output: 47


🏁 Script executed:

# Look for any migration or compatibility notes in the tanstack-start example
find examples/minimal-tanstack-start -name "*.md" -o -name "README*"

Repository: pingdotgg/uploadthing

Length of output: 47


🏁 Script executed:

# Check all imports of createFileRoute and createServerFileRoute in the codebase
rg "import.*createFileRoute|import.*createServerFileRoute" --type ts --type tsx docs examples

Repository: pingdotgg/uploadthing

Length of output: 92


🏁 Script executed:

# Look for any other server route patterns in docs
rg "createServerFileRoute|ServerRoute" docs/ --type mdx

Repository: pingdotgg/uploadthing

Length of output: 92


🏁 Script executed:

# Check if there's a difference between `@tanstack/react-router` and `@tanstack/react-start` packages
rg "@tanstack/react-router|@tanstack/react-start" --glob="**/package.json" --context 2

Repository: pingdotgg/uploadthing

Length of output: 502


🏁 Script executed:

# Search without type filters for import patterns
rg "import.*createFileRoute|import.*createServerFileRoute" docs examples

Repository: pingdotgg/uploadthing

Length of output: 543


🏁 Script executed:

# Search for ServerRoute patterns
rg "ServerRoute" docs examples

Repository: pingdotgg/uploadthing

Length of output: 3079


🏁 Script executed:

# Check TanStack Start docs or example patterns in the example directory structure
ls -la "examples/minimal-tanstack-start/src/routes/" | head -20

Repository: pingdotgg/uploadthing

Length of output: 363


Align TanStack Start server route patterns across docs and examples.

The docs snippet uses createFileRoute from "@tanstack/react-router" with a server: { handlers } config object, while examples/minimal-tanstack-start/src/routes/api.uploadthing.ts uses createServerFileRoute from "@tanstack/react-start/server" with a .methods() chaining API. These are incompatible patterns from different packages. Align both or add explicit documentation clarifying which pattern is correct and when each should be used.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/app/`(docs)/getting-started/tanstack-start/page.mdx around lines 116
- 136, The docs example is using the wrong TanStack API pattern; replace the
createFileRoute + server.handlers pattern with the server route pattern used in
the example so it matches the examples/minimal-tanstack-start code: import and
use createServerFileRoute from "@tanstack/react-start/server", keep the same
createRouteHandler(handler) and uploadRouter, and expose Route via
createServerFileRoute("/api/uploadthing").methods({ GET: async ({ request }) =>
handler(request), POST: async ({ request }) => handler(request) }) so the
snippet uses createServerFileRoute, .methods(), Route, createRouteHandler, and
uploadRouter consistently with the example; alternatively add a short note above
the snippet explicitly stating the difference between createFileRoute
(client-side react-router) and createServerFileRoute (server-side react-start)
and when to use each.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants