Skip to content

Conversation

schiller-manuel
Copy link
Contributor

@schiller-manuel schiller-manuel commented Oct 12, 2025

fixes #5412

Summary by CodeRabbit

  • Bug Fixes
    • Improved recognition of server function handlers and middleware when there’s whitespace between an object and its method call, ensuring transforms apply reliably across different formatting styles.
    • Reduces edge cases where formatted code might be skipped by the transform, leading to more consistent behavior during development and builds.

Copy link

nx-cloud bot commented Oct 12, 2025

View your CI Pipeline Execution ↗ for commit ecbafe6

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

☁️ Nx Cloud last updated this comment at 2025-10-12 21:23:56 UTC

Copy link
Contributor

coderabbitai bot commented Oct 12, 2025

Walkthrough

The include filter in the server function transform was updated to allow optional whitespace after the dot before method calls like handler and createMiddleware. No exported/public APIs changed. No control flow, error handling, or environment logic was modified.

Changes

Cohort / File(s) Summary of changes
Transform include filter update
packages/start-plugin-core/src/create-server-fn-plugin/plugin.ts
Relaxed include filter to match method calls with optional whitespace after the dot (e.g., . handler( and . createMiddleware(). No other logic changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitched my nose at dots and space,
A whisker’s gap in method’s place—
Now regex hops with lighter feet,
Through lines where dots and blanks may meet.
Thump-thump! The build goes on its way,
A tidy warren saves the day. 🥕✨

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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title concisely and accurately describes the primary change by indicating that the detection logic will now ignore whitespace when matching handler and createMiddleware calls, which aligns exactly with the implemented update to the include filter.
Linked Issues Check ✅ Passed The pull request updates the include filter regex to allow optional whitespace after the dot in handler and createMiddleware invocations, directly addressing the detection bug described in issue #5412 and fulfilling the linked issue’s coding requirement.
Out of Scope Changes Check ✅ Passed The only modification in this pull request is the adjustment of the regex include filter to match whitespace, and there are no unrelated code or file changes, so all edits remain within the scope of fixing the detection logic.
✨ 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-5412

📜 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 287a7e1 and ecbafe6.

📒 Files selected for processing (1)
  • packages/start-plugin-core/src/create-server-fn-plugin/plugin.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript in strict mode with extensive type safety across the codebase

Files:

  • packages/start-plugin-core/src/create-server-fn-plugin/plugin.ts
packages/{*-start,start-*}/**

📄 CodeRabbit inference engine (AGENTS.md)

Name and place Start framework packages under packages/-start/ or packages/start-/

Files:

  • packages/start-plugin-core/src/create-server-fn-plugin/plugin.ts
⏰ 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: Test
🔇 Additional comments (1)
packages/start-plugin-core/src/create-server-fn-plugin/plugin.ts (1)

88-88: LGTM! Correctly allows whitespace in method call detection.

The addition of \s* to both regex patterns properly handles formatted code where line breaks or spaces appear after the dot, such as:

createServerFn()
  .inputValidator(z.string())
  .handler(...)

This targeted fix should resolve the dev-mode error reported in issue #5412 where co-located server functions with zod validators weren't being detected correctly.

Please verify that this change resolves the original issue by testing with a co-located server function that uses zod as an inputValidator, as described in issue #5412. Confirm the error "Server function module export not resolved" no longer appears in development mode.


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

Copy link

pkg-pr-new bot commented Oct 12, 2025

More templates

@tanstack/arktype-adapter

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

@tanstack/directive-functions-plugin

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: ecbafe6

@schiller-manuel schiller-manuel merged commit 44bcbd9 into main Oct 12, 2025
6 checks passed
@schiller-manuel schiller-manuel deleted the fix-5412 branch October 12, 2025 21:30
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.

Server Function using inputValidator within zod in co-locate file route is error

1 participant