Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
✅ Deploy Preview for vjs10-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📦 Bundle Size Report
Total: 38.68 kB · +1 B · +0.0% Entry BreakdownSubpath sizes are the additional bytes on top of the root entry point, measured by bundling root + subpath together and subtracting the root-only size.
|
| Entry | Base | PR | Diff | % | |
|---|---|---|---|---|---|
. |
3.09 kB | 3.10 kB | +10 B | +0.3% | 🔺 |
./dom |
2.58 kB | 2.58 kB | -1 B | -0.0% | 🔽 |
| total | 5.67 kB | 5.68 kB | +9 B | +0.2% |
@videojs/element
| Entry | Base | PR | Diff | % | |
|---|---|---|---|---|---|
. |
817 B | 817 B | 0 B | 0% | ✅ |
./context |
823 B | 823 B | 0 B | 0% | ✅ |
| total | 1.60 kB | 1.60 kB | 0 B | 0% |
@videojs/icons
| Entry | Base | PR | Diff | % | |
|---|---|---|---|---|---|
./react |
2.10 kB | 2.10 kB | 0 B | 0% | ✅ |
./html |
1.37 kB | 1.37 kB | 0 B | 0% | ✅ |
| total | 3.46 kB | 3.46 kB | 0 B | 0% |
@videojs/react
| Entry | Base | PR | Diff | % | |
|---|---|---|---|---|---|
. |
7.69 kB | 7.69 kB | 0 B | 0% | ✅ |
./audio |
266 B | 266 B | 0 B | 0% | ✅ |
./background |
268 B | 268 B | 0 B | 0% | ✅ |
./video |
6.70 kB | 6.69 kB | -8 B | -0.1% | 🔽 |
| total | 14.90 kB | 14.89 kB | -8 B | -0.1% |
@videojs/store
| Entry | Base | PR | Diff | % | |
|---|---|---|---|---|---|
. |
1.29 kB | 1.29 kB | 0 B | 0% | ✅ |
./html |
468 B | 468 B | 0 B | 0% | ✅ |
./react |
199 B | 199 B | 0 B | 0% | ✅ |
| total | 1.94 kB | 1.94 kB | 0 B | 0% |
@videojs/utils
| Entry | Base | PR | Diff | % | |
|---|---|---|---|---|---|
./array |
104 B | 104 B | 0 B | 0% | ✅ |
./dom |
684 B | 684 B | 0 B | 0% | ✅ |
./events |
227 B | 227 B | 0 B | 0% | ✅ |
./function |
197 B | 197 B | 0 B | 0% | ✅ |
./object |
119 B | 119 B | 0 B | 0% | ✅ |
./predicate |
265 B | 265 B | 0 B | 0% | ✅ |
./string |
110 B | 110 B | 0 B | 0% | ✅ |
./style |
185 B | 185 B | 0 B | 0% | ✅ |
./time |
478 B | 478 B | 0 B | 0% | ✅ |
./number |
158 B | 158 B | 0 B | 0% | ✅ |
| total | 2.47 kB | 2.47 kB | 0 B | 0% |
ℹ️ How to interpret
Sizes are minified + brotli, measured with esbuild.
Package totals are computed as root size + marginal subpath costs.
Subpath marginal cost = (root + subpath bundled together) − root alone.
| Icon | Meaning |
|---|---|
| ✅ | No change |
| 🔺 | Increased ≤ 10% |
| 🔴 | Increased > 10% |
| 🔽 | Decreased |
| 🆕 | New (no baseline) |
Run pnpm size locally to check current sizes.
There was a problem hiding this comment.
Pull request overview
Refactors the media proxy/custom media element architecture to support delegated media behaviors (e.g., HLS) via a new delegation mixin, while renaming/reworking proxy mixins and relocating custom media element utilities into @videojs/core.
Changes:
- Added
MediaDelegateMixin+MediaDelegateto enable delegated overrides ofget/set/callwith lifecycle hooks (attach/detach). - Renamed and updated the proxy mixin (
MediaApiProxyMixin→MediaProxyMixin) and adjusted HLS to use delegation instead of an HLS mixin. - Moved/standardized custom media element imports and added a new build entry point for
dom/media/custom-media-element.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/html/src/media/hls-video/index.ts | Switches HLS custom element to extend the new delegated HLS base (HlsCustomMedia). |
| packages/html/src/media/background-video/index.ts | Updates import path to the new core CustomMediaMixin entry point. |
| packages/core/tsdown.config.ts | Adds a dedicated build entry for dom/media/custom-media-element. |
| packages/core/src/dom/tsconfig.json | Updates TS lib target from ES2020 to ES2022 for DOM package compilation. |
| packages/core/src/dom/media/proxy.ts | Removes old DOM proxy wrapper exports (now superseded by core proxy mixin usage). |
| packages/core/src/dom/media/hls.ts | Replaces HLS mixin with HlsMediaDelegate + MediaDelegateMixin composition. |
| packages/core/src/dom/media/custom-media-element.ts | Refactors to implement get/set/call directly and centralizes attr/property mapping. |
| packages/core/src/core/media/proxy.ts | Renames and re-signatures proxy mixin to MediaProxyMixin(PrimaryClass, ...AdditionalClasses). |
| packages/core/src/core/media/delegate.ts | Introduces delegation mixin for intercepting get/set/call and forwarding attach/detach. |
| internal/design/media-api.md | Updates design docs to reference MediaProxyMixin naming (needs signature alignment). |
Comments suppressed due to low confidence (2)
packages/core/src/dom/media/custom-media-element.ts:305
defaultMutedis intended to reflect the muted attribute (see comment in#define), but it now callsget('muted')/set('muted')even thoughmutedis removed from#propsToAttrs. This makesdefaultMutedtrack the native element’smutedproperty instead of the attribute and stops updating the attribute on set. Consider handlingdefaultMutedexplicitly viahasAttribute('muted')/toggleAttribute('muted', ...)(and, if needed for browser quirks, also syncnativeEl.muted).
packages/core/src/dom/media/custom-media-element.ts:253get()currently treats every attribute in#propsToAttrsas boolean-or-string and returnsfalsewhen the attribute is missing. For non-boolean attributes likesrc,preload,poster, etc., this changes the observable API (e.g.,preloadwould becomefalseinstead of the native default). Consider special-casing boolean attributes vs string attributes, or falling back tonativeEl[prop]whengetAttribute()is null for non-boolean attributes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export const MediaProxyMixin = <T extends EventTarget>( | ||
| ...MediaApiTargetClasses: AnyConstructor<T extends [unknown, ...unknown[]] ? T : any>[] |
There was a problem hiding this comment.
The design doc’s MediaProxyMixin signature no longer matches the implementation in packages/core/src/core/media/proxy.ts (which now takes PrimaryClass, ...AdditionalClasses rather than a single rest parameter with the conditional type). Updating the snippet here will avoid confusion for readers following the design doc.
| export const MediaProxyMixin = <T extends EventTarget>( | |
| ...MediaApiTargetClasses: AnyConstructor<T extends [unknown, ...unknown[]] ? T : any>[] | |
| export const MediaProxyMixin = <PrimaryClass extends EventTarget>( | |
| PrimaryClass: AnyConstructor<PrimaryClass>, | |
| ...AdditionalClasses: AnyConstructor<EventTarget>[] |
This pull request refactors the media proxy and custom media element system to improve clarity, extensibility, and code organization. The changes introduce a new delegation mixin for advanced media behavior, rename and update proxy mixins for consistency, and streamline the custom media element implementation. There are also updates to how HLS (HTTP Live Streaming) media is handled, and some minor configuration and import adjustments.
Media Proxy and Delegation Refactor:
MediaDelegateMixinandMediaDelegateinterface inmedia/delegate.ts, allowing property/method delegation to a delegate class before falling back to the base implementation. This enables advanced behaviors such as HLS support to be injected cleanly.MediaApiProxyMixintoMediaProxyMixinand updated its usage across the codebase for consistency and clarity. The new signature improves type safety and extensibility. [1] [2] [3]dom/media/proxy.tsand documentation to use the newMediaProxyMixinnaming and structure. [1] [2]Custom Media Element Improvements:
CustomMediaMixin(now incore/src/dom/media/custom-media-element.ts) to directly implementget,set, andcallmethods for property access, attribute mapping, and method invocation, simplifying the code and improving maintainability. [1] [2] [3]CustomMediaMixin.HLS Media Handling Enhancements:
HlsMediaDelegateclass, and usedMediaDelegateMixinto createHlsCustomMediaandHlsMediaclasses for web components and React, respectively. This allows HLS-specific logic to be injected via delegation. [1] [2]Build and Configuration Updates:
File and Code Organization:
packages/htmltopackages/core).These changes collectively make the media handling system more modular, extensible, and maintainable, especially for advanced use cases like HLS streaming.