refactor(packages)!: playback adapters packages - #2567
Conversation
✅ Deploy Preview for vjs10-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@videojs/cloudflare-video
@videojs/core
@videojs/dash-video
@videojs/element
@videojs/google-cast
@videojs/hlsjs-video
@videojs/html
@videojs/media
@videojs/mux-audio
@videojs/mux-data
@videojs/mux-video
@videojs/native-hls-video
@videojs/react
@videojs/shaka-video
@videojs/spf
@videojs/spotify-audio
@videojs/store
@videojs/tiktok-video
@videojs/twitch-video
@videojs/utils
@videojs/vimeo-video
@videojs/wistia-video
@videojs/youtube-video
commit: |
📦 Bundle Size Report🎨 @videojs/html
Small changes (11, ≤ 300 B)
Presets (7)
Media (18)
Extensions (2)
Players (5)
Skins (29)
UI Components (62)
⚛️ @videojs/react
Small changes (8, ≤ 300 B)
Presets (7)
Media (22)
Extensions (2)
Players (5)
Skins (18)
UI Components (39)
🧩 @videojs/core — no changesEntries (76)
🏷️ @videojs/element — no changesEntries (2)
📦 @videojs/store — no changesEntries (3)
🔧 @videojs/utils — no changesEntries (13)
📦 @videojs/cloudflare-video
📦 @videojs/dash-video
📦 @videojs/google-cast
📦 @videojs/hlsjs-video
📦 @videojs/media
Small changes (1, ≤ 300 B)
Entries (3)
📦 @videojs/mux
📦 @videojs/mux-audio
Entries (2)
📦 @videojs/mux-data
📦 @videojs/mux-video
Entries (2)
📦 @videojs/native-hls-video
📦 @videojs/shaka-video
📦 @videojs/spf
Small changes (2, ≤ 300 B)
Entries (7)
📦 @videojs/spotify-audio
📦 @videojs/tiktok-video
📦 @videojs/twitch-video
📦 @videojs/vimeo-video
📦 @videojs/wistia-video
Entries (2)
📦 @videojs/youtube-video
ℹ️ How to interpretEach entry is independently bundled, minified, and brotli-compressed. Initial size includes its static import graph; lazy dynamic chunks are reported separately. Entries are not additive because their dependency graphs overlap. Preset rows represent realistic combined bundles. Changes of 300 B or less across initial, lazy, and total size are collapsed, not discarded. Run |
e7d3522 to
3e046e6
Compare
3e046e6 to
b7eebd9
Compare
b7eebd9 to
df52013
Compare
df52013 to
871f614
Compare
871f614 to
d193a52
Compare
| @@ -0,0 +1,48 @@ | |||
| { | |||
| "name": "@videojs/mux", | |||
There was a problem hiding this comment.
Should call out this popped up as it contained core types and stuff across mux integrations. I've kept it private for now and just let the consuming packages bundle it. We can decide later what we call it and whether it needs to be public or not (unlikely yet).
d193a52 to
309ae6b
Compare
309ae6b to
11ff2a2
Compare
cjpillsbury
left a comment
There was a problem hiding this comment.
I have one blocking question/concern that we might have missed in our discussion. Otherwise this looks great (with one nitpick blocker as well).
| @@ -0,0 +1,5 @@ | |||
| declare global { | |||
| const __DEV__: boolean; | |||
There was a problem hiding this comment.
question(non-blocking): should this be in a more shared location? (can happen later/as a followup if so)
There was a problem hiding this comment.
Right now we have these global types per package, but it would be nice if we could share a base! Leave it as a follow-up!
| import '@videojs/html/media/hlsjs-video'; | ||
| ``` | ||
|
|
||
| Each media has its own package: `@videojs/hlsjs-video`, `@videojs/mux-video`, `@videojs/mux-audio`, `@videojs/dash-video`, |
11ff2a2 to
0e87c2e
Compare
|
E2E triage: real regression. The registry-installed Next React consumer cannot resolve the newly optional |
…media packages
`@videojs/media` becomes engine-neutral. Each playback engine now ships as a
package named for the media it plays, and each extension as its own package:
- adapters: `@videojs/hlsjs-video`, `@videojs/mux-video`, `@videojs/mux-audio`,
`@videojs/dash-video`, `@videojs/shaka-video`, `@videojs/vimeo-video`,
`@videojs/wistia-video`
- extensions: `@videojs/mux-data`, `@videojs/google-cast`
Adapter packages export the Media class, its props, and defaults, and pin
their engine (hls.js, dashjs, shaka-player, ...) as an exact dependency.
`@videojs/html` and `@videojs/react` keep the façade entry points and declare
the adapter and extension packages as optional peers at exact versions.
`@videojs/spf` and the native HLS media stay built in, so `HlsVideo`,
`HlsAudio`, background, and `NativeHlsVideo` need no extra install.
Installation code on the site, CLI docs output, and the reference pages'
import sections now name the package to install beside the framework.
BREAKING CHANGE: `@videojs/media/dom/{hls-js,dash,shaka,vimeo,wistia,mux,google-cast}`
and `MuxData` under `@videojs/media/dom/mux` moved to the packages above.
Consumers must install the adapter or extension package they use.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
0e87c2e to
92b5dc0
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort 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 92b5dc0. Configure here.
| import { HlsAudioMedia } from '../hls-audio/media'; | ||
| import { MuxMediaMixin } from '../mux-video/adapter'; | ||
| import { MuxMediaMixin } from '@videojs/mux-video/spf'; | ||
| import { HlsAudioMedia } from '@videojs/spf/hls-audio'; |
There was a problem hiding this comment.
Audio SPF entry pulls video engine
Medium Severity
@videojs/mux-audio/spf now loads MuxMediaMixin and muxMediaDefaultProps from the @videojs/mux-video/spf barrel. That module evaluates MuxVideoMedia, which composes HlsVideoMedia at import time, so the audio-only entry pulls in the full SPF video engine.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 92b5dc0. Configure here.
There was a problem hiding this comment.
This is how it was before, we have some unwinding to do later.


What this does
Splits every playback engine and extension out of
@videojs/mediainto a package named for the media it plays.@videojs/mediakeeps only shared code.Packages
@videojs/hlsjs-video@videojs/mux-data@videojs/spf(HlsVideo, HlsAudio, background)@videojs/mux-video,@videojs/mux-audio@videojs/google-cast@videojs/native-hls-video@videojs/dash-video,@videojs/shaka-video@videojs/vimeo-video,@videojs/wistia-video,@videojs/youtube-video@videojs/cloudflare-video,@videojs/twitch-video,@videojs/tiktok-video,@videojs/spotify-audioRules
hls.js,dashjs,shaka-player,@vimeo/player,@wistia/wistia-player,mux-embed) as an exact dependency.@videojs/htmland@videojs/reactkeep every façade entry point and list the packages as optional peers at exact versions. Users install the framework package plus the media they play.@videojs/spfand@videojs/native-hls-videoare regular dependencies of the framework packages, so HLS and native HLS need no extra install.@videojs/mediahas two entry points:@videojs/mediaand@videojs/media/dom. Thedom/*subpaths are gone.@videojs/muxworkspace package, bundled into@videojs/mux-video,@videojs/mux-data, and@videojs/spf(code and declarations). Whether to publish it is a later call.For users
Also in this PR
@videojs/mux-video/spf(SPF-backedMuxVideoMediaplus the sharedMuxMediaMixin) and@videojs/mux-audio/spf(MuxAudioMedia). Both depend on@videojs/spf; spf no longer depends on@videojs/muxor, through it, hls.js. The unused@videojs/spf/mux-background-videoalias entry is gone (html and react alias<mux-background-video>themselves).@videojs/mux-audioexportsMuxAudioMedia, a class extending@videojs/mux-video's Media, so audio players install by the media they play. Audio extending video is upside down; aTODO(mux)marks the shared base to extract.Stack
#2598 (cdn) → #2600 (Extension naming) → #2601 (MediaExtension) → #2602 (Adapter naming) → #2603 (createMediaElement) → #2604 (createMediaComponent)
Validation
pnpm build:packages,pnpm typecheck,pnpm lint,pnpm check:workspace,pnpm test, site and CLI tests.🤖 Generated with Claude Code
Note
High Risk
Removes public
@videojs/media/dom/*entry points and changes the install/peer-dependency model for every playback integration—apps must add adapter packages or builds will fail at import time.Overview
Breaking change: playback engines and extensions that lived under
@videojs/media/dom/*are now standalone npm packages (@videojs/hlsjs-video,@videojs/mux-video,@videojs/dash-video, embed adapters,@videojs/mux-data,@videojs/google-cast, etc.).@videojs/mediais narrowed to engine-neutral contracts, hosts, and@videojs/media/domonly—thosedom/*subpath exports are removed along with bundled third-party runtimes.@videojs/htmland@videojs/reactstill expose the same façade import paths but depend on the matching adapter as an optional peer; install docs, CLIgenerateReactInstallCode, and tests now tell users to add e.g.@videojs/hlsjs-videoor@videojs/mux-audiobeside the framework package.@videojs/native-hls-videostays a direct framework dependency so native HLS does not require a separate install.Mux is reorganized: private
@videojs/muxholds shared URL/source helpers (bundled into public Mux packages), SPF-backed Mux Medias move to@videojs/mux-video/spfand@videojs/mux-audio/spf(removed from@videojs/spfexports), and@videojs/mux-audiointroducesMuxAudioMediaextending the video adapter. Release-please, CI matrices, pkg-pr-new, commitlint, sandbox, and registry e2e setup are updated to build and test the new packages; e2e overlays explicitly pull in@videojs/hlsjs-videowhere registry tests need it.Reviewed by Cursor Bugbot for commit 92b5dc0. Bugbot is set up for automated code reviews on this repo. Configure here.