Skip to content

docs(packages): ship skin eject discoverability via JSDoc @see links#1574

Open
decepulis wants to merge 2 commits into
mainfrom
claude/jsdoc-skin-discoverability
Open

docs(packages): ship skin eject discoverability via JSDoc @see links#1574
decepulis wants to merge 2 commits into
mainfrom
claude/jsdoc-skin-discoverability

Conversation

@decepulis
Copy link
Copy Markdown
Collaborator

@decepulis decepulis commented May 20, 2026

Summary

Adds an @see link to every skin's JSDoc pointing to the published concepts/skins guide. Ships skin eject discoverability into the .d.ts files that AI coding agents read directly.

Background

#1558 surfaced that AI coding agents Read 15–27 distinct .d.ts files per Video.js install — they have the type signature in context but not the docs page that explains how to use it. The eject pattern — copy a packaged skin into your project and customize it — was invisible to agents because the skin's .d.ts didn't link to the guide. Agents could see VideoSkin but not know "eject" was an option.

What changed

  • Every skin variant in @videojs/react and @videojs/html (including Tailwind siblings) gets @see https://videojs.org/docs/framework/{react|html}/concepts/skins.
  • Background-video plumbing (define/background/{skin,player}.ts, define/media/background-video.ts, react/src/media/background-video/index.tsx) gets matching JSDoc since it ships as part of the background preset.
  • CLAUDE.md gets a small Skin JSDoc section codifying the convention.

Pure additions — 38 files, +327 / -0.

Test plan

  • pnpm -F @videojs/react build && pnpm -F @videojs/html build — confirm @see survives into emitted .d.ts
  • pnpm typecheck clean
  • pnpm lint clean
  • CI green

Relationship to #1570

This is the first slice of #1570 — the eject-discoverability portion that fixes the immediate problem from #1558 with low review burden. The broader sweep (JSDoc on every public API export across react / html / core, plus the CLAUDE.md rule that justifies it) stays in #1570 for team discussion.

https://claude.ai/code/session_01YDMP31nT51YrdWKSqvkT98


Generated by Claude Code


Note

Low Risk
Low risk: changes are documentation-only JSDoc additions that should not affect runtime behavior, with the main risk being accidental TypeScript declaration/doc-generation formatting issues.

Overview
Adds a new Skin JSDoc convention to CLAUDE.md, requiring skins to include an @see link to the published skins guide so the link is carried into generated .d.ts hover/docs.

