Skip to content

Conversation

@morinokami
Copy link
Contributor

@morinokami morinokami commented Nov 1, 2025

  • Use createServerFn().handler in example
  • Rename handler params from ctx/input to context/data
  • Set createUser to POST

While the example is intentionally contrived, this update ensures it matches the documented API and is copy-pastable without confusion.

Summary by CodeRabbit

  • Documentation
    • Updated React framework database guide with refined server-side function patterns.
    • Enhanced code examples for user data operations to reflect current best practices.

@github-actions github-actions bot added the documentation Everything documentation related label Nov 1, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 1, 2025

Walkthrough

Documentation updates to server function examples in a React framework guide, refactoring getUser and createUser functions to use .handler() method syntax with updated parameter naming conventions (ctx → context, input → data) and explicit HTTP method specification.

Changes

Cohort / File(s) Summary
Server function pattern documentation
docs/start/framework/react/guide/databases.md
Updated getUser to use createServerFn().handler(({ context })) pattern with context.userId access; updated createUser to use createServerFn({ method: 'POST' }).handler(({ data })) pattern with explicit POST method option and data parameter naming

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Verify new .handler() API pattern is correctly demonstrated in both function examples
  • Confirm parameter naming changes (ctx → context, input → data) are consistent with current framework conventions
  • Check that explicit { method: 'POST' } option placement and syntax are accurate for the framework's API

Poem

🐰 A rabbit hops through docs with glee,
Where functions now use .handler spree,
Context blooms where ctx once grew,
Data flows where input flew,
Pattern patterns, fresh and free! 🌿

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "docs: fix database guide example to match Server Functions API" directly and accurately describes the main change in the changeset. The raw summary shows that the documentation file was updated to use the .handler approach with context and data parameters instead of the previous ctx and input patterns, which aligns exactly with the title's claim about matching the Server Functions API. The title is concise, specific, and follows documentation commit conventions, clearly communicating the purpose of the change to someone reviewing the git history.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1d91138 and 03c8a11.

📒 Files selected for processing (1)
  • docs/start/framework/react/guide/databases.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (AGENTS.md)

Use internal docs links relative to the docs/ folder (e.g., ./guide/data-loading)

Files:

  • docs/start/framework/react/guide/databases.md
docs/{router,start}/**

📄 CodeRabbit inference engine (AGENTS.md)

Place router docs under docs/router/ and start framework docs under docs/start/

Files:

  • docs/start/framework/react/guide/databases.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Preview
🔇 Additional comments (1)
docs/start/framework/react/guide/databases.md (1)

23-33: All API patterns verified and correct.

The examples match the current Server Functions API:

  • .handler() syntax is correct
  • { method: 'POST' } option format is correct
  • Parameter names context and data are the current API conventions
  • Handler receiving only context or only data (depending on availability) is a valid pattern

Confirmed by test files showing handler signatures like .handler(({ data, context }) => {...}), and documentation examples across the codebase using these same patterns consistently.


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.

@nx-cloud
Copy link

nx-cloud bot commented Nov 1, 2025

View your CI Pipeline Execution ↗ for commit 03c8a11

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded <1s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 2s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-01 05:46:44 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 1, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5716

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5716

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5716

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5716

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5716

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5716

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5716

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5716

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5716

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5716

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5716

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5716

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5716

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5716

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5716

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5716

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5716

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5716

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5716

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5716

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5716

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5716

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5716

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@5716

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5716

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5716

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5716

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5716

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5716

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5716

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5716

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5716

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5716

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5716

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5716

commit: 03c8a11

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

Labels

documentation Everything documentation related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant