This repository was archived by the owner on Oct 21, 2026. It is now read-only.
Repository navigation
Conversation
Unversioned CDN URLs such as https://unpkg.com/video.js/dist/video.min.js follow npm's `latest` tag, so publishing video.js@10 there would turn existing Video.js 8 pages into 404s and empty styles. The build now writes a small redirect at every v8 script and stylesheet path in `dist/`, listed from a pinned `video.js-8` devDependency. Scripts load the same path from video.js@8 on the CDN that served them: `document.write` for parser-inserted tags, a synchronous request plus indirect eval for async, deferred, and page-code loads, and a script tag when a CSP blocks eval. Stylesheets `@import` the v8 file by relative URL. Each page logs one warning to pin video.js@8. Bundlers keep resolving `video.js/dist/video-js.css` to an empty stylesheet, now `dist/empty.css` through `exports`, because CDNs serve the literal path to the redirect. Refs #2763 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A new `video-js-cdn` suite packs `video.js`, serves the tarball the way unpkg and jsDelivr serve the `latest` tag next to the pinned Video.js 8 release, and loads v8 embeds through it in Chromium, Firefox, and WebKit: the v8 README embed per URL prefix, the alt and unminified builds, `data-setup`, async, defer, page-code loads, a nonce-based CSP, a CSP that blocks eval, and an unrecognized CDN. Pages load from `localhost` and CDN files from `127.0.0.1`, so they stay cross-origin without a public origin; Chromium holds public-to-loopback requests for a Local Network Access prompt. E2E runs it on pushes to main and on pull requests that touch `packages/video.js`, the suite, the workflow, or the lockfile. Refs #2763 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The migration guide's intro now tells v8 pages that load from an unversioned CDN URL that those paths redirect to video.js@8, and to pin video.js@8 in the URL to skip the redirect. Refs #2763 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@videojs/cdn
@videojs/cli
@videojs/core
@videojs/element
@videojs/html
@videojs/media
@videojs/react
@videojs/spf
@videojs/store
@videojs/utils
video.js
@videojs/cloudflare-video
@videojs/dash-video
@videojs/hlsjs-video
@videojs/mux-audio
@videojs/mux-video
@videojs/native-hls-video
@videojs/shaka-video
@videojs/spotify-audio
@videojs/tiktok-video
@videojs/twitch-video
@videojs/vimeo-video
@videojs/wistia-video
@videojs/youtube-video
@videojs/google-cast
@videojs/mux-data
commit: |
✅ Deploy Preview for vjs10-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for vjs-registry canceled.
|
Contributor
📦 Bundle Size Report🎨 @videojs/html — no changesPresets (7)
Media (18)
Players (5)
Skins (41)
UI Components (62)
⚛️ @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/cdn — no changes📦 @videojs/cloudflare-video — no changes📦 @videojs/dash-video — no changes📦 @videojs/google-cast — no changes📦 @videojs/hlsjs-video — no changes📦 @videojs/media — no changesEntries (3)
📦 @videojs/mux — no changes📦 @videojs/mux-audio — no changesEntries (2)
📦 @videojs/mux-data — no changes📦 @videojs/mux-video — no changesEntries (2)
📦 @videojs/native-hls-video — no changes📦 @videojs/shaka-video — no changes📦 @videojs/spf — no changesEntries (7)
📦 @videojs/spotify-audio — no changes📦 @videojs/tiktok-video — no changes📦 @videojs/twitch-video — no changes📦 @videojs/other — 1 small size change
Entries (3)
📦 @videojs/vimeo-video — no changes📦 @videojs/wistia-video — no changesEntries (2)
📦 @videojs/youtube-video — no changesℹ️ 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 |
The suite's global setup imports `@videojs/utils/predicate`, which resolves to built output. The E2E job only built `video.js`, so setup failed with "Cannot find module" before any test ran. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
4 tasks
mihar-22
marked this pull request as ready for review
October 6, 2026 20:28
This was referenced Oct 7, 2026
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.
Closes #2763
Refs #3156
Summary
Unversioned CDN URLs such as
https://unpkg.com/video.js/dist/video.min.jsfollow npm'slatesttag, and the v8 README recommends that exact URL. Once #3156 publishesvideo.js@10underlatest, those pages would get a 404 for the player and an empty stylesheet. This PR puts a small redirect at every Video.js 8 script and stylesheet path invideo.js@10. Each one loads the same file fromvideo.js@8on the same CDN, so those pages keep running v8.Changes
dist/, generated at build time from the paths in a pinnedvideo.js-8devDependency (npm:video.js@8.24.1)./video.js/dist/(or/video.js@<anything>/dist/) for/video.js@8/dist/, and loads v8 before the page's next script runs:<script src>tags:document.write, copying the page's nonce.async,defer, and loads from page code: a synchronous request plus indirecteval, so the tag'sloadevent still meansvideojsexists.eval: a script tag, so v8 still loads, but late.@imports the v8 stylesheet by relative URL, with no script involved.video.js@8.video.js/dist/video-js.cssto an empty stylesheet. Theexportsentry now points atdist/empty.css, because CDNs ignoreexportsand serve the redirect at the literal path.AGENTS.md, and the migration guide tell v8 CDN users to pinvideo.js@8.Why redirects instead of copying v8's files, as #2763 proposed
Since #3132,
@videojs/coredepends onvideo.js, so a copy of v8's files would land in every@videojs/htmland@videojs/reactinstall:.tgz)@8Known gaps:
eval, combined with page code that waits for the script'sonload: v8 loads, but after the callback..jsonfiles and font files aren't redirected. v8's CSS has its font built in.document.writefor uncached cross-origin scripts on 2G connections. Not tested.async,defer, and page-code paths.Testing
pnpm exec vp run '@videojs/e2e#test:video-js-cdn': a new suite with 12 tests, each run in Chromium, Firefox, and WebKit. It packsvideo.jsand serves the tarball next to the pinned v8 release, laid out like unpkg (with its redirects) and like jsDelivr. A new E2E job runs it whenpackages/video.js, the suite, the workflow, or the lockfile changes.document.write, skipping the synchronous request, or rewriting to the wrong path each make tests fail.pnpm -F video.js test: adds a check thatvideo.js/dist/video-js.cssresolves throughexportsto a stylesheet with no rules. It fails if the export points back at the redirect.video.js@8loading live.pnpm typecheck,pnpm lint,pnpm check:workspace, andpnpm -F site test diataxis.Before merge
package.jsonconflicts with main's 10.0.1 version bump, so it needs resolving when feat(video.js): publish video.js to npm under latest #3156 is retargeted to main.Closes #2763only takes effect once this PR targets main.https://vjs.zencdn.net/8.x/, but that URL returns 403. zencdn serves exact versions only: 8.23.4 loads, but 8.23.8, 8.24.0, and 8.24.1 return 403. The docs here point tovideo.js@8instead.latest, publish the first 10.x under a different tag and load the real unpkg and jsDelivr URLs.🤖 Generated with Claude Code
Note
Medium Risk
Published
video.jsCDN assets now execute redirect logic (including sync XHR/eval anddocument.write), which affects any site still using unversioned v8 CDN URLs once v10 islatest.Overview
When
video.js@10becomes npmlatest, unversioned CDN URLs (for exampleunpkg.com/video.js/dist/video.min.js) would serve a package with no player. This PR generates redirect stubs at every v8dist/script and stylesheet path in the publishedvideo.js@10tarball so those URLs still load Video.js 8 fromvideo.js@8on the same CDN, with a one-time console warning to pin@8.Script redirects use
document.writefor parser-inserted tags, sync fetch + eval for async/defer/dynamic loads, and a script-tag fallback when CSP blocks eval; stylesheets@importthe v8 file. Bundlers keep resolvingvideo.js/dist/video-js.cssto an empty file viaexports(empty.css), while CDNs get the redirect at the literal path. A build plugin copies the template from a pinnedvideo.js-8devDependency.CI and tests: a new
video-js-cdnPlaywright suite (Chromium, Firefox, WebKit) mocks unpkg/jsDelivr/cdnjs-style routing, plus an E2E workflow job and path-based change detection. Docs (README, agent guide, migration guide) tell v8 CDN users to version-pin.Reviewed by Cursor Bugbot for commit 7cbae48. Bugbot is set up for automated code reviews on this repo. Configure here.