Applies that convention across @videojs/html and @videojs/react by adding JSDoc blocks (including @see https://videojs.org/docs/framework/{html|react}/concepts/skins) to all skin exports/variants and to the background-video preset elements (BackgroundVideo* web components and the React BackgroundVideo component).

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

AI coding agents read .d.ts files directly when answering Video.js
questions. Without JSDoc on skin entry points, the eject path
(copy/customize a packaged skin) is invisible to agents — they can see
the skin function but not the docs page that explains how to use it.

Adds an @see link in every skin export's JSDoc pointing to the published
concepts/skins guide. The URL ships discoverability into the .d.ts so
the eject pattern surfaces alongside the symbol.

- Every skin variant in @videojs/react and @videojs/html, including
  Tailwind siblings.
- Background-video plumbing (skin + player element + media element)
  gets matching JSDoc since it ships as part of the background preset.
- CLAUDE.md gets a small "Skin JSDoc" section to codify the convention.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

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

Project Deployment Actions Updated (UTC)
v10-sandbox Ready Ready Preview, Comment May 20, 2026 7:49pm

Request Review

@netlify
Copy link
Copy Markdown

netlify Bot commented May 20, 2026

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit 3196b04
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/6a0e1029bfaed900083eb2e1
😎 Deploy Preview https://deploy-preview-1574--vjs10-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

decepulis pushed a commit that referenced this pull request May 20, 2026
Moves all skin JSDoc additions to #1574 — a smaller, focused PR that
ships the eject-discoverability fix from #1558 with low review burden.
This PR keeps the broader sweep (every public-API export across react /
html / core, plus the CLAUDE.md rule that justifies it) for team
discussion.

Reverts:
- All 16 React skin presets (audio, video, background, live-audio,
  live-video; including Tailwind siblings).
- All 16 HTML skin defines (matching set).
- Background plumbing: define/background/{skin,player}.ts,
  define/media/background-video.ts, react/media/background-video/index.tsx.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

📦 Bundle Size Report

🎨 @videojs/html — no changes
Presets (7)
Entry Size
/video (default) 38.57 kB
/video (default + hls) 172.02 kB
/video (minimal) 38.10 kB
/video (minimal + hls) 171.55 kB
/audio (default) 33.08 kB
/audio (minimal) 30.01 kB
/background 4.23 kB
Media (8)
Entry Size
/media/background-video 1.04 kB
/media/container 1.72 kB
/media/dash-video 236.58 kB
/media/hls-video 134.87 kB
/media/mux-audio 161.08 kB
/media/mux-video 161.00 kB
/media/native-hls-video 4.62 kB
/media/simple-hls-video 16.70 kB
Players (5)
Entry Size
/video/player 7.06 kB
/audio/player 5.18 kB
/background/player 3.92 kB
/live-video/player 7.07 kB
/live-audio/player 5.19 kB
Skins (30)
Entry Type Size
/video/minimal-skin.css css 4.67 kB
/video/skin.css css 4.73 kB
/video/minimal-skin js 38.02 kB
/video/minimal-skin.tailwind js 38.44 kB
/video/skin js 38.58 kB
/video/skin.tailwind js 38.99 kB
/audio/minimal-skin.css css 2.90 kB
/audio/skin.css css 2.93 kB
/audio/minimal-skin js 29.94 kB
/audio/minimal-skin.tailwind js 30.17 kB
/audio/skin js 33.09 kB
/audio/skin.tailwind js 33.28 kB
/background/skin.css css 133 B
/background/skin js 1.16 kB
/live-video/minimal-skin.css css 4.67 kB
/live-video/skin.css css 4.73 kB
/live-video/minimal-skin js 33.19 kB
/live-video/minimal-skin.tailwind js 33.24 kB
/live-video/skin js 33.34 kB
/live-video/skin.tailwind js 33.28 kB
/live-audio/minimal-skin.css css 2.90 kB
/live-audio/skin.css css 2.93 kB
/live-audio/minimal-skin js 25.19 kB
/live-audio/minimal-skin.tailwind js 24.99 kB
/live-audio/skin js 27.86 kB
/live-audio/skin.tailwind js 27.63 kB
/global.css css 176 B
/shared.css css 88 B
/tailwind.css css 228 B
/skin-element js 1.37 kB
UI Components (35)
Entry Size
/ui/alert-dialog 713 B
/ui/alert-dialog-close 363 B
/ui/alert-dialog-description 307 B
/ui/alert-dialog-title 309 B
/ui/buffering-indicator 2.11 kB
/ui/captions-button 2.08 kB
/ui/cast-button 2.08 kB
/ui/compounds 5.53 kB
/ui/controls 1.99 kB
/ui/error-dialog 2.51 kB
/ui/fullscreen-button 2.14 kB
/ui/hotkey 2.77 kB
/ui/menu 2.78 kB
/ui/mute-button 2.10 kB
/ui/pip-button 2.07 kB
/ui/play-button 2.08 kB
/ui/playback-rate-button 2.19 kB
/ui/playback-rate-menu 3.90 kB
/ui/popover 1.87 kB
/ui/poster 1.87 kB
/ui/seek-button 2.07 kB
/ui/seek-indicator 2.71 kB
/ui/seek-indicator-value 306 B
/ui/slider 1.19 kB
/ui/status-announcer 2.47 kB
/ui/status-indicator 2.50 kB
/ui/status-indicator-value 159 B
/ui/thumbnail 2.54 kB
/ui/time 1.92 kB
/ui/time-slider 3.04 kB
/ui/tooltip 1.79 kB
/ui/volume-indicator 2.74 kB
/ui/volume-indicator-fill 335 B
/ui/volume-indicator-value 328 B
/ui/volume-slider 3.56 kB

Sizes are marginal over the root entry point.

⚛️ @videojs/react — no changes
Presets (7)
Entry Size
/video (default) 32.29 kB
/video (default + hls) 164.70 kB
/video (minimal) 32.33 kB
/video (minimal + hls) 164.64 kB
/audio (default) 26.57 kB
/audio (minimal) 26.60 kB
/background 754 B
Media (7)
Entry Size
/media/background-video 575 B
/media/dash-video 235.21 kB
/media/hls-video 133.39 kB
/media/mux-audio 159.84 kB
/media/mux-video 159.74 kB
/media/native-hls-video 3.13 kB
/media/simple-hls-video 15.27 kB
Skins (27)
Entry Type Size
/tailwind.css css 228 B
/video/minimal-skin.css css 4.58 kB
/video/skin.css css 4.64 kB
/video/minimal-skin js 32.27 kB
/video/minimal-skin.tailwind js 37.00 kB
/video/skin js 32.19 kB
/video/skin.tailwind js 37.04 kB
/audio/minimal-skin.css css 2.77 kB
/audio/skin.css css 2.80 kB
/audio/minimal-skin js 26.54 kB
/audio/minimal-skin.tailwind js 26.25 kB
/audio/skin js 26.46 kB
/audio/skin.tailwind js 29.52 kB
/background/skin.css css 90 B
/background/skin js 272 B
/live-video/minimal-skin.css css 4.58 kB
/live-video/skin.css css 4.64 kB
/live-video/minimal-skin js 23.69 kB
/live-video/minimal-skin.tailwind js 28.15 kB
/live-video/skin js 23.74 kB
/live-video/skin.tailwind js 28.15 kB
/live-audio/minimal-skin.css css 2.77 kB
/live-audio/skin.css css 2.80 kB
/live-audio/minimal-skin js 19.95 kB
/live-audio/minimal-skin.tailwind js 22.38 kB
/live-audio/skin js 20.00 kB
/live-audio/skin.tailwind js 22.52 kB
UI Components (29)
Entry Size
/ui/alert-dialog 1.08 kB
/ui/buffering-indicator 1.86 kB
/ui/captions-button 2.08 kB
/ui/cast-button 2.04 kB
/ui/controls 1.84 kB
/ui/error-dialog 2.27 kB
/ui/fullscreen-button 2.08 kB
/ui/gesture 1.32 kB
/ui/hotkey 1.90 kB
/ui/live-button 2.10 kB
/ui/menu 4.29 kB
/ui/mute-button 2.03 kB
/ui/pip-button 2.04 kB
/ui/play-button 2.06 kB
/ui/playback-rate-button 2.04 kB
/ui/playback-rate-menu 4.61 kB
/ui/popover 2.32 kB
/ui/poster 1.69 kB
/ui/seek-button 2.07 kB
/ui/seek-indicator 1.87 kB
/ui/slider 3.22 kB
/ui/status-announcer 1.76 kB
/ui/status-indicator 1.96 kB
/ui/thumbnail 1.95 kB
/ui/time 2.51 kB
/ui/time-slider 2.97 kB
/ui/tooltip 2.72 kB
/ui/volume-indicator 1.98 kB
/ui/volume-slider 2.30 kB

Sizes are marginal over the root entry point.

🧩 @videojs/core — no changes
Entries (9)
Entry Size
. 7.47 kB
/dom 15.30 kB
/dom/media/custom-media-element 1.90 kB
/dom/media/dash 234.36 kB
/dom/media/google-cast 4.07 kB
/dom/media/hls 132.98 kB
/dom/media/mux 159.13 kB
/dom/media/native-hls 2.52 kB
/dom/media/simple-hls 14.62 kB
🏷️ @videojs/element — no changes
Entries (2)
Entry Size
. 996 B
/context 943 B
📦 @videojs/store — no changes
Entries (3)
Entry Size
. 1.39 kB
/html 696 B
/react 360 B
🔧 @videojs/utils — no changes
Entries (10)
Entry Size
/array 104 B
/dom 1.96 kB
/events 319 B
/function 327 B
/object 275 B
/predicate 265 B
/string 192 B
/style 190 B
/time 478 B
/number 158 B
📦 @videojs/spf — no changes
Entries (3)
Entry Size
. 4.45 kB
/dom 6.32 kB
/hls 14.03 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.

The skin .d.ts files ship into AI agent context. Leading the customize
sentence with "eject" puts the searchable term right in the symbol's
JSDoc — agents pick it up without an extra round trip to the docs.

Replaces the longer per-skin "build from primitives like X, Y, Z" prose
with a single line that names the eject pattern explicitly and points
at the docs for the rest.
@decepulis decepulis marked this pull request as ready for review May 20, 2026 19:52
Comment thread CLAUDE.md
Comment on lines +523 to +539
### Skin JSDoc

Skins — preset components that compose primitives into a complete player experience — carry an `@see` link in their JSDoc that points to the published skins guide. The URL ships discoverability into the `.d.ts` so IDE hover-docs, generated reference pages, and AI coding agents surface the guide alongside the symbol.

```ts
/**
* Default video player skin with a complete media UI.
*
* To customize, eject this skin and build from primitives. Read more about eject in the docs.
*
* @see https://videojs.org/docs/framework/react/concepts/skins
*/
export function VideoSkin(props: VideoSkinProps): ReactNode;
```

The `@see` target must already exist. Tailwind variants share the body of their non-Tailwind sibling and add a one-liner noting the variant.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer if this was more generic by detailing how to document UI components for HTML and React.

Comment on lines +86 to 89
/** Custom element tag name. */
static readonly tagName = 'live-audio-skin-tailwind';
/** Shadow DOM template cloned into each instance. */
static template = createTemplate(getTemplateHTML());
Copy link
Copy Markdown
Member

@mihar-22 mihar-22 May 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments add no value. Recommend removing all of the class field comments from the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants