fix: castable mixin redundant optional chaining#238
fix: castable mixin redundant optional chaining#238ronald-urbina wants to merge 3 commits intomuxinc:mainfrom
Conversation
|
@ronald-urbina is attempting to deploy a commit to the Mux Team on Vercel. A member of the Team first needs to authorize it. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6612e3a. Configure here.
| } | ||
|
|
||
| class PeerTubeVideoElement extends MediaPlayedRangesMixin(MediaTracksMixin(globalThis.HTMLElement ?? class {})) { | ||
| class PeerTubeVideoElement extends MediaPlayedRangesMixin(MediaTracksMixin(HTMLElement)) { |
There was a problem hiding this comment.
SSR fallback removed for HTMLElement base class
High Severity
The globalThis.HTMLElement ?? class {} fallback was replaced with a bare HTMLElement reference. Every other element in the codebase (e.g., cloudflare-video-element, spotify-audio-element, tiktok-video-element, twitch-video-element) uses the globalThis.HTMLElement ?? class {} pattern to avoid a ReferenceError in non-browser environments like SSR or Node.js. This change breaks that SSR safety for PeerTubeVideoElement.
Reviewed by Cursor Bugbot for commit 6612e3a. Configure here.


Removed unnecessary
?.optional chaining in themuted,volume,duration, andcurrentTimegetters ofCastableMediaMixin#castPlayeris already verified truthy by the enclosingifcondition, so the optional chaining was a no-opNote
Medium Risk
Switching
PeerTubeVideoElementto extendHTMLElementdirectly can break non-browser/SSR environments that relied on the previous fallback base class. README edits are low risk but reduce documented guidance around required transpilation/browser targets.Overview
Removes the README’s Browser support guidance about packages shipping as ESNext and relying on consumer transpilation.
Updates
PeerTubeVideoElementto extendHTMLElementdirectly (dropping the priorglobalThis.HTMLElement ?? class {}fallback), tightening the assumption that a native DOM environment is present.Reviewed by Cursor Bugbot for commit 76c6c5a. Bugbot is set up for automated code reviews on this repo. Configure here.