Skip to content

Conversation

schiller-manuel
Copy link
Contributor

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

this depends on h3js/srvx#122

after this is merged and released, srvx must be bumped here

Summary by CodeRabbit

  • New Features
    • Added a Cloudflare Workers configuration scaffold to the React start-basic example for easier deployment.
  • Refactor
    • Simplified server function APIs by removing the explicit AbortSignal parameter and related abort wiring.
  • Tests
    • Consolidated and parameterized server-function tests across GET/POST methods for clearer coverage.
  • Chores
    • Updated build tooling/dev dependencies across multiple example and e2e projects to the latest compatible versions.
    • Adjusted snapshot-cleanup script to more reliably remove snapshot artifacts.

Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Walkthrough

Removes AbortSignal propagation from server function plumbing: updates createServerFn API and codegen to drop signal, adjusts server handler to stop wiring request abort signals, and updates related tests and an e2e route/spec. Also bumps srvx versions across e2e packages, tweaks a plugin script, and adds a Wrangler config scaffold.

Changes

Cohort / File(s) Summary
React e2e srvx bump
e2e/react-start/*/package.json
DevDependency srvx updated from ^0.8.6 to ^0.8.16 across React-based e2e apps.
Solid e2e srvx bump
e2e/solid-start/*/package.json
DevDependency srvx updated from ^0.8.6 to ^0.8.16 across Solid-based e2e apps.
Server function API (client core)
packages/start-client-core/src/createServerFn.ts, packages/start-client-core/src/tests/createServerFn.test-d.ts
Removes signal from ServerFnCtx and __executeServer signature; updates type tests accordingly.
Server function handler (server core)
packages/start-server-core/src/server-functions-handler.ts
Removes request AbortController wiring and stops passing signal to actions.
Plugin: createServerFn codegen
packages/start-plugin-core/src/create-server-fn-plugin/handleCreateServerFn.ts
Generated server function now calls __executeServer(opts) without signal.
Plugin tests and snapshots
packages/start-plugin-core/tests/...createServerFn...
Updates handlers from (opts, signal) to (opts) and drops signal in __executeServer calls across client/server snapshots and tests.
Plugin package config
packages/start-plugin-core/package.json
Changes clean:snapshots glob to **/*snapshots*; bumps dependency srvx to ^0.8.16.
E2E route and tests (server functions)
e2e/react-start/server-functions/src/routes/abort-signal.tsx, e2e/react-start/server-functions/tests/server-functions.spec.ts
Refactors route to method-specific GET/POST handlers using createServerOnlyFn/getRequest; parameterizes tests over methods and updates test IDs.
Example config
examples/react/start-basic/wrangler.jsonc
Adds Cloudflare Wrangler config scaffold with comments and observability enabled.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant C as Client App
  participant SF as ServerFn (client wrapper)
  participant H as Server Handler
  participant A as Action (handler)

  U->>C: Trigger server function
  C->>SF: call fn(opts)
  SF->>H: HTTP request (opts)
  Note over SF,H: No AbortSignal is created or forwarded
  H->>A: action(opts)
  A-->>H: result | error
  H-->>SF: HTTP response
  SF-->>C: resolve/reject
  C-->>U: render outcome
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • fix: basepath #5345 — Touches the same server-functions handler area, refactoring sanitization/regex; overlaps file and responsibility.
  • feat: serverfn abstraction #5040 — Modifies server-function plumbing (createServerFn, __executeServer, plugin codegen) similar to this PR’s API/signature changes.

Suggested reviewers

  • chorobin

Poem

I nibbled the threads where signals once ran,
Snipped tidy paths, a clean little plan.
GET and POST hop in two neat lines,
Snapshots swept where moonlight shines.
With wrangler burrows mapped just right—
Ship it swift, then carrot delight! 🥕✨

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 title ‘fix: do not pass signal into server function’ clearly conveys the primary change of the PR, which is removing the signal parameter from server function invocations. It is concise, specific, and uses an imperative tone that aligns with conventional commit style. This phrasing makes the intent of the change immediately clear to reviewers and future readers.
✨ 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-signal

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

Copy link

nx-cloud bot commented Oct 14, 2025

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit 6a36d34

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ❌ Failed 2m 27s View ↗
nx run-many --target=build --exclude=examples/*... ❌ Failed 54s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-14 00:18:55 UTC

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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/start-client-core/src/createServerFn.ts (1)

132-155: Fix the __executeServer contract after dropping signal.

The runtime now calls __executeServer(opts) with no signal, but FetcherBase['__executeServer'] still requires { signal: AbortSignal }. Any TS consumer (including the plugin-generated stubs) will fail type-checking because opts no longer has that property. Please drop the signal field (or make it optional) in the FetcherBase signature to keep the public types aligned with the new behavior.

 export interface FetcherBase {
   [TSS_SERVER_FUNCTION]: true
   url: string
-  __executeServer: (opts: {
-    method: Method
-    data: unknown
-    headers?: HeadersInit
-    context?: any
-    signal: AbortSignal
-  }) => Promise<unknown>
+  __executeServer: (opts: {
+    method: Method
+    data: unknown
+    headers?: HeadersInit
+    context?: any
+  }) => Promise<unknown>
 }

Also applies to: 258-264

🧹 Nitpick comments (1)
e2e/react-start/server-functions/src/routes/abort-signal.tsx (1)

42-106: LGTM!

The Test component correctly implements method-specific testing with proper state management, abort scenarios, and error handling. The method-specific test IDs (run-with-abort-btn-${method}, result-${method}, etc.) align well with e2e test expectations.

The union type for the fn prop (line 47) works correctly since both handlers wrap the same underlying function. If desired, you could define a common type alias for cleaner typing, but this is optional.

Optional: Consider extracting a common type for the server function.

For improved type clarity, you could define a common type:

+type AbortableServerFn = typeof abortableServerFnPost
+
 function Test({
   method,
   fn,
 }: {
   method: string
-  fn: typeof abortableServerFnPost | typeof abortableServerFnGet
+  fn: AbortableServerFn
 }) {

However, this is a minor improvement and the current approach is acceptable.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5436818 and 6a36d34.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (40)
  • e2e/react-start/basic-react-query/package.json (1 hunks)
  • e2e/react-start/basic-tsr-config/package.json (1 hunks)
  • e2e/react-start/basic/package.json (1 hunks)
  • e2e/react-start/custom-basepath/package.json (1 hunks)
  • e2e/react-start/scroll-restoration/package.json (1 hunks)
  • e2e/react-start/selective-ssr/package.json (1 hunks)
  • e2e/react-start/serialization-adapters/package.json (1 hunks)
  • e2e/react-start/server-functions/package.json (1 hunks)
  • e2e/react-start/server-functions/src/routes/abort-signal.tsx (3 hunks)
  • e2e/react-start/server-functions/tests/server-functions.spec.ts (1 hunks)
  • e2e/react-start/server-routes/package.json (1 hunks)
  • e2e/react-start/virtual-routes/package.json (1 hunks)
  • e2e/react-start/website/package.json (1 hunks)
  • e2e/solid-start/basic-tsr-config/package.json (1 hunks)
  • e2e/solid-start/basic/package.json (1 hunks)
  • e2e/solid-start/custom-basepath/package.json (1 hunks)
  • e2e/solid-start/scroll-restoration/package.json (1 hunks)
  • e2e/solid-start/selective-ssr/package.json (1 hunks)
  • e2e/solid-start/server-functions/package.json (1 hunks)
  • e2e/solid-start/server-routes/package.json (1 hunks)
  • e2e/solid-start/website/package.json (1 hunks)
  • examples/react/start-basic/wrangler.jsonc (1 hunks)
  • packages/start-client-core/src/createServerFn.ts (1 hunks)
  • packages/start-client-core/src/tests/createServerFn.test-d.ts (0 hunks)
  • packages/start-plugin-core/package.json (2 hunks)
  • packages/start-plugin-core/src/create-server-fn-plugin/handleCreateServerFn.ts (1 hunks)
  • packages/start-plugin-core/tests/createServerFn/createServerFn.test.ts (4 hunks)
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (1 hunks)
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx (1 hunks)
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx (1 hunks)
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx (1 hunks)
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsx (1 hunks)
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/isomorphic-fns.tsx (1 hunks)
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsx (2 hunks)
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsx (2 hunks)
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsx (3 hunks)
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnValidator.tsx (1 hunks)
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/factory.tsx (1 hunks)
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/isomorphic-fns.tsx (1 hunks)
  • packages/start-server-core/src/server-functions-handler.ts (3 hunks)
💤 Files with no reviewable changes (1)
  • packages/start-client-core/src/tests/createServerFn.test-d.ts
🧰 Additional context used
📓 Path-based instructions (6)
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Use workspace:* protocol for internal dependencies in package.json files

Files:

  • e2e/react-start/serialization-adapters/package.json
  • e2e/solid-start/selective-ssr/package.json
  • e2e/solid-start/server-functions/package.json
  • e2e/react-start/custom-basepath/package.json
  • e2e/react-start/basic-tsr-config/package.json
  • e2e/solid-start/scroll-restoration/package.json
  • e2e/solid-start/website/package.json
  • e2e/react-start/basic-react-query/package.json
  • e2e/solid-start/basic/package.json
  • e2e/solid-start/custom-basepath/package.json
  • e2e/solid-start/basic-tsr-config/package.json
  • e2e/react-start/selective-ssr/package.json
  • packages/start-plugin-core/package.json
  • e2e/react-start/server-functions/package.json
  • e2e/react-start/basic/package.json
  • e2e/react-start/server-routes/package.json
  • e2e/react-start/virtual-routes/package.json
  • e2e/react-start/scroll-restoration/package.json
  • e2e/react-start/website/package.json
  • e2e/solid-start/server-routes/package.json
e2e/**

📄 CodeRabbit inference engine (AGENTS.md)

Store end-to-end tests under the e2e/ directory

Files:

  • e2e/react-start/serialization-adapters/package.json
  • e2e/solid-start/selective-ssr/package.json
  • e2e/solid-start/server-functions/package.json
  • e2e/react-start/custom-basepath/package.json
  • e2e/react-start/basic-tsr-config/package.json
  • e2e/solid-start/scroll-restoration/package.json
  • e2e/solid-start/website/package.json
  • e2e/react-start/basic-react-query/package.json
  • e2e/solid-start/basic/package.json
  • e2e/solid-start/custom-basepath/package.json
  • e2e/solid-start/basic-tsr-config/package.json
  • e2e/react-start/selective-ssr/package.json
  • e2e/react-start/server-functions/tests/server-functions.spec.ts
  • e2e/react-start/server-functions/package.json
  • e2e/react-start/basic/package.json
  • e2e/react-start/server-routes/package.json
  • e2e/react-start/virtual-routes/package.json
  • e2e/react-start/scroll-restoration/package.json
  • e2e/react-start/website/package.json
  • e2e/solid-start/server-routes/package.json
  • e2e/react-start/server-functions/src/routes/abort-signal.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnValidator.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsx
  • e2e/react-start/server-functions/tests/server-functions.spec.ts
  • packages/start-plugin-core/tests/createServerFn/createServerFn.test.ts
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx
  • packages/start-plugin-core/src/create-server-fn-plugin/handleCreateServerFn.ts
  • packages/start-client-core/src/createServerFn.ts
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/factory.tsx
  • packages/start-server-core/src/server-functions-handler.ts
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/isomorphic-fns.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/isomorphic-fns.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsx
  • e2e/react-start/server-functions/src/routes/abort-signal.tsx
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/tests/createServerFn/snapshots/client/createServerFnValidator.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnValidator.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsx
  • packages/start-plugin-core/package.json
  • packages/start-plugin-core/tests/createServerFn/createServerFn.test.ts
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx
  • packages/start-plugin-core/src/create-server-fn-plugin/handleCreateServerFn.ts
  • packages/start-client-core/src/createServerFn.ts
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/factory.tsx
  • packages/start-server-core/src/server-functions-handler.ts
  • packages/start-plugin-core/tests/createServerFn/snapshots/server/isomorphic-fns.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/isomorphic-fns.tsx
  • packages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsx
examples/{react,solid}/**

📄 CodeRabbit inference engine (AGENTS.md)

Keep example applications under examples/react/ and examples/solid/

Files:

  • examples/react/start-basic/wrangler.jsonc
**/src/routes/**

📄 CodeRabbit inference engine (AGENTS.md)

Place file-based routes under src/routes/ directories

Files:

  • e2e/react-start/server-functions/src/routes/abort-signal.tsx
🧬 Code graph analysis (13)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx (3)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (1)
  • withUseServer (2-8)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx (1)
  • withUseServer (2-8)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx (1)
  • withUseServer (2-8)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx (3)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (4)
  • withUseServer (2-8)
  • withoutUseServer (23-29)
  • withVariable (30-36)
  • withZodValidator (37-43)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx (4)
  • withUseServer (2-8)
  • withoutUseServer (9-15)
  • withVariable (16-22)
  • withZodValidator (23-29)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx (1)
  • withUseServer (2-8)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnValidator.tsx (7)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (1)
  • withUseServer (2-8)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx (1)
  • withUseServer (2-8)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx (1)
  • withUseServer (2-8)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx (1)
  • withUseServer (2-8)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsx (1)
  • withUseServer (3-13)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsx (1)
  • withUseServer (3-13)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsx (1)
  • withUseServer (3-15)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsx (8)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (7)
  • withUseServer (2-8)
  • withArrowFunction (9-15)
  • withArrowFunctionAndFunction (16-22)
  • withoutUseServer (23-29)
  • withVariable (30-36)
  • withZodValidator (37-43)
  • withValidatorFn (44-50)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx (4)
  • withUseServer (2-8)
  • withoutUseServer (9-15)
  • withVariable (16-22)
  • withZodValidator (23-29)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx (4)
  • withUseServer (2-8)
  • withoutUseServer (9-15)
  • withVariable (16-22)
  • withZodValidator (23-29)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx (1)
  • withUseServer (2-8)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsx (4)
  • withUseServer (3-13)
  • withoutUseServer (14-24)
  • withVariable (25-31)
  • withZodValidator (42-52)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsx (4)
  • withUseServer (3-15)
  • withoutUseServer (16-26)
  • withVariable (27-33)
  • withZodValidator (44-54)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnValidator.tsx (1)
  • withUseServer (3-11)
packages/start-client-core/src/createServerFn.ts (1)
  • createServerFn (49-169)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsx (3)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsx (2)
  • withUseServer (3-13)
  • withVariable (39-45)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsx (2)
  • withUseServer (3-13)
  • withVariable (25-31)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnValidator.tsx (1)
  • withUseServer (3-11)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsx (2)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (1)
  • withUseServer (2-8)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsx (1)
  • withUseServer (3-13)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx (2)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (1)
  • withUseServer (2-8)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsx (1)
  • withUseServer (3-15)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (1)
packages/start-client-core/src/createServerFn.ts (1)
  • createServerFn (49-169)
packages/start-plugin-core/tests/createServerFn/snapshots/server/factory.tsx (1)
packages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsx (3)
  • myAuthedFn (26-30)
  • createAuthServerFn (24-24)
  • deleteUserFn (31-35)
packages/start-plugin-core/tests/createServerFn/snapshots/server/isomorphic-fns.tsx (1)
packages/start-client-core/src/createServerFn.ts (1)
  • createServerFn (49-169)
packages/start-plugin-core/tests/createServerFn/snapshots/client/isomorphic-fns.tsx (1)
packages/start-client-core/src/createServerFn.ts (1)
  • createServerFn (49-169)
packages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsx (1)
packages/start-plugin-core/tests/createServerFn/snapshots/server/factory.tsx (3)
  • myAuthedFn (26-32)
  • createAuthServerFn (24-24)
  • deleteUserFn (33-39)
e2e/react-start/server-functions/src/routes/abort-signal.tsx (2)
packages/start-server-core/src/request-response.ts (1)
  • getRequest (72-75)
packages/start-client-core/src/createServerFn.ts (1)
  • createServerFn (49-169)
⏰ 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 (27)
e2e/solid-start/basic-tsr-config/package.json (1)

23-23: Confirm srvx release availability.

The PR description mentions waiting for h3js/srvx#122 to release before bumping the dependency. Please hold merging until srvx@^0.8.16 is actually published; otherwise installs for this package will fail.

e2e/solid-start/selective-ssr/package.json (1)

22-22: Confirm srvx 0.8.16 availability before merge

Please make sure srvx@^0.8.16 has been published before landing this; otherwise installs will fail. This PR depends on that upstream release, so let’s double-check the package is live.

e2e/solid-start/scroll-restoration/package.json (1)

31-31: srvx@0.8.16 is published — no further action required

e2e/react-start/serialization-adapters/package.json (1)

30-31: Verified srvx@0.8.16 is published.

e2e/solid-start/custom-basepath/package.json (1)

28-28: srvx@0.8.16 is published on npm
Merging is safe.

examples/react/start-basic/wrangler.jsonc (1)

5-44: Config scaffold looks solid.

Nice, comprehensive Wrangler scaffold with sensible defaults and helpful pointers. 👍

e2e/solid-start/server-routes/package.json (1)

32-32: srvx@0.8.16 is published
npm registry confirms version 0.8.16 is available on npm.

e2e/react-start/server-functions/tests/server-functions.spec.ts (1)

273-319: LGTM! Well-structured parameterization.

The refactoring to parameterize the abort tests over HTTP methods ('get', 'post') reduces duplication and improves maintainability. The test logic correctly:

  • Uses method-specific test IDs that align with the updated UI components
  • Properly waits for network idle and selector visibility before assertions
  • Validates both success and abort scenarios with appropriate expectations

The leading semicolon on line 273 is a valid defensive pattern to prevent ASI issues.

e2e/react-start/server-functions/src/routes/abort-signal.tsx (3)

2-3: LGTM!

The new imports are correctly added to support the refactored signal handling pattern.


7-15: LGTM!

The route component cleanly separates POST and GET test scenarios, enabling independent verification of abort signal handling for each HTTP method.


39-41: LGTM!

The per-method handlers correctly wrap the shared abort logic, enabling independent testing of POST and GET requests. This pattern aligns with the PR's goal of refactoring signal handling.

packages/start-plugin-core/package.json (1)

29-29: LGTM! Script glob pattern corrected.

The glob pattern now correctly targets **/*snapshots* (plural), which better matches the actual snapshot directory/file naming convention.

