Skip to content

Conversation

@schiller-manuel
Copy link
Contributor

@schiller-manuel schiller-manuel commented Sep 30, 2025

Summary by CodeRabbit

  • New Features

    • Added "Nested Classes" demo links (SSR and Server Function), a server-backed page for nested data, and a reusable RenderNestedData component for consistent display.
  • Bug Fixes

    • Improved serialization adapter deduplication for more predictable behavior.
  • Tests

    • Added end-to-end checks validating nested data for both SSR and server-function flows.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 30, 2025

Walkthrough

Adds UI and route files to surface nested serialized data from SSR and a new server-function route; introduces a RenderNestedData component and tests; renames a parameter in dedupeSerializationAdapters; and stops propagating nested serialization adapters during plugin construction in the router-core serializer.

Changes

Cohort / File(s) Summary
Start client dedupe helper
packages/start-client-core/src/createStart.ts
Renamed dedupe parameter/loop identifier from plugins to serializationAdapters (naming-only change).
Router-core serializer transformer
packages/router-core/src/ssr/serializer/transformer.ts
Removed propagation/recursive construction of adapters from .extends; plugin creation no longer expands child adapters from serializationAdapter.extends.
E2E app — data view component
e2e/react-start/serialization-adapters/src/data.tsx
Added RenderNestedData React component that renders expected vs actual shout/whisper states for a NestedOuter instance.
E2E app — new server-function route
e2e/react-start/serialization-adapters/src/routes/server-function/nested.tsx
New server-function-backed route at /server-function/nested which defines a server fn returning nested data and renders RenderNestedData. Exports Route.
E2E app — SSR nested route update
e2e/react-start/serialization-adapters/src/routes/ssr/nested.tsx
Replaced inline rendering with RenderNestedData and removed manual state extraction.
E2E app — route registration / generated tree
e2e/react-start/serialization-adapters/src/routeTree.gen.ts
Added ServerFunctionNestedRoute import and constant; wired /server-function/nested into generated route maps, types, and root children.
E2E app — navigation links
e2e/react-start/serialization-adapters/src/routes/index.tsx
Added links to the new nested pages under SSR and Server Functions sections.
E2E tests
e2e/react-start/serialization-adapters/tests/app.spec.ts
Added checkNestedData helper; added test visiting /server-function/nested, triggering the server function, and validating nested data using the helper.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant B as Browser / E2E test
  participant R as RouteComponent (client)
  participant S as Server (createServerFn)
  participant U as RenderNestedData (UI)

  B->>R: Navigate to /server-function/nested
  R->>B: Render button + "waiting" UI
  B->>R: Click "call server function"
  R->>S: Invoke server fn -> makeNested()
  S-->>R: Return nested data (serialized)
  R->>U: Pass nested prop to RenderNestedData
  U-->>B: Render expected vs actual shout/whisper states
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • chorobin

Poem

I hop through routes and nested trees,
I fetch the server's whispered breeze.
I compare shout to gentle tone,
I tidy adapters, one by one.
A rabbit cheers: serialized and known 🐇✨

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 succinctly describes the primary change in the pull request—unsetting the extends field of serialization adapters after deduplication—which aligns with the core modification in the transformer logic, while ancillary renames and test additions support verifying this fix.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch unset-extends

📜 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 a2a3f9d and 4e42139.

📒 Files selected for processing (8)
  • e2e/react-start/serialization-adapters/src/data.tsx (1 hunks)
  • e2e/react-start/serialization-adapters/src/routeTree.gen.ts (8 hunks)
  • e2e/react-start/serialization-adapters/src/routes/index.tsx (2 hunks)
  • e2e/react-start/serialization-adapters/src/routes/server-function/nested.tsx (1 hunks)
  • e2e/react-start/serialization-adapters/src/routes/ssr/nested.tsx (2 hunks)
  • e2e/react-start/serialization-adapters/tests/app.spec.ts (3 hunks)
  • packages/router-core/src/ssr/serializer/transformer.ts (0 hunks)
  • packages/start-client-core/src/createStart.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/router-core/src/ssr/serializer/transformer.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • e2e/react-start/serialization-adapters/src/routes/ssr/nested.tsx
  • e2e/react-start/serialization-adapters/src/routes/server-function/nested.tsx
  • e2e/react-start/serialization-adapters/tests/app.spec.ts
  • e2e/react-start/serialization-adapters/src/data.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • packages/start-client-core/src/createStart.ts
  • e2e/react-start/serialization-adapters/src/routeTree.gen.ts
  • e2e/react-start/serialization-adapters/src/routes/index.tsx
