Skip to content

Conversation

schiller-manuel
Copy link
Contributor

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

Summary by CodeRabbit

  • New Features
    • Added SSR support for serializing async generator streams to enable safer streaming renders.
  • Bug Fixes
    • Improved validation of async stream outputs during SSR to prevent serialization errors.
  • Documentation
    • Clarified behavior and expectations for SSR serialization of streaming data sources.
  • Chores
    • Strengthened internal validation paths to better handle complex async streaming scenarios during SSR.

Copy link
Contributor

coderabbitai bot commented Oct 4, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds type-level support for validating AsyncGenerator serializability in SSR. Introduces ValidateSerializableAsyncGenerator and updates ValidateSerializable to route AsyncGenerator types through this new validator, preserving existing Map and object-handling branches.

Changes

Cohort / File(s) Summary
SSR Serializer Type Validation
packages/router-core/src/ssr/serializer/transformer.ts
Added exported type ValidateSerializableAsyncGenerator<T, TSerializable> and extended ValidateSerializable<T, TSerializable> with an AsyncGenerator branch (between Map and object mapping) to validate yielded and return types of async generators.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • chorobin

Poem

I nibble types in moonlit code,
Yields and returns in tidy row—
Async streams now checked and whole,
My paws clap softly: off they go! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 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 main change of fixing type definitions for async generators, matching the addition of ValidateSerializableAsyncGenerator and updated conditional branches for AsyncGenerator in the serialization transformer.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 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 7e7f389 and 2aa1e07.

📒 Files selected for processing (1)
  • packages/router-core/src/ssr/serializer/transformer.ts (1 hunks)

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

Copy link

nx-cloud bot commented Oct 4, 2025

View your CI Pipeline Execution ↗ for commit 2aa1e07

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

☁️ Nx Cloud last updated this comment at 2025-10-04 20:39:38 UTC

Copy link

pkg-pr-new bot commented Oct 4, 2025

More templates

@tanstack/arktype-adapter

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

@tanstack/directive-functions-plugin

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: 7e7f389

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0d3bba8 and 7e7f389.

📒 Files selected for processing (1)
  • packages/router-core/src/ssr/serializer/transformer.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/router-core/src/ssr/serializer/transformer.ts
packages/router-core/**

📄 CodeRabbit inference engine (AGENTS.md)

Keep framework-agnostic core router logic in packages/router-core/

Files:

  • packages/router-core/src/ssr/serializer/transformer.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

@schiller-manuel schiller-manuel merged commit 271e1aa into main Oct 4, 2025
4 checks passed
@schiller-manuel schiller-manuel deleted the async-generators branch October 4, 2025 20:33
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