Skip to content

Conversation

@birkskyum
Copy link
Member

@birkskyum birkskyum commented Dec 17, 2025

Summary by CodeRabbit

Release Notes

  • Tests

    • Added comprehensive end-to-end test suite for serialization adapters covering SSR data scenarios, streaming routes, nested class handling, and server function execution.
  • Chores

    • Added project configuration files including Vite, TypeScript, Playwright, and PostCSS setup for the e2e test environment.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 17, 2025

Walkthrough

Introduces a complete Vue end-to-end test suite for serialization adapters. Adds project configuration, TanStack Router setup, multiple route modules testing SSR and server-function scenarios with custom error and data adapters, and Playwright tests validating serialization behavior across various data types and control flows.

Changes

Cohort / File(s) Summary
Configuration & Ignore Patterns
.gitignore, .prettierignore, tsconfig.json, vite.config.ts, postcss.config.mjs, playwright.config.ts, package.json
Project setup including dev/build configuration, path aliases, Playwright test server port resolution, Tailwind CSS integration, and package metadata with dependencies and test scripts.
Router & Start Setup
src/router.tsx, src/start.tsx, src/routeTree.gen.ts
Router factory, TanStack Start configuration with registered serialization adapters (foo, car, nested, custom error), and auto-generated route tree wiring all route modules.
Serialization Adapters & Data
src/CustomError.ts, src/data.tsx
CustomError class with serialization adapter, Foo and Car classes/interfaces with adapters, nested data structures (NestedOuter/NestedInner), and test data factories and render components.
Root & Index Routes
src/routes/__root.tsx, src/routes/index.tsx
Root route defining HTML head metadata, shell layout, and navigation; index route with Home component linking to SSR and server-function test scenarios.
SSR Routes
src/routes/ssr/data-only.tsx, src/routes/ssr/nested.tsx, src/routes/ssr/stream.tsx
Three SSR data-loading routes: data-only with eager loading, nested demonstrating class serialization, and stream with deferred promise-based data loading.
Server-Function Routes
src/routes/server-function/custom-error.tsx, src/routes/server-function/nested.tsx
Routes testing server function serialization: custom error handling with validation and error serialization, and nested class instance returns from server.
Styling & Tests
src/styles/app.css, tests/app.spec.ts
Tailwind v4 CSS with light/dark theme support and border normalization; Playwright e2e test suite validating SSR serialization, server-function execution, and nested state consistency.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas requiring extra attention:
    • Serialization adapter implementations in src/data.tsx and src/CustomError.ts — verify toSerializable/fromSerializable logic correctly handles all fields and edge cases
    • E2e test assertions in tests/app.spec.ts — confirm test selectors and data-validation checks align with component implementations
    • Route tree generation in routeTree.gen.ts — verify all route modules are correctly registered and typed
    • Server function definitions in server-function routes — ensure error handling and input validation schemas match expected behavior

Possibly related PRs

Suggested labels

ssr, package: start-server-core, package: start-client-core, package: start-static-server-functions

Suggested reviewers

  • brenelz
  • schiller-manuel

Poem

🐰 A Vue-ful quest through serialization's delight,
Routes nested, adapters working just right,
Custom errors dance with data so fine,
SSR streams and server code intertwine,
Tests catch the magic, bugs take their flight! ✨

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 accurately summarizes the main change: adding a new end-to-end test suite for Vue Router's serialization adapters functionality.
✨ 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 serialization-adapters-vue

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.

@nx-cloud
Copy link

nx-cloud bot commented Dec 17, 2025

View your CI Pipeline Execution ↗ for commit 0ed8ed9

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

☁️ Nx Cloud last updated this comment at 2025-12-17 18:18:16 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 17, 2025

More templates

@tanstack/arktype-adapter

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

@tanstack/directive-functions-plugin

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router@6126

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start@6126

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: 0ed8ed9

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

🧹 Nitpick comments (5)
e2e/vue-start/serialization-adapters/src/router.tsx (1)

4-11: Consider adding an explicit return type annotation.

While TypeScript can infer the return type, adding an explicit return type would improve code clarity and provide better IDE support.

Apply this diff to add a return type:

+import type { Router } from '@tanstack/vue-router'
+
-export function getRouter() {
+export function getRouter(): Router {
   const router = createRouter({
     routeTree,
     scrollRestoration: true,
   })

   return router
 }
e2e/vue-start/serialization-adapters/src/routes/server-function/nested.tsx (1)

18-27: Consider using async/await for cleaner async handling.

While the current .then() approach works, using async/await would make the async flow more readable and maintainable.

Apply this diff to use async/await:

         <button
           data-testid="server-function-trigger"
-          onClick={() =>
-            serverFnReturningNested().then(
-              (res) => (nestedResponse.value = res),
-            )
-          }
+          onClick={async () => {
+            const res = await serverFnReturningNested()
+            nestedResponse.value = res
+          }}
         >
           trigger
         </button>
e2e/vue-start/serialization-adapters/src/routes/server-function/custom-error.tsx (1)

22-23: Consider a more specific type for validResponse.

Using any reduces type safety. Since the server function returns 'Hello, world!' on success, this could be typed more precisely.

-    const validResponse = ref<any>(null)
+    const validResponse = ref<string | null>(null)
e2e/vue-start/serialization-adapters/src/routes/__root.tsx (1)

35-35: Consider typing the slots parameter for better type safety.

The slots parameter is typed as any, which bypasses TypeScript's type checking. For strict mode compliance, consider using a more specific type.

Apply this diff to improve type safety:

-function RootDocument(_: unknown, { slots }: { slots: any }) {
+function RootDocument(_: unknown, { slots }: { slots: { default?: () => any } }) {
e2e/vue-start/serialization-adapters/src/data.tsx (1)

161-205: Remove unnecessary block scope.

The function body is wrapped in an extra block scope starting at Line 162, which is redundant since the function body already provides the necessary scope.

Apply this diff to remove the unnecessary block:

 export function RenderNestedData({ nested }: { nested: NestedOuter }) {
-  {
-    const localData = makeNested()
-    const expectedShoutState = localData.inner.shout()
-    const expectedWhisperState = localData.whisper()
-    const shoutState = nested.inner.shout()
-    const whisperState = nested.whisper()
+  const localData = makeNested()
+  const expectedShoutState = localData.inner.shout()
+  const expectedWhisperState = localData.whisper()
+  const shoutState = nested.inner.shout()
+  const whisperState = nested.whisper()
 
-    return (
-      <div data-testid="data-only-container">
+  return (
+    <div data-testid="data-only-container">
       ...
-      </div>
-    )
-  }
+    </div>
+  )
 }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 751f0ff and 0ed8ed9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • e2e/vue-start/serialization-adapters/.gitignore (1 hunks)
  • e2e/vue-start/serialization-adapters/.prettierignore (1 hunks)
  • e2e/vue-start/serialization-adapters/package.json (1 hunks)
  • e2e/vue-start/serialization-adapters/playwright.config.ts (1 hunks)
  • e2e/vue-start/serialization-adapters/postcss.config.mjs (1 hunks)
  • e2e/vue-start/serialization-adapters/src/CustomError.ts (1 hunks)
  • e2e/vue-start/serialization-adapters/src/data.tsx (1 hunks)
  • e2e/vue-start/serialization-adapters/src/routeTree.gen.ts (1 hunks)
  • e2e/vue-start/serialization-adapters/src/router.tsx (1 hunks)
  • e2e/vue-start/serialization-adapters/src/routes/__root.tsx (1 hunks)
  • e2e/vue-start/serialization-adapters/src/routes/index.tsx (1 hunks)
  • e2e/vue-start/serialization-adapters/src/routes/server-function/custom-error.tsx (1 hunks)
  • e2e/vue-start/serialization-adapters/src/routes/server-function/nested.tsx (1 hunks)
  • e2e/vue-start/serialization-adapters/src/routes/ssr/data-only.tsx (1 hunks)
  • e2e/vue-start/serialization-adapters/src/routes/ssr/nested.tsx (1 hunks)
  • e2e/vue-start/serialization-adapters/src/routes/ssr/stream.tsx (1 hunks)
  • e2e/vue-start/serialization-adapters/src/start.tsx (1 hunks)
  • e2e/vue-start/serialization-adapters/src/styles/app.css (1 hunks)
  • e2e/vue-start/serialization-adapters/tests/app.spec.ts (1 hunks)
  • e2e/vue-start/serialization-adapters/tsconfig.json (1 hunks)
  • e2e/vue-start/serialization-adapters/vite.config.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode with extensive type safety for all code

Files:

  • e2e/vue-start/serialization-adapters/src/router.tsx
  • e2e/vue-start/serialization-adapters/src/start.tsx
  • e2e/vue-start/serialization-adapters/src/routes/server-function/custom-error.tsx
  • e2e/vue-start/serialization-adapters/src/routes/__root.tsx
  • e2e/vue-start/serialization-adapters/src/routes/server-function/nested.tsx
  • e2e/vue-start/serialization-adapters/vite.config.ts
  • e2e/vue-start/serialization-adapters/src/routes/ssr/stream.tsx
  • e2e/vue-start/serialization-adapters/tests/app.spec.ts
  • e2e/vue-start/serialization-adapters/src/routes/ssr/nested.tsx
  • e2e/vue-start/serialization-adapters/src/routes/index.tsx
  • e2e/vue-start/serialization-adapters/src/data.tsx
  • e2e/vue-start/serialization-adapters/src/CustomError.ts
  • e2e/vue-start/serialization-adapters/src/routeTree.gen.ts
  • e2e/vue-start/serialization-adapters/playwright.config.ts
  • e2e/vue-start/serialization-adapters/src/routes/ssr/data-only.tsx
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Implement ESLint rules for router best practices using the ESLint plugin router

Files:

  • e2e/vue-start/serialization-adapters/src/router.tsx
  • e2e/vue-start/serialization-adapters/src/start.tsx
  • e2e/vue-start/serialization-adapters/src/routes/server-function/custom-error.tsx
  • e2e/vue-start/serialization-adapters/src/routes/__root.tsx
  • e2e/vue-start/serialization-adapters/src/routes/server-function/nested.tsx
  • e2e/vue-start/serialization-adapters/vite.config.ts
  • e2e/vue-start/serialization-adapters/src/routes/ssr/stream.tsx
  • e2e/vue-start/serialization-adapters/tests/app.spec.ts
  • e2e/vue-start/serialization-adapters/src/routes/ssr/nested.tsx
  • e2e/vue-start/serialization-adapters/src/routes/index.tsx
  • e2e/vue-start/serialization-adapters/src/data.tsx
  • e2e/vue-start/serialization-adapters/src/CustomError.ts
  • e2e/vue-start/serialization-adapters/src/routeTree.gen.ts
  • e2e/vue-start/serialization-adapters/playwright.config.ts
  • e2e/vue-start/serialization-adapters/src/routes/ssr/data-only.tsx
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • e2e/vue-start/serialization-adapters/package.json
🧠 Learnings (10)
📓 Common learnings
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.
Learnt from: FatahChan
Repo: TanStack/router PR: 5475
File: e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx:8-0
Timestamp: 2025-10-14T18:59:33.990Z
Learning: In TanStack Router e2e test files, when a route parameter is validated at the route level (e.g., using zod in validateSearch or param validation), switch statements on that parameter do not require a default case, as the validation ensures only expected values will reach the switch.
📚 Learning: 2025-11-02T16:16:24.898Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5732
File: packages/start-client-core/src/client/hydrateStart.ts:6-9
Timestamp: 2025-11-02T16:16:24.898Z
Learning: In packages/start-client-core/src/client/hydrateStart.ts, the `import/no-duplicates` ESLint disable is necessary for imports from `#tanstack-router-entry` and `#tanstack-start-entry` because both aliases resolve to the same placeholder file (`fake-start-entry.js`) in package.json during static analysis, even though they resolve to different files at runtime.

Applied to files:

  • e2e/vue-start/serialization-adapters/package.json
  • e2e/vue-start/serialization-adapters/src/start.tsx
  • e2e/vue-start/serialization-adapters/.prettierignore
  • e2e/vue-start/serialization-adapters/src/routes/index.tsx
  • e2e/vue-start/serialization-adapters/tsconfig.json
  • e2e/vue-start/serialization-adapters/src/routeTree.gen.ts
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.

Applied to files:

  • e2e/vue-start/serialization-adapters/src/routes/server-function/custom-error.tsx
  • e2e/vue-start/serialization-adapters/src/routes/__root.tsx
  • e2e/vue-start/serialization-adapters/src/routes/ssr/stream.tsx
  • e2e/vue-start/serialization-adapters/tests/app.spec.ts
  • e2e/vue-start/serialization-adapters/src/routes/ssr/nested.tsx
  • e2e/vue-start/serialization-adapters/.prettierignore
  • e2e/vue-start/serialization-adapters/src/routes/index.tsx
  • e2e/vue-start/serialization-adapters/src/routeTree.gen.ts
  • e2e/vue-start/serialization-adapters/src/routes/ssr/data-only.tsx
📚 Learning: 2025-10-14T18:59:33.990Z
Learnt from: FatahChan
Repo: TanStack/router PR: 5475
File: e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx:8-0
Timestamp: 2025-10-14T18:59:33.990Z
Learning: In TanStack Router e2e test files, when a route parameter is validated at the route level (e.g., using zod in validateSearch or param validation), switch statements on that parameter do not require a default case, as the validation ensures only expected values will reach the switch.

Applied to files:

  • e2e/vue-start/serialization-adapters/src/routes/server-function/custom-error.tsx
  • e2e/vue-start/serialization-adapters/src/routes/__root.tsx
📚 Learning: 2025-12-17T02:17:47.423Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 6120
File: packages/router-generator/src/generator.ts:654-657
Timestamp: 2025-12-17T02:17:47.423Z
Learning: In `packages/router-generator/src/generator.ts`, pathless_layout routes must receive a `path` property when they have a `cleanedPath`, even though they are non-path routes. This is necessary because child routes inherit the path from their parent, and without this property, child routes would not have the correct full path at runtime.

Applied to files:

  • e2e/vue-start/serialization-adapters/src/routes/__root.tsx
  • e2e/vue-start/serialization-adapters/src/routes/ssr/nested.tsx
  • e2e/vue-start/serialization-adapters/src/routes/index.tsx
  • e2e/vue-start/serialization-adapters/src/routeTree.gen.ts
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{js,ts,tsx} : Implement ESLint rules for router best practices using the ESLint plugin router

Applied to files:

  • e2e/vue-start/serialization-adapters/src/routes/__root.tsx
  • e2e/vue-start/serialization-adapters/.prettierignore
  • e2e/vue-start/serialization-adapters/src/routes/index.tsx
  • e2e/vue-start/serialization-adapters/tsconfig.json
  • e2e/vue-start/serialization-adapters/src/routeTree.gen.ts
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Use file-based routing in `src/routes/` directories or code-based routing with route definitions

Applied to files:

  • e2e/vue-start/serialization-adapters/src/routes/ssr/nested.tsx
  • e2e/vue-start/serialization-adapters/src/routes/index.tsx
  • e2e/vue-start/serialization-adapters/src/routeTree.gen.ts
  • e2e/vue-start/serialization-adapters/src/routes/ssr/data-only.tsx
📚 Learning: 2025-10-01T18:31:35.420Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 5330
File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61
Timestamp: 2025-10-01T18:31:35.420Z
Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.

Applied to files:

  • e2e/vue-start/serialization-adapters/.prettierignore
  • e2e/vue-start/serialization-adapters/src/routeTree.gen.ts
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript strict mode with extensive type safety for all code

Applied to files:

  • e2e/vue-start/serialization-adapters/tsconfig.json
📚 Learning: 2025-10-09T12:59:14.842Z
Learnt from: hokkyss
Repo: TanStack/router PR: 5418
File: e2e/react-start/custom-identifier-prefix/public/site.webmanifest:2-3
Timestamp: 2025-10-09T12:59:14.842Z
Learning: In e2e test fixtures (files under e2e directories), empty or placeholder values in configuration files like site.webmanifest are acceptable and should not be flagged unless the test specifically validates those fields.

Applied to files:

  • e2e/vue-start/serialization-adapters/playwright.config.ts
🧬 Code graph analysis (8)
e2e/vue-start/serialization-adapters/src/start.tsx (2)
e2e/vue-start/serialization-adapters/src/data.tsx (3)
  • fooAdapter (29-34)
  • carAdapter (36-47)
  • nestedOuterAdapter (112-118)
e2e/vue-start/serialization-adapters/src/CustomError.ts (1)
  • customErrorAdapter (18-31)
e2e/vue-start/serialization-adapters/src/routes/server-function/custom-error.tsx (2)
packages/start-server-core/src/request-response.ts (1)
  • setResponseStatus (196-204)
e2e/vue-start/serialization-adapters/src/CustomError.ts (1)
  • CustomError (3-16)
e2e/vue-start/serialization-adapters/src/routes/__root.tsx (1)
packages/router-core/src/router.ts (1)
  • state (1088-1090)
e2e/vue-start/serialization-adapters/src/routes/server-function/nested.tsx (1)
e2e/vue-start/serialization-adapters/src/data.tsx (3)
  • makeNested (120-122)
  • NestedOuter (91-96)
  • RenderNestedData (161-205)
e2e/vue-start/serialization-adapters/src/routes/ssr/stream.tsx (1)
e2e/vue-start/serialization-adapters/src/data.tsx (2)
  • makeData (49-90)
  • RenderData (124-159)
e2e/vue-start/serialization-adapters/src/routes/ssr/nested.tsx (1)
e2e/vue-start/serialization-adapters/src/data.tsx (2)
  • makeNested (120-122)
  • RenderNestedData (161-205)
e2e/vue-start/serialization-adapters/src/routeTree.gen.ts (2)
e2e/vue-start/serialization-adapters/src/router.tsx (1)
  • getRouter (4-11)
e2e/vue-start/serialization-adapters/src/start.tsx (1)
  • startInstance (5-16)
e2e/vue-start/serialization-adapters/src/routes/ssr/data-only.tsx (1)
e2e/vue-start/serialization-adapters/src/data.tsx (2)
  • makeData (49-90)
  • RenderData (124-159)
🪛 Biome (2.1.2)
e2e/vue-start/serialization-adapters/src/routes/ssr/stream.tsx

[error] 31-31: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)

⏰ 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
🔇 Additional comments (23)
e2e/vue-start/serialization-adapters/.prettierignore (1)

1-4: LGTM!

The Prettier ignore patterns are appropriate. The configuration correctly excludes the autogenerated routeTree.gen.ts file from formatting, along with standard build artifacts, public directories, and lock files.

e2e/vue-start/serialization-adapters/postcss.config.mjs (1)

1-5: LGTM!

Standard PostCSS configuration for Tailwind CSS v4. The configuration is minimal and correct.

e2e/vue-start/serialization-adapters/tsconfig.json (1)

1-23: LGTM!

TypeScript configuration properly enables strict mode and sets up Vue JSX integration with appropriate compiler options. The path alias ~/* for ./src/* provides clean import paths throughout the project.

e2e/vue-start/serialization-adapters/src/styles/app.css (1)

1-38: LGTM!

Well-documented Tailwind CSS v4 compatibility layer. The border-color override and theme setup ensure consistent styling across light/dark modes, and the .using-mouse outline removal improves UX for mouse interactions.

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

1-34: LGTM!

Package configuration correctly uses the workspace:^ protocol for all internal TanStack dependencies, adhering to the coding guidelines. The dependency setup is appropriate for a Vue e2e test suite.

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

1-15: LGTM!

SSR route correctly implements the TanStack Vue Router pattern with beforeLoad preparing nested data, loader passing context, and the component consuming the loader data via Route.useLoaderData(). The .value access pattern is appropriate for Vue 3's reactivity system.

e2e/vue-start/serialization-adapters/src/start.tsx (1)

1-16: LGTM!

Start configuration correctly registers serialization adapters and enables SSR. The inline comment clearly documents the relationship between nestedOuterAdapter and nestedInnerAdapter through the extends mechanism.

e2e/vue-start/serialization-adapters/src/routes/server-function/nested.tsx (1)

7-9: LGTM!

Server function and component implementation follow Vue 3 and TanStack Router patterns correctly. The reactive state management with ref<NestedOuter>() and conditional rendering based on the server response are properly implemented.

Also applies to: 11-17, 29-37, 39-41

e2e/vue-start/serialization-adapters/vite.config.ts (1)

1-19: LGTM!

The Vite configuration is well-structured with proper plugin ordering and standard e2e test server setup at port 3000.

e2e/vue-start/serialization-adapters/src/routes/ssr/stream.tsx (1)

1-41: LGTM!

The SSR streaming route correctly implements async data loading with Suspense and Await. The Biome lint warning about children prop is a false positive—this is the idiomatic render-prop pattern for Vue JSX with TanStack's Await component, not a React anti-pattern.

e2e/vue-start/serialization-adapters/tests/app.spec.ts (1)

1-112: LGTM!

The test suite is well-structured with reusable helper functions for common assertions. The whitelist for 499 errors correctly aligns with the custom error test that sets this status code. Test coverage spans all the new SSR and server-function routes.

e2e/vue-start/serialization-adapters/src/routes/ssr/data-only.tsx (1)

1-51: LGTM!

The data-only SSR route correctly demonstrates the serialization adapter pattern by comparing server-generated data (loaderData) against client-generated data (localData). The honk() method comparison is a good test for verifying that class methods survive serialization/deserialization.

e2e/vue-start/serialization-adapters/src/routes/server-function/custom-error.tsx (1)

8-17: LGTM!

The server function correctly demonstrates custom error serialization with BigInt support. Setting a 499 status before throwing ensures the e2e test can whitelist this specific error response.

e2e/vue-start/serialization-adapters/playwright.config.ts (1)

1-34: LGTM!

The Playwright configuration follows established patterns for TanStack Router e2e tests. Dynamic port assignment via getTestServerPort ensures test isolation, and the reuseExistingServer toggle appropriately differs between CI and local development.

e2e/vue-start/serialization-adapters/src/routes/index.tsx (1)

1-57: LGTM!

The home route correctly uses reloadDocument={true} on all links to ensure full SSR page loads, which is essential for testing serialization adapters. The test IDs are well-structured and align with the e2e test selectors.

e2e/vue-start/serialization-adapters/src/routes/__root.tsx (2)

1-13: LGTM!

The imports are appropriate for a Vue e2e test using TanStack Router with Vite.


15-33: LGTM!

The root route configuration is well-structured with appropriate head metadata, shell component, and 404 handling.

e2e/vue-start/serialization-adapters/src/CustomError.ts (1)

3-16: LGTM!

The CustomError class correctly extends Error with proper prototype chain handling.

e2e/vue-start/serialization-adapters/src/data.tsx (5)

3-34: LGTM!

The Foo class and adapter implementation is clean and correct.


7-47: LGTM!

Excellent use of discriminated union pattern with the __type field. The adapter correctly serializes data properties while preserving methods through the makeCar factory.


49-90: LGTM!

The makeData() function provides comprehensive test coverage with various data structures (single instances, arrays, maps, and maps of arrays).


91-122: LGTM!

Excellent demonstration of nested serialization adapters using the extends feature. This shows how adapters can compose to handle nested object structures.


124-159: LGTM!

The RenderData component is well-structured for e2e testing with clear expected vs actual comparisons and appropriate test IDs.

Comment on lines +13 to +14
/public/build# Sentry Config File
.env.sentry-build-plugin
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 | 🟡 Minor

Fix inline comment syntax in .gitignore.

Line 13 mixes a path pattern with an inline comment. In .gitignore, # denotes a comment start, so this line would be treated as a single pattern rather than a path followed by metadata. Separate the comment onto its own line.

Apply this diff to fix the syntax:

-/public/build# Sentry Config File
+/public/build
+# Sentry Config File
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/public/build# Sentry Config File
.env.sentry-build-plugin
/public/build
# Sentry Config File
.env.sentry-build-plugin
🤖 Prompt for AI Agents
In e2e/vue-start/serialization-adapters/.gitignore around lines 13 to 14, fix
the inline comment by separating the path pattern and the comment: replace the
combined "/public/build# Sentry Config File" entry with a plain "/public/build"
line followed by a separate comment line starting with "#" (e.g. "# Sentry
Config File"), leaving the subsequent ".env.sentry-build-plugin" entry
unchanged.

Comment on lines +18 to +31
export const customErrorAdapter = createSerializationAdapter({
key: 'custom-error',
test: (v) => v instanceof CustomError,
toSerializable: ({ message, foo, bar }) => {
return {
message,
foo,
bar,
}
},
fromSerializable: ({ message, foo, bar }) => {
return new CustomError(message, { foo, bar })
},
})
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

Handle bigint serialization to prevent runtime errors.

The bar property is a bigint, which cannot be directly serialized to JSON. When the serialization system attempts to stringify the result of toSerializable, it will throw: "TypeError: Do not know how to serialize a BigInt".

Apply this diff to convert bigint to string for serialization:

 export const customErrorAdapter = createSerializationAdapter({
   key: 'custom-error',
   test: (v) => v instanceof CustomError,
   toSerializable: ({ message, foo, bar }) => {
     return {
       message,
       foo,
-      bar,
+      bar: bar.toString(),
     }
   },
-  fromSerializable: ({ message, foo, bar }) => {
-    return new CustomError(message, { foo, bar })
+  fromSerializable: ({ message, foo, bar }: { message: string; foo: string; bar: string }) => {
+    return new CustomError(message, { foo, bar: BigInt(bar) })
   },
 })
🤖 Prompt for AI Agents
In e2e/vue-start/serialization-adapters/src/CustomError.ts around lines 18 to
31, the adapter currently returns the bigint property `bar` directly which will
throw when JSON-stringified; update toSerializable to convert `bar` to a string
(e.g. String(bar) or bar.toString()), and update fromSerializable to convert the
serialized string back to a bigint using BigInt(serializedBar) before passing it
to the CustomError constructor so serialization and deserialization handle
bigint safely.

@birkskyum birkskyum merged commit d476a8b into main Dec 17, 2025
6 checks passed
@birkskyum birkskyum deleted the serialization-adapters-vue branch December 17, 2025 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants