Skip to content
Source
Sign inSign up
TanStack/router

docs(start): explain response helper scope during SSR #8864

Openadityareddy-dev(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/8864/headopened

🎯 Changes

If a loader calls a server function during SSR and that function calls setResponseStatus, the whole page gets that status. Added a section on this, with a request middleware example that only changes the status for RPC calls.

Refs https://github.com/TanStack/router/issues/8834

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with the relevant test commands, or tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

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

      Latest commit: e552583734d30647be84f31cea64f0e6576edc12

      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

    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      The server-functions guide explains how response helpers used during SSR affect the document response. It also shows how request middleware can expose whether a request is a server-function RPC through context.

      Changes: SSR response guidance

      Layer / File(s)Summary
      Document response and RPC context
      docs/start/framework/react/guide/server-functions.md
      The guide explains how response helpers used by a server function during SSR affect the document response. It adds a request-middleware example that exposes whether a request is a server-function RPC through context. The guide distinguishes request middleware from function middleware and server-function handlers.

      Estimated code review effort: 1 (Trivial) | ~5 minutes

      Change: Other

      Possibly related issues

      • TanStack/router#8834: The guide documents the SSR response-context behavior described by this issue.

      Suggested labels: documentation

      Suggested reviewers: schiller-manuel

      Merge Risk: Minimal · up to e5525

      The documentation change is mergeable with no identified implementation or documentation risk.

      Pre-merge checks: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the documentation change about response helper scope during SSR.
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Description checkPassedThe description states the change (a loader calling a server function during SSR, where setResponseStatus applies the status to the whole page) and adds a request middleware example that scopes the st…
      Full details: Description check

      Explanation

      The description states the change (a loader calling a server function during SSR, where setResponseStatus applies the status to the whole page) and adds a request middleware example that scopes the status change to RPC calls. It links issue #8834. The checklist is complete, and the release impact box marks the change as docs/CI/dev-only. It follows the template structure. One gap: the template asks for an AI authorship disclosure, which the description does not include. The author ticked 'I fully understand the code... including any code generated with AI assistance', but the template's AI-authored rules ask for explicit disclosure of AI authorship. The description is otherwise complete and specific, so the check passes.

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

      Tip

      🎯 Customize your risk assessments

      Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

      ✅ Automatic approvals, with your rules

      Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

      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
      Recent review info
      Run configuration
      Commits

      Reviewing files that changed from the base of the PR and between 01fab5a6c8aed70d61d82c64bc344cbac66c240c and e552583734d30647be84f31cea64f0e6576edc12.

      Files selected for processing: 1
      • docs/start/framework/react/guide/server-functions.md

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

Sign in to join this conversation.