Skip to content

fix(utils): polyfill AbortSignal.any for Chromium ≤115#1142

Merged
mihar-22 merged 1 commit intomainfrom
fix/abort-signal-any-polyfill
Mar 26, 2026
Merged

fix(utils): polyfill AbortSignal.any for Chromium ≤115#1142
mihar-22 merged 1 commit intomainfrom
fix/abort-signal-any-polyfill

Conversation

@mihar-22
Copy link
Copy Markdown
Member

@mihar-22 mihar-22 commented Mar 26, 2026

Fixes #1120

Summary

AbortSignal.any() isn't available in Chromium ≤115, making the player completely non-functional. This adds an anyAbortSignal() utility that feature-detects native support and falls back to manual AbortController composition.

Changes

  • Add anyAbortSignal(signals) to @videojs/utils/events — delegates to native AbortSignal.any when available ('any' in AbortSignal), otherwise composes a new AbortController that forwards abort events from all input signals
  • Replace direct AbortSignal.any() calls in AbortControllerRegistry.supersede() and Task constructor with the new utility
  • Add tests covering both native and fallback paths (9 test cases including a fallback path suite that temporarily removes AbortSignal.any)

Testing

pnpm -F @videojs/utils test
pnpm -F @videojs/store test
pnpm -F @videojs/spf test

All pass. Typecheck and lint clean.


Note

Medium Risk
Changes core cancellation/composition behavior used by Task and AbortControllerRegistry; while small and well-tested, bugs could impact abort propagation and cleanup across async flows.

Overview
Adds anyAbortSignal() to @videojs/utils/events to safely compose multiple AbortSignals, using native AbortSignal.any when available and a manual AbortController fallback otherwise.

Updates Task and AbortControllerRegistry to use anyAbortSignal() instead of AbortSignal.any, and adds a comprehensive test suite covering both native and fallback behavior (including reason propagation and pre-aborted inputs).

Written by Cursor Bugbot for commit e4a07e2. This will update automatically on new commits. Configure here.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v10-sandbox Ready Ready Preview, Comment Mar 26, 2026 8:45pm

Request Review

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 26, 2026

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit e4a07e2
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/69c59aca1bacb500089f57c8
😎 Deploy Preview https://deploy-preview-1142--vjs10-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

🎨 @videojs/html — no changes
Presets (7)
Entry Size
/video (default) 23.67 kB
/video (default + hls) 154.49 kB
/video (minimal) 23.55 kB
/video (minimal + hls) 154.28 kB
/audio (default) 21.80 kB
/audio (minimal) 21.86 kB
/background 6.80 kB
Media (6)
Entry Size
/media/background-video 1.03 kB
/media/container 1.59 kB
/media/dash-video 236.18 kB
/media/hls-video 132.24 kB
/media/mux-video 154.89 kB
/media/simple-hls-video 12.63 kB
Players (3)
Entry Size
/video/player 6.52 kB
/audio/player 6.51 kB
/background/player 6.50 kB
Skins (16)
Entry Type Size
/video/minimal-skin.css css 3.25 kB
/video/skin.css css 3.31 kB
/video/minimal-skin js 22.73 kB
/video/minimal-skin.tailwind js 23.20 kB
/video/skin js 22.88 kB
/video/skin.tailwind js 23.13 kB
/audio/minimal-skin.css css 2.37 kB
/audio/skin.css css 2.37 kB
/audio/minimal-skin js 21.05 kB
/audio/minimal-skin.tailwind js 21.38 kB
/audio/skin js 21.01 kB
/audio/skin.tailwind js 21.34 kB
/background/skin.css css 117 B
/background/skin js 1.13 kB
/base.css css 157 B
/shared.css css 86 B
UI Components (21)
Entry Size
/ui/alert-dialog 1.89 kB
/ui/alert-dialog-close 1.72 kB
/ui/alert-dialog-description 1.61 kB
/ui/alert-dialog-title 1.61 kB
/ui/buffering-indicator 1.70 kB
/ui/captions-button 1.87 kB
/ui/controls 1.69 kB
/ui/fullscreen-button 1.90 kB
/ui/mute-button 1.94 kB
/ui/pip-button 1.87 kB
/ui/play-button 1.89 kB
/ui/playback-rate-button 1.92 kB
/ui/popover 2.58 kB
/ui/poster 1.59 kB
/ui/seek-button 1.87 kB
/ui/slider 2.10 kB
/ui/thumbnail 1.94 kB
/ui/time 1.70 kB
/ui/time-slider 2.16 kB
/ui/tooltip 2.15 kB
/ui/volume-slider 2.30 kB

Sizes are marginal over the root entry point.

⚛️ @videojs/react — no changes
Presets (7)
Entry Size
/video (default) 19.29 kB
/video (default + hls) 150.23 kB
/video (minimal) 19.30 kB
/video (minimal + hls) 150.34 kB
/audio (default) 16.10 kB
/audio (minimal) 16.16 kB
/background 3.13 kB
Media (5)
Entry Size
/media/background-video 476 B
/media/dash-video 236.27 kB
/media/hls-video 132.21 kB
/media/mux-video 154.87 kB
/media/simple-hls-video 12.61 kB
Skins (14)
Entry Type Size
/video/minimal-skin.css css 3.25 kB
/video/skin.css css 3.31 kB
/video/minimal-skin js 19.22 kB
/video/minimal-skin.tailwind js 22.45 kB
/video/skin js 19.20 kB
/video/skin.tailwind js 22.44 kB
/audio/minimal-skin.css css 2.37 kB
/audio/skin.css css 2.37 kB
/audio/minimal-skin js 16.06 kB
/audio/minimal-skin.tailwind js 18.48 kB
/audio/skin js 16.00 kB
/audio/skin.tailwind js 18.40 kB
/background/skin.css css 90 B
/background/skin js 272 B
UI Components (18)
Entry Size
/ui/alert-dialog 2.28 kB
/ui/buffering-indicator 1.89 kB
/ui/captions-button 2.30 kB
/ui/controls 1.88 kB
/ui/fullscreen-button 2.30 kB
/ui/mute-button 2.29 kB
/ui/pip-button 2.31 kB
/ui/play-button 2.35 kB
/ui/playback-rate-button 2.30 kB
/ui/popover 2.90 kB
/ui/poster 1.77 kB
/ui/seek-button 2.33 kB
/ui/slider 3.16 kB
/ui/thumbnail 2.07 kB
/ui/time 1.93 kB
/ui/time-slider 2.73 kB
/ui/tooltip 2.74 kB
/ui/volume-slider 2.65 kB

Sizes are marginal over the root entry point.

🧩 @videojs/core — no changes
Entries (7)
Entry Size
. 4.97 kB
/dom 8.74 kB
/dom/media/custom-media-element 1.81 kB
/dom/media/dash 235.71 kB
/dom/media/hls 131.49 kB
/dom/media/mux 154.27 kB
/dom/media/simple-hls 12.02 kB
🏷️ @videojs/element — no changes
Entries (2)
Entry Size
. 999 B
/context 943 B
📦 @videojs/store — no changes
Entries (3)
Entry Size
. 1.38 kB
/html 700 B
/react 360 B
🔧 @videojs/utils — no changes
Entries (10)
Entry Size
/array 104 B
/dom 1.25 kB
/events 319 B
/function 261 B
/object 119 B
/predicate 265 B
/string 148 B
/style 190 B
/time 478 B
/number 158 B
📦 @videojs/spf — no changes
Entries (3)
Entry Size
. 40 B
/dom 10.22 kB
/playback-engine 10.12 kB

ℹ️ How to interpret

All sizes are standalone totals (minified + brotli).

Icon Meaning
No change
🔺 Increased ≤ 10%
🔴 Increased > 10%
🔽 Decreased
🆕 New (no baseline)

Run pnpm size locally to check current sizes.

@mihar-22 mihar-22 merged commit c3641c8 into main Mar 26, 2026
21 checks passed
@mihar-22 mihar-22 deleted the fix/abort-signal-any-polyfill branch March 26, 2026 20:47
@luwes luwes mentioned this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: AbortSignal.any is not a function in Chromium ≤115

1 participant