refactor(packages)!: adapter renaming - #2602
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@videojs/cdn
@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 — 49 small size changes
Presets (7)
Media (18)
Players (5)
Skins (29)
UI Components (62)
⚛️ @videojs/react
Small changes (59, ≤ 300 B)
Presets (7)
Media (22)
Extensions (2)
Players (5)
Skins (18)
UI Components (39)
🧩 @videojs/core — 1 small size change
Entries (76)
🏷️ @videojs/element — no changesEntries (2)
📦 @videojs/store — no changesEntries (3)
🔧 @videojs/utils — no changesEntries (13)
📦 @videojs/cdn — no changes📦 @videojs/cloudflare-video — 1 small size change
📦 @videojs/dash-video — 1 small size change
📦 @videojs/google-cast — 1 small size change
📦 @videojs/hlsjs-video — 1 small size change
📦 @videojs/media — 2 small size changes
Entries (3)
📦 @videojs/mux — no changes📦 @videojs/mux-audio — 2 small size changes
Entries (2)
📦 @videojs/mux-data — 1 small size change
📦 @videojs/mux-video — 2 small size changes
Entries (2)
📦 @videojs/native-hls-video — no changes📦 @videojs/shaka-video — 1 small size change
📦 @videojs/spf — 3 small size changes
Entries (7)
📦 @videojs/spotify-audio — 1 small size change
📦 @videojs/tiktok-video — 1 small size change
📦 @videojs/twitch-video — 1 small size change
📦 @videojs/vimeo-video — 1 small size change
📦 @videojs/wistia-video — 2 small size changes
Entries (2)
📦 @videojs/youtube-video — 1 small size change
ℹ️ 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 |
87cb485 to
92bd400
Compare
✅ Deploy Preview for vjs10-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
92bd400 to
202b2cb
Compare
202b2cb to
9808cb7
Compare
9808cb7 to
521ec01
Compare
521ec01 to
9f229e7
Compare
9f229e7 to
9a5715e
Compare
9a5715e to
ecb1ebf
Compare
ecb1ebf to
44214bf
Compare
1780e21 to
3205d78
Compare
3205d78 to
2e02f7d
Compare
|
E2E triage: real regression — the Registry consumers |
2e02f7d to
c278e93
Compare
c278e93 to
5506cbd
Compare
5506cbd to
bc136b3
Compare
bc136b3 to
0b4554f
Compare
… defaults on the class Every playback Media class is now an `*Adapter`, its props an `*AdapterProps`, and its defaults a `static defaultProps` on the class instead of a standalone export: - `@videojs/hlsjs-video`: `HlsJsMedia` -> `HlsJsAdapter`, `HlsMediaProps` -> `HlsJsAdapterProps` - `@videojs/mux-video`: `MuxMedia` -> `MuxVideoAdapter`; `@videojs/mux-audio` exports it as `MuxAudioAdapter` - `@videojs/dash-video`, `shaka-video`, `vimeo-video`, `wistia-video`: `DashAdapter`, `ShakaAdapter`, `VimeoAdapter`, `WistiaAdapter` - `@videojs/media`: `NativeHlsAdapter`, `CloudflareAdapter`, `SpotifyAdapter`, `TikTokAdapter`, `TwitchAdapter`, `YouTubeAdapter` - `@videojs/spf`: `HlsVideoAdapter`, `HlsAudioAdapter`, `HlsBackgroundVideoAdapter`, `MuxVideoAdapter`, `MuxAudioAdapter`, `MuxBackgroundVideoAdapter`; the shared Mux identity props are `MuxAdapterProps` Subclass adapters compose their defaults from the parent's static, so the framework façades read one `Adapter.defaultProps` instead of merging two constants. The `*DefaultProps` exports are gone. BREAKING CHANGE: the exports listed above are renamed and the standalone `*MediaDefaultProps` constants are replaced by `Adapter.defaultProps`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ia reference builder The media reference builder resolved React prop defaults from a `*DefaultProps` const passed to `useSyncProps`. Adapters now expose their defaults as `static defaultProps`, optionally spreading a parent adapter's static, so the builder follows `Adapter.defaultProps` to the class (and up its `extends` chain) and resolves spreads of those members the same way. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
0b4554f to
4a62199
Compare
What this does
Every playback class is now an
*Adapter, and the media host vocabulary follows suit.Renames
HlsJsMedia,MuxMedia,DashMedia,ShakaMedia,VimeoMedia,WistiaMedia,NativeHlsMedia,YouTubeMedia,CloudflareMedia,TwitchMedia,TikTokMedia,SpotifyMediaHlsJsAdapter,MuxVideoAdapter(+MuxAudioAdapter),DashAdapter,ShakaAdapter,VimeoAdapter,WistiaAdapter,NativeHlsAdapter,YouTubeAdapter,CloudflareAdapter,TwitchAdapter,TikTokAdapter,SpotifyAdapter*MediaProps,*MediaDefaultProps*AdapterProps,static readonly defaultPropson the classHlsVideoMedia,HlsAudioMedia,HlsBackgroundVideoMedia;@videojs/mux-video/spfMuxVideoMedia,@videojs/mux-audio/spfMuxAudioMedia*Adapter; shared Mux props areMuxAdapterPropsHTMLMediaElementHost,HTMLVideoElementHost,HTMLAudioElementHostHTMLMediaAdapter,HTMLVideoAdapter,HTMLAudioAdapterMediaEngineHost,MediaHost(CustomMediaElement constraint)EngineAdapter extends PlaybackAdapter,PlaybackAdapterCustomMediaElement#host#adapterHlsJsMediaErrorsMixin,DashMediaMediaTracksMixin,NativeHlsMediaDrmMixin,ShakaMediaLiveMixin,HlsVideoMediaMixin,MuxMediaMixin, …HlsJsErrorsMixin,DashMediaTracksMixin,NativeHlsDrmMixin,ShakaLiveMixin,HlsVideoMixin,MuxMixin, … (feature mixins drop theMedia/Adapterinfix; sharedMediaTracksMixin,MediaPlayedRangesMixin,MediaAttachMixinkeep theirs)*MediaBase*AdapterCore(inner class wrapped by feature mixins) or inlinedHlsVideoMediaAPI,HlsAudioMediaAPI,HlsBackgroundVideoMediaAPI,MuxMediaAPI*AdapterAPINativeMediaHostNativeHlsHost(mixin constraint types keep the*Hostconvention)MediaExtension#setMedia(adapter)(alsoGoogleCastExtension,MuxDataExtension)setAdapter(adapter);MuxDataMediais gone, Mux Data takes anyHTMLMediaAdapterand narrows to the engine withisEngineAdapter@videojs/media/domdirectories move tohtml-media-adapter,html-video-adapter,html-audio-adapter.Files
Every
media.ts/media.tsxis nowadapter.ts/adapter.tsx, with tests to match.src/media.ts,tests/<name>-media.test.tssrc/adapter.ts,tests/adapter.test.tsadapter.ts(the mixin),media.ts(the composed class)mixin.ts,adapter.ts; testsmixin.test.ts,adapter.test.tsmedia/<name>/media.tsmedia/<name>/adapter.tsmedia/<name>/media.tsxmedia/<name>/adapter.tsxmedia.ts(x)adapter.ts(x); the react lookup triesadapter.tsxfirstDesign docs,
packages/spf/docs, and the SPF use-case skill point at the new paths.Defaults
Defaults are literals on the class (
static readonly defaultProps). Subclasses compose from the parent (MuxVideoAdapter.defaultPropsspreadsHlsJsAdapter.defaultProps), and SPF adapters declare theirs on the mixin's inner class so the composed adapter inherits them. No*DefaultPropsconstants remain.Docs builder
The media reference builder reads defaults from
Adapter.defaultProps, following local aliases, mixin chains, and parent classes, and uses the new adapter class names and paths. The*DefaultPropsconst branch is gone since nothing declares defaults that way anymore. Fixtures mirror the new shapes: the cross-package audio mixin isSpfAudioOnlyMixinwithstatic defaultPropson its inner class, likeHlsAudioMixin.Validation
Build, typecheck, lint, workspace check,
pnpm test, site tests (including the builder e2e suite), and regenerated media references with defaults present for every adapter.🤖 Generated with Claude Code
Note
Medium Risk
Wide breaking public API and import-path changes across many packages; incorrect consumer migrations or missed re-exports could break builds, but the diff is largely mechanical renaming rather than playback logic changes.
Overview
Breaking rename across playback packages: concrete player classes become
*Adapter(e.g.HlsJsMedia→HlsJsAdapter,DashMedia→DashAdapter,CloudflareMedia→CloudflareAdapter), with props types*AdapterPropsandstatic readonly defaultPropson the class instead of exported*DefaultPropsconstants.@videojs/mediacontract shift:HTMLVideoElementHost/HTMLAudioElementHost→HTMLVideoAdapter/HTMLAudioAdapter; engine ownership isEngineAdapter(wasMediaEngineHost);CustomMediaElementholds an#adapterand extensions like Google Cast usesetAdapterinstead ofsetMedia.File layout: package entrypoints move from
media.ts/media.tsxtoadapter.ts/adapter.tsx; SPF splits the canonical mixin intomixin.ts(HlsVideoMixin,HlsVideoAdapterCore) and the composed export inadapter.ts(HlsVideoAdapter extends … HTMLVideoAdapter). Feature mixins drop theMediainfix (HlsJsMediaLiveMixin→HlsJsLiveMixin, inner cores*AdapterCore).Docs and tooling (SPF design docs, implement-spf-use-case skill, sandbox demos, core store feature comments) are updated to the new names and paths; behavior is intended unchanged aside from naming and default-prop placement.
Reviewed by Cursor Bugbot for commit 4a62199. Bugbot is set up for automated code reviews on this repo. Configure here.