TS migration - #506
Conversation
|
a1649d1 to
7984f89
Compare
7984f89 to
d02a37b
Compare
Signed-off-by: Fabien Lavocat <4154532+FabienLavocat@users.noreply.github.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
ed90e56 to
5c62409
Compare
| opts.headers = (opts.headers as Headers) || new Headers(); | ||
| if (!opts.headers) { | ||
| opts.headers = new Headers(); | ||
| } |
There was a problem hiding this comment.
🟡 View.onRtcDrmFetch has dead null check due to preceding fallback assignment
At View.ts:552, opts.headers is always assigned a non-null value via the || fallback: opts.headers = (opts.headers as Headers) || new Headers(). The very next line if (!opts.headers) at line 553 is therefore always false, making the opts.headers = new Headers() on line 554 dead code. While this doesn't cause a crash, it indicates the null-safety intent was incorrectly implemented. The original JS code (View.js:473-475) also had this pattern, but the TypeScript rewrite should have cleaned it up.
| opts.headers = (opts.headers as Headers) || new Headers(); | |
| if (!opts.headers) { | |
| opts.headers = new Headers(); | |
| } | |
| async onRtcDrmFetch (url: string, opts: RequestInit) { | |
| if (!opts.headers || !(opts.headers instanceof Headers)) { | |
| opts.headers = new Headers(); | |
| } |
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
This PR completes the full migration of the Millicast SDK from JavaScript to TypeScript, providing type safety, improved developer experience, and better IDE support for SDK consumers.
Key Changes
🔄 TypeScript Migration
📦 Typed Event System
📤 Standardized Exports
🧹 Code Quality Improvements
🏗️ Build & Tooling
Breaking Changes
None - This migration maintains full backwards compatibility with existing JavaScript/TypeScript consumers.
Testing
✅ 345 unit tests passing (3 skipped)
✅ All E2E tests passing
✅ TypeScript compilation clean
✅ ESLint passing
✅ Build succeeds for all 6 projects