WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@harlley
Copy link
Contributor

@harlley harlley commented Dec 11, 2025

The Next.js-only code was confusing for a beginner unfamiliar with Tanstack syntax.

🎯 Changes

βœ… Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

πŸš€ Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Documentation
    • Added a TanStack Start Quick Start example demonstrating a complete chat API endpoint with streaming responses and error handling.
    • Replaced the previous Next.js header with the new TanStack Start block and simplified the Next.js snippet to retain only essential imports.
    • Improved guidance for implementing streaming chat endpoints in the Quick Start.

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

The Next.js-only code was confusing for a beginner unfamiliar with Tanstack syntax.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

Walkthrough

Added a TanStack Start server POST /api/chat example to the quick-start docs demonstrating OPENAI_API_KEY validation, request parsing (messages, conversationId), streaming chat via chat({ adapter: openai(), ... }) converted to an HTTP stream with toStreamResponse, and JSON 500 error handling; adjusted the Next.js snippet imports.

Changes

Cohort / File(s) Summary
Quick-start documentation updates
docs/getting-started/quick-start.md
Added a TanStack Start POST /api/chat API route example (OPENAI_API_KEY validation, parsing messages and conversationId, streaming chat via chat({ adapter: openai(), ... }), converting to HTTP stream with toStreamResponse, and JSON 500 error handling). Replaced Next.js placeholder header with remaining import statements.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Documentation-only change with code examples.
  • Reviewers should spot-check example correctness:
    • Ensure imports and function names (chat, openai, toStreamResponse) match library API.
    • Verify environment variable name and error responses.
    • Confirm snippet syntax is valid for the target runtime (TanStack Start / Next.js).

Poem

πŸ₯• I nibble docs by lantern light,
Wove a chat route smooth and bright,
Keys guarded, streams set free to roam,
Snippets tucked into their home,
Hop β€” the quick-start feels just right.

Pre-merge checks and finishing touches

βœ… Passed checks (3 passed)
Check name Status Explanation
Title check βœ… Passed The title accurately summarizes the main change: adding a TanStack Start server code example for the chat API, which directly matches the file changes in the quick-start.md documentation.
Description check βœ… Passed The description follows the template structure with checked checklists and clear release impact designation. The Changes section is minimally filled but adequate context is provided in the introductory statement about addressing beginner confusion.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

πŸ“œ Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 5a90539 and 2b3543e.

πŸ“’ Files selected for processing (1)
  • docs/getting-started/quick-start.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/getting-started/quick-start.md

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

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 049eb8a and f07605b.

πŸ“’ Files selected for processing (1)
  • docs/getting-started/quick-start.md (1 hunks)
🧰 Additional context used
πŸͺ› markdownlint-cli2 (0.18.1)
docs/getting-started/quick-start.md

30-30: Hard tabs
Column: 1

(MD010, no-hard-tabs)


31-31: Hard tabs
Column: 1

(MD010, no-hard-tabs)


32-32: Hard tabs
Column: 1

(MD010, no-hard-tabs)


33-33: Hard tabs
Column: 1

(MD010, no-hard-tabs)


34-34: Hard tabs
Column: 1

(MD010, no-hard-tabs)


35-35: Hard tabs
Column: 1

(MD010, no-hard-tabs)


36-36: Hard tabs
Column: 1

(MD010, no-hard-tabs)


37-37: Hard tabs
Column: 1

(MD010, no-hard-tabs)


38-38: Hard tabs
Column: 1

(MD010, no-hard-tabs)


39-39: Hard tabs
Column: 1

(MD010, no-hard-tabs)


40-40: Hard tabs
Column: 1

(MD010, no-hard-tabs)


41-41: Hard tabs
Column: 1

(MD010, no-hard-tabs)


42-42: Hard tabs
Column: 1

(MD010, no-hard-tabs)


43-43: Hard tabs
Column: 1

(MD010, no-hard-tabs)


44-44: Hard tabs
Column: 1

(MD010, no-hard-tabs)


46-46: Hard tabs
Column: 1

(MD010, no-hard-tabs)


48-48: Hard tabs
Column: 1

(MD010, no-hard-tabs)


49-49: Hard tabs
Column: 1

(MD010, no-hard-tabs)


50-50: Hard tabs
Column: 1

(MD010, no-hard-tabs)


51-51: Hard tabs
Column: 1

(MD010, no-hard-tabs)


52-52: Hard tabs
Column: 1

(MD010, no-hard-tabs)


53-53: Hard tabs
Column: 1

(MD010, no-hard-tabs)


54-54: Hard tabs
Column: 1

(MD010, no-hard-tabs)


55-55: Hard tabs
Column: 1

(MD010, no-hard-tabs)


57-57: Hard tabs
Column: 1

(MD010, no-hard-tabs)


58-58: Hard tabs
Column: 1

(MD010, no-hard-tabs)


59-59: Hard tabs
Column: 1

(MD010, no-hard-tabs)


60-60: Hard tabs
Column: 1

(MD010, no-hard-tabs)


61-61: Hard tabs
Column: 1

(MD010, no-hard-tabs)


62-62: Hard tabs
Column: 1

(MD010, no-hard-tabs)


63-63: Hard tabs
Column: 1

(MD010, no-hard-tabs)


64-64: Hard tabs
Column: 1

(MD010, no-hard-tabs)


65-65: Hard tabs
Column: 1

(MD010, no-hard-tabs)


66-66: Hard tabs
Column: 1

(MD010, no-hard-tabs)


67-67: Hard tabs
Column: 1

(MD010, no-hard-tabs)


68-68: Hard tabs
Column: 1

(MD010, no-hard-tabs)


69-69: Hard tabs
Column: 1

(MD010, no-hard-tabs)


70-70: Hard tabs
Column: 1

(MD010, no-hard-tabs)


71-71: Hard tabs
Column: 1

(MD010, no-hard-tabs)


72-72: Hard tabs
Column: 1

(MD010, no-hard-tabs)


73-73: Hard tabs
Column: 1

(MD010, no-hard-tabs)

πŸ”‡ Additional comments (1)
docs/getting-started/quick-start.md (1)

22-122: Well-structured examples demonstrating equivalent functionality across frameworks.

The addition of the TanStack Start example alongside the Next.js implementation is excellent for documentation clarity. Both examples properly demonstrate:

  • Environment variable validation
  • Request parsing with conversationId and messages
  • Streaming chat response creation via the chat() API
  • Proper error handling with JSON error responses

The parallel structure makes it easy for developers familiar with either framework to understand how to implement the same functionality.

@AlemTuzlak AlemTuzlak merged commit 254b248 into TanStack:main Dec 20, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants