@remotion/cloudrun: Add type safety to stream variables#6964
@remotion/cloudrun: Add type safety to stream variables#6964JonnyBurger merged 2 commits intoremotion-dev:mainfrom
@remotion/cloudrun: Add type safety to stream variables#6964Conversation
Agent-Logs-Url: https://github.com/bhaktofmahakal/remotion/sessions/a3e87ebd-993e-4d9b-b923-283b0e830c4c Co-authored-by: bhaktofmahakal <113044681+bhaktofmahakal@users.noreply.github.com>
|
Reviewed PR #6964. Suggested parameterizing Task list (4/4 completed)
|
There was a problem hiding this comment.
The direction is right — Readable is the correct runtime type when responseType: 'stream' is used. One suggestion to avoid the as assertion entirely.
Big Pickle (free) | 𝕏
Changed from using `as Readable` type assertions to parameterizing the client.request<Readable>() call. This achieves the same type safety without explicit casting, as the generic type parameter properly types the response.data property. Addresses review feedback from PR remotion-dev#6964. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: bhaktofmahakal <113044681+bhaktofmahakal@users.noreply.github.com>
Changed from using `as Readable` type assertions to parameterizing the client.request<Readable>() call. This achieves the same type safety without explicit casting, as the generic type parameter properly types the response.data property. Addresses review feedback from PR remotion-dev#6964. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: bhaktofmahakal <113044681+bhaktofmahakal@users.noreply.github.com>
Review again |
|
Thank you! |

Summary
Replaced
anytype with properReadabletype for stream variables in Cloud Run rendering functions, addressing the TODO comment requesting type safety.Changes
Readableimport from'stream'in both filesconst stream: anytoconst stream: Readablewith proper type assertion// TODO: Add any sort of type safetycommentFiles Modified
packages/cloudrun/src/api/render-media-on-cloudrun.tspackages/cloudrun/src/api/render-still-on-cloudrun.tsTesting
bunx turbo run make --filter="@remotion/cloudrun"bun test src(8 tests)This change improves type safety and code maintainability without affecting runtime behavior.