-
-
Notifications
You must be signed in to change notification settings - Fork 889
docs: realtime streams v2 #2673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
WalkthroughThis pull request adds a new Realtime Streams (Streams v2) documentation page at /tasks/streams and updates multiple docs to reference and align with Streams v2. Changes include promoting the new useRealtimeStream hook (SDK 4.1.0+), reworking backend streaming docs to emphasize reading/consuming streams with typed APIs, adding examples for piping, abort/cancellation, retries, and batching, and updating migration guidance from metadata.stream() to streams.pipe()/streams.define(). Navigation and overview pages were reflowed to multi-line arrays and now include the new tasks/streams entry. Estimated code review effort🎯 4 (Complex) | ⏱️ ~45-75 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (4)
⏰ 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)
🔇 Additional comments (12)
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. Comment |
There was a problem hiding this 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 (1)
docs/tasks/streams.mdx (1)
154-154: Minor: Self-referential link may cause confusion. Line 154 links to/tasks/streamswhile already on that page. Consider either removing this line (since readers are already on this documentation) or linking to a specific section like#defining-typed-streams-recommended.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
docs/docs.json(12 hunks)docs/guides/example-projects/batch-llm-evaluator.mdx(1 hunks)docs/realtime/backend/overview.mdx(1 hunks)docs/realtime/backend/streams.mdx(1 hunks)docs/realtime/overview.mdx(1 hunks)docs/realtime/react-hooks/streams.mdx(5 hunks)docs/runs/metadata.mdx(2 hunks)docs/tasks/streams.mdx(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: For Realtime subscriptions or React hooks, provide a Public Access Token and scope it appropriately (e.g., via TriggerAuthContext)
Applied to files:
docs/realtime/overview.mdxdocs/realtime/react-hooks/streams.mdx
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Define tasks using task({ id, run, ... }) with a unique id per project
Applied to files:
docs/realtime/react-hooks/streams.mdx
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Import Trigger.dev APIs from "trigger.dev/sdk/v3" when writing tasks or related utilities
Applied to files:
docs/realtime/react-hooks/streams.mdx
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use metadata API (metadata.current/get/set/append/stream, etc.) only inside run functions or lifecycle hooks
Applied to files:
docs/runs/metadata.mdx
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (11)
docs/guides/example-projects/batch-llm-evaluator.mdx (1)
47-51: Good deprecation guidance. The anchor link and migration note clearly guide users toward the neweruseRealtimeStreamhook (SDK 4.1.0+). The positioning right after the old hook mention is helpful.docs/realtime/backend/overview.mdx (1)
17-21: Clear backend-focused framing. The shift from "emit and consume" to "read and consume" correctly frames the backend's primary role. The note directing to/tasks/streamshelps users understand the full context of stream definitions.docs/realtime/overview.mdx (1)
21-21: Cohesive Streams v2 overview. The updated bullet header, description, and tri-part links (Learn more, React hooks, Backend) provide clear navigation to the new Streams documentation while emphasizing relevant use cases (AI/LLM outputs, progress).docs/docs.json (1)
13-76: Appropriate navigation structure. The addition oftasks/streamsin the "Writing tasks" group is well-positioned alongside metadata and before general task utilities. The multi-line array formatting improves readability and diff clarity.docs/runs/metadata.mdx (2)
267-274: Clear backward-compatible deprecation. The note clearly positionsmetadata.stream()as superseded by Streams v2 while preserving examples for existing code. The link to/tasks/streamsprovides the migration path.
445-445: Helpful migration hints. The inline comments guide developers to the v4.1+ alternative without removing working code, balancing clarity with backward compatibility.Also applies to: 452-452
docs/tasks/streams.mdx (2)
160-164: Verify option completeness inread()documentation. The example showstimeoutInSecondsandstartIndex, butdocs/realtime/backend/streams.mdxadditionally documents asignaloption forAbortControllersupport. Confirm whether this is intentional (different feature sets) or a documentation gap that should be addressed.
1-250: Excellent foundational documentation for Streams v2. The comprehensive structure—from enabling through migration—provides clear guidance. The "recommended" vs "direct" pattern distinction and emphasis on defined streams for type safety aligns well with SDK v4.1.0+ improvements. Multiple realistic examples (AI streaming, batching, retry logic) will help developers adopt the new API.docs/realtime/react-hooks/streams.mdx (2)
14-154: Strong promotion of useRealtimeStream as primary hook. The new section with comprehensive examples (basic, defined streams, AI responses) and full options documentation provides excellent guidance for new projects. The positioning beforeuseRealtimeRunWithStreamsclearly signals the recommended path.
158-162: Clear migration path for existing implementations. The note appropriately signals thatuseRealtimeRunWithStreamsis supported butuseRealtimeStreamis recommended, helping developers make informed choices without forcing a rewrite.docs/realtime/backend/streams.mdx (1)
1-413: Comprehensive backend reading patterns. The restructured documentation clearly prioritizes defined streams for type safety, provides thorough options documentation (including AbortController signals), and includes practical examples covering SSE, retries, and batch processing. This positions backend developers to consume Streams v2 effectively.
d5e9dd5 to
2943832
Compare
No description provided.