packages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsx (1)

26-35: LGTM! Handler signatures correctly updated to remove signal parameter.

The compiled client-side handlers now accept a single opts parameter and pass only opts to __executeServer, consistent with the PR objective to remove AbortSignal propagation from server function plumbing.

packages/start-plugin-core/tests/createServerFn/createServerFn.test.ts (2)

76-96: LGTM! Test expectations correctly updated.

The inline snapshot expectations now reflect the new single-argument handler signature (opts) and single-argument __executeServer(opts) calls, consistent with the signal removal across the codebase.


117-157: LGTM! Test expectations consistently updated across all scenarios.

All test cases (exported/non-exported functions, client/server environments) now correctly expect the single-argument handler pattern, ensuring comprehensive test coverage for the new API shape.

packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx (1)

1-29: LGTM! Renamed import variant correctly updated.

All handlers in this destructured-rename test snapshot now use the single-argument (opts) signature and pass only opts to __executeServer, consistent with the signal removal refactor.

packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnValidator.tsx (1)

3-11: LGTM! Server-side validator snapshot correctly updated.

The server-side compiled output correctly shows the handler accepting a single opts parameter and forwarding it to __executeServer(opts), even when using input validation. The actual implementation function signature remains unchanged.

packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx (1)

1-29: LGTM! Star import variant correctly updated.

