This repository was archived by the owner on Oct 21, 2026. It is now read-only.
Repository navigation
Conversation
`@videojs/media/dom/mux` leaked `mux-embed` types into its emitted
declarations: `types.d.ts` carried a `/// <reference path>` rewritten to
an absolute build-machine path (TS6053) and re-exported from `mux-embed`,
and `mux-data.d.ts` printed `import("mux-embed").Metadata` (TS7016), a
package that publishes no `types`. Any strict consumer of the Mux media or
Mux Data entries in `@videojs/html` and `@videojs/react` failed to compile.
Spell out the shapes Mux Data relies on as local public types
(`MuxDataMetadata`, `MuxDataMonitorOptions`, `MuxDataSdk`,
`MuxDataEngineOptions`) and keep `mux-embed`'s own declarations to the
implementation, where the un-preserved reference directive is dropped from
emit. Cover the Mux entries in the html and react public-types fixtures,
and add a `check:public-types` fixture, task, and CI step for
`@videojs/media` itself.
Refs #2369
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@videojs/core
@videojs/element
@videojs/html
@videojs/media
@videojs/react
@videojs/spf
@videojs/store
@videojs/utils
commit: |
Contributor
📦 Bundle Size Report🎨 @videojs/html — no changesPresets (7)
Media (18)
Extensions (2)
Players (5)
Skins (29)
UI Components (50)
⚛️ @videojs/react — no changesPresets (7)
Media (22)
Extensions (2)
Players (5)
Skins (26)
UI Components (39)
🧩 @videojs/core — no changesEntries (76)
🏷️ @videojs/element — no changesEntries (2)
📦 @videojs/store — no changesEntries (3)
🔧 @videojs/utils — no changesEntries (13)
📦 @videojs/media
Entries (23)
📦 @videojs/spf — no changesEntries (10)
ℹ️ 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 |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs videojs/video.js#9465
Depends on #2593
Summary
Adding the Mux entries to the
@videojs/htmland@videojs/reactpublic-types fixtures (media/mux-video,media/mux-audio,extensions/mux-data, and the reacthls-js/spfflavors) fails a strict consumer (skipLibCheck: false) with errors that all come from@videojs/media:packages/media/dist/dev/dom/mux/types.d.ts(1,22): error TS6053: File '../../../../../Users/<build-machine>/packages/media/node_modules/mux-embed/dist/types/mux-embed.d.ts' not found.packages/media/dist/dev/dom/mux/types.d.ts(2,62): error TS7016: Could not find a declaration file for module 'mux-embed'.packages/media/dist/dev/dom/mux/mux-data.d.ts(56,26)and(57,30): error TS7016: Could not find a declaration file for module 'mux-embed'.(get/set metadata(): import("mux-embed").Metadata)How the types leaked:
mux-embedpublishes notypes; its declarations live atdist/types/mux-embed.d.tsas an ambientdeclare module 'mux-embed'.src/dom/mux/types.tspulled that file in with/// <reference path="../../../node_modules/..." preserve="true" />and re-exportedMux/Optionsfrom it.preserve="true"kept the directive in the emitted declarations, where the path is rewritten relative to the output (hence the absolute build-machine path), andMuxDataProps.metadata: MuxDataOptions['data']resolved through the ambient module so the emitter printedimport("mux-embed").Metadata. Consumers never have that ambient module in their program, so every Mux entry downstream failed to typecheck.Changes
packages/media/src/dom/mux/mux-data.ts: define the public shapes Mux Data relies on locally —MuxDataMetadata(the keys Mux Data reads or derives, plus an index signature for every other documented key),MuxDataMonitorOptions, andMuxDataSdk(themonitor()/utilssurface this integration calls).MuxDataPropsuses them. Themux-embedreference directive stays for the implementation only, withoutpreserve, so declaration emit drops it and nothing exported namesmux-embed. The real SDK is still checked againstMuxDataSdkatmuxDataDefaultProps.MuxDataSdk = Mux, and the realMetadata/HlsOptionsat thetarget.mux.*call sites.packages/media/src/dom/mux/mux-data-engine.ts:MuxDataEngineOptionsbecomes a local interface overMuxDataEngineHandle(Record<PropertyKey, unknown>, matchingmux-embed's ownGenericObject).packages/media/src/dom/mux/index.ts: exportMuxDataMetadata,MuxDataMonitorOptions,MuxDataSdkso consumers can name whatMuxDataPropsrefers to.types.tsis removed.packages/media/tests/public-types/{index.ts,tsconfig.json}+check:public-typestask inpackages/media/vite.config.ts+ CI step: strict consumer of the root entry,/dom,/media-tracks, and everydom/*subpath.dom/vimeoanddom/wistiaare left out with a note (see below).packages/html/tests/public-types/index.ts,packages/react/tests/public-types/index.tsx: add the Mux entries, including ametadataassignment and aMuxDataSdk={undefined}opt-out.Option (a) from the issue was chosen over shipping an ambient
declare module 'mux-embed'because an ambient module in our published declarations would collide with any consumer's owndeclare module 'mux-embed'shim, would need the dts pipeline to copy a vendored 1000-line file, and would forcemux-embed's globalHTMLMediaElementaugmentation on every consumer.Known leaks outside this PR
The new media fixture surfaced two pre-existing third-party declaration problems that are unrelated to Mux and are excluded here rather than papered over:
@vimeo/player's types importtiming-objectand../src/lib/timing-src-connector(TS2307/TS7016), and@wistia/wistia-player's types import@wistia/type-guards(TS2307). A strict consumer of@videojs/media/dom/vimeo,@videojs/media/dom/wistia, or the html/reactvimeo-video/wistia-videoentries hits these today. Worth a follow-up issue.Testing
pnpm exec vp run @videojs/media#build— nomux-embedimport or/// <referenceremains inpackages/media/dist/dev/**/*.d.ts(only in comments).pnpm exec tsgo --project packages/media/tsconfig.dts.json --noEmit— clean.pnpm exec vp run @videojs/media#check:public-types,@videojs/html#check:public-types,@videojs/react#check:public-types— all pass (html/react fail on the base branch once the Mux entries are added).pnpm -F @videojs/media test— 48 files, 1141 tests pass.pnpm typecheck,pnpm check:workspace,pnpm lint:fix:fileon touched files,git diff --check— clean. Lint reports advisoryanti-slopwarnings only (including one onRecord<PropertyKey, unknown>), matching the pre-existing warnings in these files.🤖 Generated with Claude Code