Skip to content

fix(html): restore deprecated slot="media" for backwards compatibility#1020

Merged
mihar-22 merged 1 commit intomainfrom
fix/restore-deprecated-media-slot
Mar 19, 2026
Merged

fix(html): restore deprecated slot="media" for backwards compatibility#1020
mihar-22 merged 1 commit intomainfrom
fix/restore-deprecated-media-slot

Conversation

@mihar-22
Copy link
Copy Markdown
Member

Summary

  • PR refactor(html): context-based media discovery, remove slot="media" #997 removed slot="media" from all HTML skin templates in favor of context-based media discovery
  • This restores <slot name="media"></slot> alongside the new <slot></slot> in all 9 skin templates to avoid breaking users who pass slot="media" on their media elements
  • The named slot is marked with <!-- @deprecated slot="media" is no longer required, use the default slot instead --> to signal migration

How it works: Web Components named slots take priority over the default slot. Elements with slot="media" are captured by the named slot; everything else falls into the default slot. Both work simultaneously.

Affected files

All in packages/html/src/define/:

  • video/skin.ts, video/minimal-skin.ts, video/skin.tailwind.ts, video/minimal-skin.tailwind.ts
  • audio/skin.ts, audio/minimal-skin.ts, audio/skin.tailwind.ts, audio/minimal-skin.tailwind.ts
  • background/skin.ts

Test plan

  • Build passes: pnpm -F @videojs/html build
  • Media element with slot="media" still renders correctly inside skin
  • Media element without slot="media" (default slot) also works

🤖 Generated with Claude Code

PR #997 removed slot="media" from all skin templates. This restores the
named slot alongside the new default slot so users who haven't migrated
yet don't break. The slot is marked @deprecated with a comment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 19, 2026

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

Project Deployment Actions Updated (UTC)
v10-sandbox Ready Ready Preview, Comment Mar 19, 2026 6:27am

Request Review

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 19, 2026

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit aabae9e
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/69bb973bc4e2620008d75961
😎 Deploy Preview https://deploy-preview-1020--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.

@mihar-22 mihar-22 changed the title fix(skin): restore deprecated slot="media" for backwards compatibility fix(html): restore deprecated slot="media" for backwards compatibility Mar 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

🎨 @videojs/html — no changes
Presets (7)
Entry Size
/video (default) 23.12 kB
/video (default + hls) 153.76 kB
/video (minimal) 23.03 kB
/video (minimal + hls) 153.49 kB
/audio (default) 21.39 kB
/audio (minimal) 21.36 kB
/background 6.34 kB
Media (5)
Entry Size
/media/background-video 1.02 kB
/media/container 1.58 kB
/media/dash-video 236.15 kB
/media/hls-video 131.77 kB
/media/simple-hls-video 12.33 kB
Players (3)
Entry Size
/video/player 6.21 kB
/audio/player 6.20 kB
/background/player 6.19 kB
Skins (16)
Entry Type Size
/video/minimal-skin.css css 3.11 kB
/video/skin.css css 3.14 kB
/video/minimal-skin js 22.24 kB
/video/minimal-skin.tailwind js 22.46 kB
/video/skin js 22.35 kB
/video/skin.tailwind js 22.69 kB
/audio/minimal-skin.css css 2.25 kB
/audio/skin.css css 2.29 kB
/audio/minimal-skin js 20.61 kB
/audio/minimal-skin.tailwind js 20.67 kB
/audio/skin js 20.63 kB
/audio/skin.tailwind js 20.88 kB
/background/skin.css css 117 B
/background/skin js 1003 B
/base.css css 157 B
/shared.css css 43 B
UI Components (21)
Entry Size
/ui/alert-dialog 2.13 kB
/ui/alert-dialog-close 1.62 kB
/ui/alert-dialog-description 1.51 kB
/ui/alert-dialog-title 1.54 kB
/ui/buffering-indicator 1.83 kB
/ui/captions-button 1.79 kB
/ui/controls 1.64 kB
/ui/fullscreen-button 1.79 kB
/ui/mute-button 1.81 kB
/ui/pip-button 1.80 kB
/ui/play-button 1.82 kB
/ui/playback-rate-button 1.82 kB
/ui/popover 3.30 kB
/ui/poster 1.70 kB
/ui/seek-button 1.82 kB
/ui/slider 2.01 kB
/ui/thumbnail 2.11 kB
/ui/time 1.62 kB
/ui/time-slider 2.11 kB
/ui/tooltip 2.44 kB
/ui/volume-slider 2.19 kB

Sizes are marginal over the root entry point.

