Skip to content

docs(examples): added explicit async iterable typing to chat example#10131

Open
grzdev wants to merge 1 commit intoTanStack:mainfrom
grzdev:docs/examples-chat-async-typing
Open

docs(examples): added explicit async iterable typing to chat example#10131
grzdev wants to merge 1 commit intoTanStack:mainfrom
grzdev:docs/examples-chat-async-typing

Conversation

@grzdev
Copy link

@grzdev grzdev commented Feb 13, 2026

Changes

Added explicit AsyncIterable typing to the chat example stream function.

This improves type clarity and editor inference for the streamedQuery example
without changing runtime behavior.

Note

[x] This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Refactor
    • Enhanced type declarations for chat streaming responses to improve code reliability and maintainability.

@changeset-bot
Copy link

changeset-bot bot commented Feb 13, 2026

⚠️ No Changeset found

Latest commit: 5b3d377

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

A public type alias ChatStream is introduced as AsyncIterable<string>, and the chatAnswer function's return type is explicitly annotated with this type instead of relying on inference. The function implementation remains unchanged.

Changes

Cohort / File(s) Summary
Type annotation improvement
examples/react/chat/src/chat.ts
Added ChatStream type alias and explicit return type annotation to chatAnswer function for improved type clarity.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A type alias hops in to play,
Making ChatStream's path crystal clear today!
No logic bent, just clarity gained—
Type safety's march, now plainly explained. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (73 files):

⚔️ .gitignore (content)
⚔️ CONTRIBUTING.md (content)
⚔️ docs/community-resources.md (content)
⚔️ docs/framework/angular/guides/caching.md (content)
⚔️ docs/framework/angular/guides/mutation-options.md (content)
⚔️ docs/framework/react/guides/migrating-to-v5.md (content)
⚔️ docs/framework/react/guides/prefetching.md (content)
⚔️ docs/framework/react/guides/ssr.md (content)
⚔️ docs/reference/notifyManager.md (content)
⚔️ examples/react/algolia/package.json (content)
⚔️ examples/react/auto-refetching/package.json (content)
⚔️ examples/react/basic-graphql-request/package.json (content)
⚔️ examples/react/basic/package.json (content)
⚔️ examples/react/chat/package.json (content)
⚔️ examples/react/chat/src/chat.ts (content)
⚔️ examples/react/default-query-function/package.json (content)
⚔️ examples/react/devtools-panel/package.json (content)
⚔️ examples/react/eslint-legacy/package.json (content)
⚔️ examples/react/infinite-query-with-max-pages/package.json (content)
⚔️ examples/react/load-more-infinite-scroll/package.json (content)
⚔️ examples/react/nextjs-app-prefetching/.gitignore (content)
⚔️ examples/react/nextjs-app-prefetching/package.json (content)
⚔️ examples/react/nextjs-suspense-streaming/.gitignore (content)
⚔️ examples/react/nextjs-suspense-streaming/package.json (content)
⚔️ examples/react/nextjs/package.json (content)
⚔️ examples/react/offline/package.json (content)
⚔️ examples/react/optimistic-updates-cache/package.json (content)
⚔️ examples/react/optimistic-updates-ui/package.json (content)
⚔️ examples/react/pagination/package.json (content)
⚔️ examples/react/playground/package.json (content)
⚔️ examples/react/prefetching/package.json (content)
⚔️ examples/react/react-native/package.json (content)
⚔️ examples/react/react-router/package.json (content)
⚔️ examples/react/rick-morty/package.json (content)
⚔️ examples/react/shadow-dom/package.json (content)
⚔️ examples/react/simple/package.json (content)
⚔️ examples/react/star-wars/package.json (content)
⚔️ examples/react/suspense/package.json (content)
⚔️ examples/vue/basic/package.json (content)
⚔️ examples/vue/simple/package.json (content)
⚔️ integrations/react-next-14/.gitignore (content)
⚔️ integrations/react-next-15/.gitignore (content)
⚔️ integrations/react-next-16/.gitignore (content)
⚔️ labeler-config.yml (content)
⚔️ packages/angular-query-experimental/vite.config.ts (content)
⚔️ packages/angular-query-persist-client/vite.config.ts (content)
⚔️ packages/eslint-plugin-query/vite.config.ts (content)
⚔️ packages/preact-query/vite.config.ts (content)
⚔️ packages/query-async-storage-persister/vite.config.ts (content)
⚔️ packages/query-broadcast-client-experimental/vite.config.ts (content)
⚔️ packages/query-codemods/src/v5/keep-previous-data/utils/already-has-placeholder-data-property.cjs (content)
⚔️ packages/query-core/src/__tests__/focusManager.test.tsx (content)
⚔️ packages/query-core/src/__tests__/mutations.test.tsx (content)
⚔️ packages/query-core/src/thenable.ts (content)
⚔️ packages/query-core/vite.config.ts (content)
⚔️ packages/query-devtools/vite.config.ts (content)
⚔️ packages/query-persist-client-core/vite.config.ts (content)
⚔️ packages/query-sync-storage-persister/vite.config.ts (content)
⚔️ packages/react-query-devtools/vite.config.ts (content)
⚔️ packages/react-query-persist-client/vite.config.ts (content)
⚔️ packages/react-query/CHANGELOG.md (content)
⚔️ packages/react-query/package.json (content)
⚔️ packages/react-query/src/useQueries.ts (content)
⚔️ packages/react-query/vite.config.ts (content)
⚔️ packages/solid-query-devtools/vite.config.ts (content)
⚔️ packages/solid-query-persist-client/vite.config.ts (content)
⚔️ packages/solid-query/vite.config.ts (content)
⚔️ packages/vue-query-devtools/CHANGELOG.md (content)
⚔️ packages/vue-query-devtools/package.json (content)
⚔️ packages/vue-query-devtools/src/types.ts (content)
⚔️ packages/vue-query/vite.config.ts (content)
⚔️ pnpm-lock.yaml (content)
⚔️ tsconfig.json (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main change: adding explicit AsyncIterable typing to the chat example code.
Description check ✅ Passed The description covers the key aspects of the change and indicates it is docs-only with appropriate checkbox marking, though some template sections are not used.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch docs/examples-chat-async-typing
  • Post resolved changes as copyable diffs in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
examples/react/chat/src/chat.ts (1)

28-28: Nit: extra blank line.

There are two consecutive blank lines here. Consider removing one to keep consistent spacing.


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.

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.

1 participant