feat(html): re-export reactive primitives from @videojs/element#1472
feat(html): re-export reactive primitives from @videojs/element#1472
Conversation
Re-exports `ReactiveElement`, `DestroyMixin`, `Destroyable`, `PropertyDeclaration`, `PropertyDeclarationMap`, `PropertyValues`, `ReactiveController`, and `ReactiveControllerHost` from `@videojs/html`. Users extending `MediaElement` to build custom UI components need these types (e.g., `PropertyValues` to type the `update(changed)` override). Previously they had to install `@videojs/element` directly. Surfacing them from `@videojs/html` matches the package they're already importing `MediaElement` from. Suggested by @mihar-22 on #1008 (line 196). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for vjs10-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📦 Bundle Size Report🎨 @videojs/html — no changesPresets (7)
Media (8)
Players (3)
Skins (29)
UI Components (25)
Sizes are marginal over the root entry point. ⚛️ @videojs/react — no changesPresets (7)
Media (7)
Skins (26)
UI Components (20)
Sizes are marginal over the root entry point. 🧩 @videojs/core — no changesEntries (9)
🏷️ @videojs/element — no changesEntries (2)
📦 @videojs/store — no changesEntries (3)
🔧 @videojs/utils — no changesEntries (10)
📦 @videojs/spf — no changesEntries (3)
ℹ️ How to interpretAll sizes are standalone totals (minified + brotli).
Run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes 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 75335c7. Configure here.
| ReactiveControllerHost, | ||
| } from '@videojs/element'; | ||
| // Element — reactive primitives for users extending MediaElement | ||
| export { DestroyMixin, ReactiveElement } from '@videojs/element'; |
There was a problem hiding this comment.
Section comment misplaced between related export groups
Low Severity
The // Element section comment on line 11 only covers the runtime value export, while the type exports from the same @videojs/element package (lines 3–10) sit above it under the // Core section. This breaks the file's convention of grouping related exports under a single section comment. The comment belongs before line 3 so both the type and runtime exports from @videojs/element are grouped together under the // Element section.
Reviewed by Cursor Bugbot for commit 75335c7. Configure here.
- Drop unused `static tagName` from the full skip-intro example (the guide registers via `customElements.define()` directly, so the field is dead code from a userland perspective). - Forward `changed: PropertyValues` to `super.update()` in both the intro skeleton and the full example, matching first-party convention and the actual `ReactiveElement` signature. `PropertyValues` now imports from `@videojs/html` (re-exported via #1472). - Trim the "Place your component" skeleton — drop comments and `customElements.define` line — so it's a minimal anchor for what's required, leaving the full example as the first complete class. Addresses review feedback on #1008. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>


Summary
Re-exports the reactive primitives from
@videojs/elementso users extendingMediaElementto build custom UI components don't need to install and import from@videojs/elementdirectly:ReactiveElement,DestroyMixin(runtime values)Destroyable,PropertyDeclaration,PropertyDeclarationMap,PropertyValues,ReactiveController,ReactiveControllerHost(types)The motivating case is overriding
update(changed: PropertyValues)— users needPropertyValuesto type the override parameter, but it lives in@videojs/element. They're already pullingMediaElementfrom@videojs/html, so this puts the types in the same package.Purely additive — no name conflicts, no breaking change.
@videojs/elementis already a workspace dep of@videojs/html, and the runtime values (ReactiveElement,DestroyMixin) are already pulled in transitively viaMediaElement, so no bundle size cost.Context
Suggested by @mihar-22 reviewing #1008 (this comment). The "Build your own component" guide hits the same friction repeatedly.
Test plan
pnpm -F @videojs/html build— types regenerated, all re-exports present indist/dev/index.d.tspnpm -F @videojs/html test— 101 tests passpnpm check:workspace— 6/6 checks passpnpm typecheck— same baseline as origin/main (330 pre-existing errors, none introduced by this change)🤖 Generated with Claude Code
Note
Low Risk
Low risk: this is a purely additive public API change that only re-exports existing runtime values and TypeScript types, with no behavioral changes.
Overview
@videojs/htmlnow re-exports reactive primitives from@videojs/element, exposingReactiveElement/DestroyMixinplus related controller/property types (e.g.,PropertyValues).This lets consumers extending
MediaElementimport the reactive building blocks from@videojs/htmldirectly without adding a separate dependency/import path.Reviewed by Cursor Bugbot for commit 75335c7. Bugbot is set up for automated code reviews on this repo. Configure here.