Skip to content

fix(site): work around #1111 in create-player/player-controller demos#1403

Merged
decepulis merged 2 commits intomainfrom
claude/investigate-issue-1111-w6DLX
Apr 22, 2026
Merged

fix(site): work around #1111 in create-player/player-controller demos#1403
decepulis merged 2 commits intomainfrom
claude/investigate-issue-1111-w6DLX

Conversation

@decepulis
Copy link
Copy Markdown
Collaborator

@decepulis decepulis commented Apr 22, 2026

Summary

Why

createPlayer() returns PlayerController: PlayerController.Constructor<Store>. Because Constructor<Store, Result = Store> defaults Result to Store, the destructured class has both type parameters pre-bound to VideoPlayerStore — no inference slot remains for the selector's return type. The standalone PlayerController class is still generic at the new site, so Store is inferred from context and Result from the selector.

This is not a change in behavior — it's the same class and context, just routed around the eager Result default in the Constructor type alias. Both selector patterns (selectPlayback and inline lambdas) typecheck afterward.

The original contravariance story in #1111's description turned out to be a red herring; the actual mechanism is Result defaulting. Details in the #1111 follow-up comment.

Test plan

  • pnpm -F site astro check no longer reports the two Selector/VideoPlayerStore errors on:
    • site/src/components/docs/demos/html-create-player/html/css/BasicUsage.ts:23
    • site/src/components/docs/demos/player-controller/html/css/BasicUsage.ts:49
  • Both demos still render and behave identically in the dev server.
  • The remaining unrelated errors in those two files (super.update(), AbortSignal / applyElementProps) are unchanged and out of scope for this PR.

https://claude.ai/code/session_017EhSmeZYDKJyRg3QC2JdM1


Note

Low Risk
Docs demo-only change that adjusts TypeScript imports/destructuring; no production logic or runtime behavior should change.

Overview
Updates the html-create-player and player-controller docs demos to import PlayerController directly from @videojs/html and stop destructuring it from createPlayer().

This is a TypeScript typing workaround intended to unblock astro check for the demos, without changing runtime behavior.

Reviewed by Cursor Bugbot for commit 512a670. Bugbot is set up for automated code reviews on this repo. Configure here.

Import `PlayerController` directly from `@videojs/html` in the two demos
instead of destructuring it from `createPlayer()`. The destructured form
returns `PlayerController.Constructor<Store>`, which eagerly defaults
`Result` to `Store`, leaving no inference slot for the selector's return
type. The standalone class keeps both type parameters generic at the
`new` site, so inference works as expected.

Temporary — revert once #1111 is fixed properly.
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 22, 2026

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit 512a670
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/69e8d2824cd30a00081436e4
😎 Deploy Preview https://deploy-preview-1403--vjs10-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v10-sandbox Ready Ready Preview, Comment Apr 22, 2026 1:52pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

📦 Bundle Size Report

🎨 @videojs/html — no changes
Presets (7)
Entry Size
/video (default) 28.70 kB
/video (default + hls) 161.34 kB
/video (minimal) 26.22 kB
/video (minimal + hls) 158.79 kB
/audio (default) 26.57 kB
/audio (minimal) 24.17 kB
/background 4.15 kB
Media (8)
Entry Size
/media/background-video 1.04 kB
/media/container 1.73 kB
/media/dash-video 236.54 kB
/media/hls-video 133.86 kB
/media/mux-audio 160.01 kB
/media/mux-video 159.87 kB
/media/native-hls-video 3.77 kB
/media/simple-hls-video 15.80 kB
Players (3)
Entry Size
/video/player 7.21 kB
/audio/player 5.27 kB
/background/player 3.86 kB
Skins (17)
Entry Type Size
/video/minimal-skin.css css 3.50 kB
/video/skin.css css 3.53 kB
/video/minimal-skin js 26.20 kB
/video/minimal-skin.tailwind js 26.42 kB
/video/skin js 28.70 kB
/video/skin.tailwind js 28.78 kB
/audio/minimal-skin.css css 2.54 kB
/audio/skin.css css 2.50 kB
/audio/minimal-skin js 24.17 kB
/audio/minimal-skin.tailwind js 24.35 kB
/audio/skin js 26.58 kB
/audio/skin.tailwind js 26.72 kB
/background/skin.css css 117 B
/background/skin js 1.14 kB
/base.css css 157 B
/shared.css css 88 B
/skin-element js 1.35 kB
UI Components (25)
Entry Size
/ui/alert-dialog 1022 B
/ui/alert-dialog-close 509 B
/ui/alert-dialog-description 380 B
/ui/alert-dialog-title 385 B
/ui/buffering-indicator 2.46 kB
/ui/captions-button 2.63 kB
/ui/cast-button 2.66 kB
/ui/compounds 4.14 kB
/ui/controls 2.31 kB
/ui/error-dialog 3.02 kB
/ui/fullscreen-button 2.62 kB
/ui/hotkey 1.90 kB
/ui/mute-button 2.69 kB
/ui/pip-button 2.64 kB
/ui/play-button 2.66 kB
/ui/playback-rate-button 2.68 kB
/ui/popover 1.83 kB
/ui/poster 2.26 kB
/ui/seek-button 2.65 kB
/ui/slider 1.52 kB
/ui/thumbnail 2.92 kB
/ui/time 2.52 kB
/ui/time-slider 3.92 kB
/ui/tooltip 2.02 kB
/ui/volume-slider 2.66 kB