⚛️ @videojs/react — no changes
Presets (7)
Entry Size
/video (default) 18.94 kB
/video (default + hls) 149.81 kB
/video (minimal) 18.98 kB
/video (minimal + hls) 149.69 kB
/audio (default) 14.94 kB
/audio (minimal) 14.98 kB
/background 3.13 kB
Media (4)
Entry Size
/media/background-video 476 B
/media/dash-video 236.19 kB
/media/hls-video 131.59 kB
/media/simple-hls-video 12.34 kB
Skins (14)
Entry Type Size
/video/minimal-skin.css css 3.11 kB
/video/skin.css css 3.14 kB
/video/minimal-skin js 18.90 kB
/video/minimal-skin.tailwind js 22.08 kB
/video/skin js 18.89 kB
/video/skin.tailwind js 22.08 kB
/audio/minimal-skin.css css 2.25 kB
/audio/skin.css css 2.29 kB
/audio/minimal-skin js 14.90 kB
/audio/minimal-skin.tailwind js 16.98 kB
/audio/skin js 14.90 kB
/audio/skin.tailwind js 17.24 kB
/background/skin.css css 90 B
/background/skin js 272 B
UI Components (18)
Entry Size
/ui/alert-dialog 2.23 kB
/ui/buffering-indicator 2.20 kB
/ui/captions-button 2.24 kB
/ui/controls 2.21 kB
/ui/fullscreen-button 2.22 kB
/ui/mute-button 2.24 kB
/ui/pip-button 2.22 kB
/ui/play-button 2.22 kB
/ui/playback-rate-button 2.25 kB
/ui/popover 2.86 kB
/ui/poster 2.03 kB
/ui/seek-button 2.22 kB
/ui/slider 3.12 kB
/ui/thumbnail 2.01 kB
/ui/time 1.93 kB
/ui/time-slider 2.63 kB
/ui/tooltip 2.69 kB
/ui/volume-slider 2.70 kB

Sizes are marginal over the root entry point.

🧩 @videojs/core — no changes
Entries (6)
Entry Size
. 4.80 kB
/dom 8.41 kB
/dom/media/custom-media-element 1.81 kB
/dom/media/dash 235.62 kB
/dom/media/hls 131.27 kB
/dom/media/simple-hls 11.85 kB
🏷️ @videojs/element — no changes
Entries (2)
Entry Size
. 999 B
/context 943 B
📦 @videojs/store — no changes
Entries (3)
Entry Size
. 1.32 kB
/html 700 B
/react 360 B
🔧 @videojs/utils — no changes
Entries (10)
Entry Size
/array 104 B
/dom 1.25 kB
/events 227 B
/function 261 B
/object 119 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 10.04 kB
/playback-engine 9.94 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.

@mihar-22 mihar-22 marked this pull request as ready for review March 19, 2026 06:29
@mihar-22 mihar-22 requested review from Copilot and sampotts March 19, 2026 06:29
@mihar-22 mihar-22 merged commit eabd065 into main Mar 19, 2026
21 checks passed
@mihar-22 mihar-22 deleted the fix/restore-deprecated-media-slot branch March 19, 2026 06:29
@luwes luwes mentioned this pull request Mar 19, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Restores the deprecated slot="media" named slot across HTML skin templates to maintain backward compatibility for users still slotting their media element by name, while keeping the newer default-slot approach.

Changes:

  • Added a deprecated <slot name="media"></slot> alongside the default <slot></slot> in all affected skins.
  • Annotated the named slot with a deprecation HTML comment to guide migration.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/html/src/define/video/skin.ts Adds deprecated media named slot before the default slot in the video default skin template.
packages/html/src/define/video/skin.tailwind.ts Adds deprecated media named slot before the default slot in the Tailwind video default skin template.
packages/html/src/define/video/minimal-skin.ts Adds deprecated media named slot before the default slot in the video minimal skin template.
packages/html/src/define/video/minimal-skin.tailwind.ts Adds deprecated media named slot before the default slot in the Tailwind video minimal skin template.
packages/html/src/define/audio/skin.ts Adds deprecated media named slot before the default slot in the audio default skin template.
packages/html/src/define/audio/skin.tailwind.ts Adds deprecated media named slot before the default slot in the Tailwind audio default skin template.
packages/html/src/define/audio/minimal-skin.ts Adds deprecated media named slot before the default slot in the audio minimal skin template.
packages/html/src/define/audio/minimal-skin.tailwind.ts Adds deprecated media named slot before the default slot in the Tailwind audio minimal skin template.
packages/html/src/define/background/skin.ts Adds deprecated media named slot before the default slot in the background skin template.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@luwes luwes mentioned this pull request Apr 11, 2026
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