All handlers using the TanStackStart.createServerFn (star import) pattern now correctly use the single-argument signature and forward only opts to __executeServer.

packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (1)

1-50: LGTM! Comprehensive client-side snapshot correctly updated.

All handler variants (with/without use server directive, arrow functions, validators, etc.) consistently use the single-argument (opts) signature and call __executeServer(opts) without the signal parameter. This ensures comprehensive test coverage for the new API shape.

packages/start-plugin-core/tests/createServerFn/snapshots/client/isomorphic-fns.tsx (1)

5-14: LGTM! Isomorphic functions correctly updated.

The isomorphic server function wrappers (getServerEnv and getServerEcho) now correctly use the single-argument handler signature, ensuring consistency between regular server functions and isomorphic functions.

packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx (1)

4-7: LGTM! Handler signature updated consistently.

The handler signature and __executeServer call have been correctly updated to remove the signal parameter, aligning with the PR objective to remove signal propagation from server functions.

packages/start-plugin-core/tests/createServerFn/snapshots/server/factory.tsx (2)

26-29: LGTM! Factory function signatures updated correctly.

Both myAuthedFn and deleteUserFn have been updated to use the single-parameter handler signature, with corresponding updates to __executeServer calls.


33-36: Consistent update for deleteUserFn.

The changes mirror those in myAuthedFn, maintaining consistency across the factory pattern.

packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsx (1)

5-8: LGTM! All server function handlers updated consistently.

All seven server function definitions in this snapshot have been correctly updated to remove the signal parameter from both handler signatures and __executeServer invocations. The changes are consistent across functions with different patterns (arrow functions, validators, etc.).

Also applies to: 16-19, 23-26, 30-33, 41-44, 58-61, 69-72

packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsx (1)

5-8: LGTM! Star import variant updated correctly.

The snapshot correctly reflects the signal removal for the TanStackStart.createServerFn usage pattern. All handlers and __executeServer calls have been updated consistently.

Also applies to: 18-21, 29-32, 46-49

packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsx (1)

5-8: LGTM! Destructured rename variant updated correctly.

The snapshot shows correct signal removal for the renamed serverFn import pattern. Changes are consistent with other variants.

Also applies to: 16-19, 27-30, 44-47

packages/start-plugin-core/tests/createServerFn/snapshots/server/isomorphic-fns.tsx (1)

5-8: Confirm srvx bump & tests All package.json entries now reference srvx@^0.8.16; no signal-related TODOs or usage found in tests. Ensure all tests pass with the updated snapshots and verify that request cancellation still works as expected.

Comment on lines +18 to +37
const fn = createServerOnlyFn(async () => {
const request = getRequest()
const signal = request.signal
console.log('server function started', { signal })
return new Promise<string>((resolve, reject) => {
if (signal.aborted) {
return reject(new Error('Aborted before start'))
}
const timerId = setTimeout(() => {
console.log('server function finished')
resolve('server function result')
}, 1000)
const onAbort = () => {
clearTimeout(timerId)
console.log('server function aborted')
reject(new Error('Aborted'))
}
signal.addEventListener('abort', onAbort, { once: true })
})
})
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify request.signal availability after srvx dependency bump.

The abort handling logic is correct: early exit check, proper timeout cleanup, and { once: true } listener registration to prevent memory leaks. However, the code assumes request.signal is available via getRequest().

Since the PR description mentions this change depends on h3js/srvx#122, ensure the srvx dependency is bumped and that request.signal is properly exposed in the updated version.

Run the following script to verify the srvx version and check for related changes:


🏁 Script executed:

#!/bin/bash
# Verify srvx dependency version across the monorepo

echo "=== Checking srvx versions in package.json files ==="
fd -e json -x sh -c 'if grep -q "srvx" "$1"; then echo "$1:"; grep "srvx" "$1"; fi' sh {}

echo ""
echo "=== Searching for request.signal usage in codebase ==="
rg -n --type ts -C2 'request\.signal' -g '!node_modules'

Length of output: 3834


Bump srvx to a version that exposes request.signal
All package.json files remain at ^0.8.16, which doesn’t include the getRequest().signal change from h3js/srvx#122—update srvx to the released version that adds request.signal before merging.

🤖 Prompt for AI Agents
In e2e/react-start/server-functions/src/routes/abort-signal.tsx around lines 18
to 37, the code uses getRequest().signal but the repo's package.json still pins
srvx to ^0.8.16 which does not include the h3js/srvx#122 change; update the srvx
dependency in all package.json files to the released version that exposes
request.signal (e.g., bump to >=0.8.17 or the specific released version that
contains the PR), run package manager install to update lockfiles, and verify
the tests/build so the server function can access request.signal without runtime
errors.

"exsolve": "^1.0.7",
"pathe": "^2.0.3",
"srvx": "^0.8.2",
"srvx": "^0.8.16",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify that the upstream srvx PR is merged and released.

The PR description states this change depends on h3js/srvx#122 being merged and released. Ensure that:

  1. The srvx PR RL integration with RQ, RT #122 has been merged and version 0.8.16 (or higher) has been published
  2. The changes in srvx align with the signal removal in this PR
  3. There are no breaking changes or security advisories between 0.8.2 and 0.8.16

🌐 Web query:

What changes were made in srvx between version 0.8.2 and 0.8.16? Are there any breaking changes or security advisories?

💡 Result:

Which "srvx" project do you mean? (npm package / GitHub repo, R package, or something else). I can then fetch the changelog/releases and check for breaking changes or security advisories between 0.8.2 and 0.8.16.


🏁 Script executed:

#!/bin/bash
set -e
echo "Checking if PR #122 is merged:"
gh api repos/h3js/srvx/pulls/122 --jq .merged
echo "Checking if release v0.8.16 exists on GitHub:"
gh api repos/h3js/srvx/releases/tags/v0.8.16 --jq .tag_name
echo "Checking if version 0.8.16 is published on npm:"
npm view srvx@0.8.16 version

Length of output: 145


Upstream PR #122 isn’t merged; defer bump to srvx v0.8.16
Version 0.8.16 is published, but PR #122’s changes aren’t included upstream. Wait for that PR to merge and a new release before updating this dependency.

🤖 Prompt for AI Agents
In packages/start-plugin-core/package.json at line 79, the dependency was
updated to "srvx": "^0.8.16" but upstream PR #122 isn’t merged so that release
doesn’t include the required changes; revert this dependency change back to the
prior published version (restore the original version string that was in
package.json before the bump), add a short inline comment/TODO referencing
upstream PR #122 to retry the bump after it merges, and run your package manager
to update the lockfile (package-lock.json or yarn.lock) accordingly.

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.

1 participant