Sizes are marginal over the root entry point.

⚛️ @videojs/react — no changes
Presets (7)
Entry Size
/video (default) 23.53 kB
/video (default + hls) 154.79 kB
/video (minimal) 21.11 kB
/video (minimal + hls) 152.52 kB
/audio (default) 19.07 kB
/audio (minimal) 17.58 kB
/background 755 B
Media (7)
Entry Size
/media/background-video 575 B
/media/dash-video 235.04 kB
/media/hls-video 132.64 kB
/media/mux-audio 158.59 kB
/media/mux-video 158.53 kB
/media/native-hls-video 2.26 kB
/media/simple-hls-video 14.36 kB
Skins (14)
Entry Type Size
/video/minimal-skin.css css 3.44 kB
/video/skin.css css 3.46 kB
/video/minimal-skin js 21.04 kB
/video/minimal-skin.tailwind js 24.53 kB
/video/skin js 23.40 kB
/video/skin.tailwind js 24.66 kB
/audio/minimal-skin.css css 2.44 kB
/audio/skin.css css 2.39 kB
/audio/minimal-skin js 17.52 kB
/audio/minimal-skin.tailwind js 20.04 kB
/audio/skin js 19.01 kB
/audio/skin.tailwind js 19.97 kB
/background/skin.css css 90 B
/background/skin js 272 B
UI Components (20)
Entry Size
/ui/alert-dialog 1.14 kB
/ui/buffering-indicator 1.83 kB
/ui/captions-button 2.07 kB
/ui/cast-button 2.07 kB
/ui/controls 1.81 kB
/ui/error-dialog 2.28 kB
/ui/fullscreen-button 2.09 kB
/ui/mute-button 2.11 kB
/ui/pip-button 2.01 kB
/ui/play-button 2.00 kB
/ui/playback-rate-button 1.94 kB
/ui/popover 1.86 kB
/ui/poster 1.69 kB
/ui/seek-button 2.14 kB
/ui/slider 2.67 kB
/ui/thumbnail 2.12 kB
/ui/time 2.11 kB
/ui/time-slider 2.43 kB
/ui/tooltip 2.18 kB
/ui/volume-slider 3.19 kB

Sizes are marginal over the root entry point.

🧩 @videojs/core — no changes
Entries (9)
Entry Size
. 4.96 kB
/dom 11.84 kB
/dom/media/custom-media-element 1.90 kB
/dom/media/dash 234.13 kB
/dom/media/google-cast 4.07 kB
/dom/media/hls 131.89 kB
/dom/media/mux 158.01 kB
/dom/media/native-hls 1.61 kB
/dom/media/simple-hls 13.73 kB
🏷️ @videojs/element — no changes
Entries (2)
Entry Size
. 999 B
/context 943 B
📦 @videojs/store — no changes
Entries (3)
Entry Size
. 1.39 kB
/html 695 B
/react 360 B
🔧 @videojs/utils — no changes
Entries (10)
Entry Size
/array 104 B
/dom 1.92 kB
/events 319 B
/function 327 B
/object 275 B
/predicate 265 B
/string 148 B
/style 190 B
/time 478 B
/number 158 B
📦 @videojs/spf — no changes
Entries (3)
Entry Size
. 40 B
/dom 13.33 kB
/playback-engine 13.24 kB

ℹ️ How to interpret

All sizes are standalone totals (minified + brotli).

Icon Meaning
No change
🔺 Increased ≤ 10%
🔴 Increased > 10%
🔽 Decreased
🆕 New (no baseline)

Run pnpm size locally to check current sizes.

@decepulis decepulis marked this pull request as ready for review April 22, 2026 13:51
The demo files are rendered as source-code tabs on the public docs site,
so comments explaining internal workarounds don't belong here. The
rationale lives on #1111.
@decepulis decepulis merged commit 01c4c60 into main Apr 22, 2026
25 checks passed
@decepulis decepulis deleted the claude/investigate-issue-1111-w6DLX branch April 22, 2026 13:58
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.

2 participants