Skip to content
Source
Sign inSign up
TanStack/router

fix(start-server-core): use public h3 api .res #5975

Closedbirkskyum(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromfix(start-server-core)--use-public-h3-apiopened

forward compat, since ._res is removed in next release (2.0.0-rc.1) of h3

Summary by CodeRabbit

  • Bug Fixes
    • Corrected response handling to use framework standard properties.
    • Improved server function response property access patterns.
✏️ Tip: You can customize this high-level summary in your review settings.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: start-server-core

    2. Walkthrough

      The pull request modifies internal property access patterns in the start-server-core package. Changes include switching the response object retrieval to use the public H3 event property (event.res instead of event._res) and removing optional chaining operators from response property accesses (response.status and response.statusText), replacing them with direct property access across multiple response construction sites.

      Changes

      Cohort / File(s)Summary
      Property Access Updates
      packages/start-server-core/src/request-response.ts
      Changed getResponse() to return event.res (public H3 property) instead of event._res (private property)
      Response Property Access
      packages/start-server-core/src/server-functions-handler.ts
      Replaced optional chaining operators on response properties (response?.status, response?.statusText) with direct property access (response.status, response.statusText) across multiple response construction sites

      Estimated code review effort

      🎯 2 (Simple) | ⏱️ ~12 minutes

      • Specific areas requiring attention:
        • Verify that response is guaranteed to be defined at all sites where optional chaining was removed in server-functions-handler.ts, particularly in error handling and streaming paths
        • Confirm that event.res is always populated and behaves identically to event._res across all H3 event scenarios
        • Check that no edge cases exist where response could be null or undefined when the new direct property access is invoked
      • TanStack/router#5959: Directly related—applies identical changes to both files (getResponse() and response property access patterns)
      • TanStack/router#5370: Related through shared modification of request-response.ts and H3 event property handling
      • TanStack/router#5973: Related but implements opposite changes to the same target functions and properties

      Poem

      🐰 A hop through the code, so neat and so fine, From private to public, the properties align! Optional chains now gone with a bound, Direct access rings clear, a confident sound! H3 events shine bright in their proper domain, ✨

      Pre-merge checks and finishing touches

      ✅ Passed checks (3 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title accurately describes the main change: switching from private H3 event property (_res) to the public API property (res) in start-server-core.
      Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
      Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      ✨ Finishing touches
      • 📝 Generate docstrings
        🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Post copyable unit tests in a comment
      • Commit unit tests in branch `fix(start-server-core)--use-public-h3-api`

      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.
    3. View your CI Pipeline Execution ↗ for commit 791924ad69366c43ab140c93f1eacddf2e1a16d6

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded7m 3sView ↗
      nx run-many --target=build --exclude=examples/*...✅ Succeeded23sView ↗

      ☁️ Nx Cloud last updated this comment at 2025-11-26 15:40:08 UTC

    4. More templates

      @tanstack/arktype-adapter

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

      @tanstack/directive-functions-plugin

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

      @tanstack/eslint-plugin-router

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

      @tanstack/history

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

      @tanstack/nitro-v2-vite-plugin

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

      @tanstack/react-router

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

      @tanstack/react-router-devtools

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

      @tanstack/react-router-ssr-query

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

      @tanstack/react-start

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

      @tanstack/react-start-client

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

      @tanstack/react-start-server

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

      @tanstack/router-cli

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

      @tanstack/router-core

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

      @tanstack/router-devtools

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

      @tanstack/router-devtools-core

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

      @tanstack/router-generator

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

      @tanstack/router-plugin

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

      @tanstack/router-ssr-query-core

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

      @tanstack/router-utils

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

      @tanstack/router-vite-plugin

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

      @tanstack/server-functions-plugin

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

      @tanstack/solid-router

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

      @tanstack/solid-router-devtools

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

      @tanstack/solid-router-ssr-query

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

      @tanstack/solid-start

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

      @tanstack/solid-start-client

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

      @tanstack/solid-start-server

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

      @tanstack/start-client-core

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

      @tanstack/start-plugin-core

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

      @tanstack/start-server-core

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

      @tanstack/start-static-server-functions

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

      @tanstack/start-storage-context

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

      @tanstack/valibot-adapter

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

      @tanstack/virtual-file-routes

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

      @tanstack/zod-adapter

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

      commit: 791924a

Sign in to join this conversation.