packages/{*-start,start-*}/**

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • packages/start-client-core/src/createStart.ts
e2e/**

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • e2e/react-start/serialization-adapters/src/routeTree.gen.ts
  • e2e/react-start/serialization-adapters/src/routes/index.tsx
**/src/routes/**

📄 CodeRabbit inference engine (AGENTS.md)

Place file-based routes under src/routes/ directories

Files:

  • e2e/react-start/serialization-adapters/src/routes/index.tsx
🧬 Code graph analysis (2)
packages/start-client-core/src/createStart.ts (2)
packages/router-core/src/ssr/serializer/transformer.ts (1)
  • AnySerializationAdapter (137-137)
packages/router-core/src/index.ts (1)
  • AnySerializationAdapter (416-416)
e2e/react-start/serialization-adapters/src/routeTree.gen.ts (2)
e2e/react-start/basic/src/routeTree.gen.ts (1)
  • FileRoutesByTo (300-332)
e2e/react-router/js-only-file-based/src/routeTree.gen.js (1)
  • IndexRoute (30-34)
⏰ 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). (2)
  • GitHub Check: Preview
  • GitHub Check: Test
🔇 Additional comments (8)
packages/start-client-core/src/createStart.ts (1)

70-70: LGTM: Parameter rename improves clarity.

Renaming the parameter from plugins to serializationAdapters makes the function's purpose clearer and aligns with the actual type being processed.

Also applies to: 72-73

e2e/react-start/serialization-adapters/src/routes/index.tsx (2)

27-34: LGTM: SSR nested link correctly implemented.

The link to /ssr/nested is properly structured with a unique test ID (ssr-nested-link) and appropriate reloadDocument flag for SSR testing.


45-52: LGTM: Duplicate test ID issue resolved.

The test ID has been updated to server-functions-nested-link, which is now unique and resolves the previously flagged duplicate test ID issue.

e2e/react-start/serialization-adapters/src/routeTree.gen.ts (5)

16-16: LGTM: Import added for new nested route.

The import for ServerFunctionNestedRouteImport follows the same pattern as other route imports in this auto-generated file.


39-43: LGTM: Route definition follows correct pattern.

The ServerFunctionNestedRoute is correctly configured with the appropriate id, path, and parent route, consistent with other routes in this file.


51-75: LGTM: Type maps correctly updated.

The new route has been properly added to all relevant type maps (FileRoutesByFullPath, FileRoutesByTo, FileRoutesById) maintaining alphabetical ordering and consistency with existing routes.


142-148: LGTM: Module augmentation correctly includes new route.

The TypeScript module augmentation for @tanstack/react-router correctly registers the new route with all required metadata (id, path, fullPath, preLoaderRoute, parentRoute).


162-162: LGTM: Route added to children collection.

The ServerFunctionNestedRoute has been correctly added to the rootRouteChildren object, completing the route registration.


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

@nx-cloud
Copy link

nx-cloud bot commented Sep 30, 2025

View your CI Pipeline Execution ↗ for commit 4e42139

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

☁️ Nx Cloud last updated this comment at 2025-10-01 18:26:04 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 30, 2025

More templates

@tanstack/arktype-adapter

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

@tanstack/directive-functions-plugin

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: 4e42139

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

🧹 Nitpick comments (2)
packages/start-client-core/src/createStart.ts (2)

79-79: Consider documenting the mutation side-effect.

Setting extends = undefined is a deliberate mutation that prevents further propagation during deduplication. While this achieves the PR objective, the side-effect isn't immediately obvious from the function signature or name.

Consider adding a brief comment explaining why this mutation is necessary, for example:

      if (current.extends) {
        dedupeSerializationAdapters(deduped, current.extends)
      }
+     // Unset extends to prevent further propagation after deduplication
      current.extends = undefined

This would help future maintainers understand the intent.


68-82: Add documentation for the extends mutation in dedupeSerializationAdapters
This function intentionally clears each adapter’s extends property to prevent duplicate propagation—please add a JSDoc or inline comment clarifying that this side-effect is by design.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5269bd8 and a69d57c.

📒 Files selected for processing (1)
  • packages/start-client-core/src/createStart.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-client-core/src/createStart.ts
packages/{*-start,start-*}/**

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • packages/start-client-core/src/createStart.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). (2)
  • GitHub Check: Test
  • GitHub Check: Preview

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

🧹 Nitpick comments (1)
e2e/react-start/serialization-adapters/src/data.tsx (1)

161-205: Optional: Remove unnecessary block scope.

The extra block scope starting at line 162 is valid but unusual. Consider removing it for clarity.

Apply this diff:

 export function RenderNestedData({ nested }: { nested: NestedOuter }) {
-  {
-    const localData = makeNested()
+  const localData = makeNested()
+  const expectedShoutState = localData.inner.shout()
+  const expectedWhisperState = localData.whisper()
+  const shoutState = nested.inner.shout()
+  const whisperState = nested.whisper()
+
+  return (
     ...
-  }
+  )
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a69d57c and a2a3f9d.

📒 Files selected for processing (8)
  • e2e/react-start/serialization-adapters/src/data.tsx (1 hunks)
  • e2e/react-start/serialization-adapters/src/routeTree.gen.ts (8 hunks)
  • e2e/react-start/serialization-adapters/src/routes/index.tsx (2 hunks)
  • e2e/react-start/serialization-adapters/src/routes/server-function/nested.tsx (1 hunks)
  • e2e/react-start/serialization-adapters/src/routes/ssr/nested.tsx (2 hunks)
  • e2e/react-start/serialization-adapters/tests/app.spec.ts (3 hunks)
  • packages/router-core/src/ssr/serializer/transformer.ts (0 hunks)
  • packages/start-client-core/src/createStart.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/router-core/src/ssr/serializer/transformer.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/start-client-core/src/createStart.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • e2e/react-start/serialization-adapters/src/routes/index.tsx
  • e2e/react-start/serialization-adapters/tests/app.spec.ts
  • e2e/react-start/serialization-adapters/src/data.tsx
  • e2e/react-start/serialization-adapters/src/routes/server-function/nested.tsx
  • e2e/react-start/serialization-adapters/src/routes/ssr/nested.tsx
  • e2e/react-start/serialization-adapters/src/routeTree.gen.ts
**/src/routes/**

📄 CodeRabbit inference engine (AGENTS.md)

Place file-based routes under src/routes/ directories

Files:

  • e2e/react-start/serialization-adapters/src/routes/index.tsx
  • e2e/react-start/serialization-adapters/src/routes/server-function/nested.tsx
  • e2e/react-start/serialization-adapters/src/routes/ssr/nested.tsx
e2e/**

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • e2e/react-start/serialization-adapters/src/routes/index.tsx
  • e2e/react-start/serialization-adapters/tests/app.spec.ts
  • e2e/react-start/serialization-adapters/src/data.tsx
  • e2e/react-start/serialization-adapters/src/routes/server-function/nested.tsx
  • e2e/react-start/serialization-adapters/src/routes/ssr/nested.tsx
  • e2e/react-start/serialization-adapters/src/routeTree.gen.ts
🧬 Code graph analysis (3)
e2e/react-start/serialization-adapters/src/routes/server-function/nested.tsx (2)
e2e/react-start/serialization-adapters/src/data.tsx (3)
  • makeNested (120-122)
  • NestedOuter (91-96)
  • RenderNestedData (161-205)
e2e/react-start/serialization-adapters/src/routes/ssr/nested.tsx (1)
  • Route (4-14)
e2e/react-start/serialization-adapters/src/routes/ssr/nested.tsx (1)
e2e/react-start/serialization-adapters/src/data.tsx (1)
  • RenderNestedData (161-205)
e2e/react-start/serialization-adapters/src/routeTree.gen.ts (2)
e2e/react-start/server-functions/src/routeTree.gen.ts (1)
  • FileRoutesByTo (165-187)
e2e/react-router/js-only-file-based/src/routeTree.gen.js (1)
  • IndexRoute (30-34)
⏰ 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). (2)
  • GitHub Check: Preview
  • GitHub Check: Test
🔇 Additional comments (7)
e2e/react-start/serialization-adapters/src/routes/index.tsx (1)

27-30: LGTM: SSR nested link added correctly.

The new link properly navigates to the nested SSR route with appropriate test ID and reload behavior.

e2e/react-start/serialization-adapters/src/routes/ssr/nested.tsx (1)

1-14: LGTM: Clean refactor to shared rendering component.

The extraction of rendering logic to RenderNestedData follows DRY principles and maintains the same functionality while improving code reusability.

e2e/react-start/serialization-adapters/tests/app.spec.ts (2)

25-41: LGTM: Well-structured test helper.

The checkNestedData helper extracts common assertion logic and follows DRY principles, making the tests more maintainable.


101-111: LGTM: Server function nested test is comprehensive.

The test properly verifies the waiting state before triggering the server function and validates the nested data serialization after the response.

e2e/react-start/serialization-adapters/src/routes/server-function/nested.tsx (2)

7-9: LGTM: Server function correctly returns nested data.

The server function is properly defined and returns the nested data structure that will be serialized.


15-34: LGTM: Clean component implementation with proper state management.

The component correctly manages the async server function call, provides user feedback during the waiting state, and renders the nested data once available.

e2e/react-start/serialization-adapters/src/routeTree.gen.ts (1)

16-163: New nested route wiring is consistent.

Import, instance update, type unions, and module declaration all mirror the surrounding routes, so the generated typings stay aligned with the new /server-function/nested entry.

@schiller-manuel schiller-manuel merged commit f943abc into main Oct 1, 2025
6 checks passed
@schiller-manuel schiller-manuel deleted the unset-extends branch October 1, 2025 18:47
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.

2 participants